From: Daniel Stenberg Date: Mon, 23 May 2022 14:47:17 +0000 (+0200) Subject: hyper: use 'alt-used' X-Git-Tag: curl-7_84_0~149 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a4dbb8ae37841748be2d0d97e508ea51c21ce92;p=thirdparty%2Fcurl.git hyper: use 'alt-used' Makes test 412+413 work Closes #8898 --- 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")) &&