From 5a4dbb8ae37841748be2d0d97e508ea51c21ce92 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 23 May 2022 16:47:17 +0200 Subject: [PATCH] hyper: use 'alt-used' Makes test 412+413 work Closes #8898 --- lib/c-hyper.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/c-hyper.c b/lib/c-hyper.c index 69082982cf..9ea2e883b9 100644 --- a/lib/c-hyper.c +++ b/lib/c-hyper.c @@ -1047,6 +1047,21 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) goto error; } +#ifndef CURL_DISABLE_ALTSVC + if(conn->bits.altused && !Curl_checkheaders(data, STRCONST("Alt-Used"))) { + char *altused = aprintf("Alt-Used: %s:%d\r\n", + conn->conn_to_host.name, conn->conn_to_port); + if(!altused) { + result = CURLE_OUT_OF_MEMORY; + goto error; + } + result = Curl_hyper_header(data, headers, altused); + if(result) + goto error; + free(altused); + } +#endif + #ifndef CURL_DISABLE_PROXY if(conn->bits.httpproxy && !conn->bits.tunnel_proxy && !Curl_checkheaders(data, STRCONST("Proxy-Connection")) && -- 2.47.3