]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
hyper: use 'alt-used'
authorDaniel Stenberg <daniel@haxx.se>
Mon, 23 May 2022 14:47:17 +0000 (16:47 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 23 May 2022 14:47:17 +0000 (16:47 +0200)
Makes test 412+413 work

Closes #8898

lib/c-hyper.c

index 69082982cfc5c843a078af05c836eaf44232a24c..9ea2e883b92d1475c95952d45f190e31974d7a7a 100644 (file)
@@ -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")) &&