]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
url: allow non-HTTPS altsvc-matching for debug builds
authorDaniel Stenberg <daniel@haxx.se>
Thu, 9 Apr 2020 13:08:46 +0000 (15:08 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 9 Apr 2020 15:46:24 +0000 (17:46 +0200)
This is already partly supported but this part was missing.
Reported-by: James Fuller
Closes #5205

lib/url.c

index 47fc66aedda6e80120c7e38093c60267b5897a9f..4c62b50ec3cc2376f0f0e4d577bedcf3bf3e5646 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -3040,7 +3040,14 @@ static CURLcode parse_connect_to_slist(struct Curl_easy *data,
 
 #ifdef USE_ALTSVC
   if(data->asi && !host && (port == -1) &&
-     (conn->handler->protocol == CURLPROTO_HTTPS)) {
+     ((conn->handler->protocol == CURLPROTO_HTTPS) ||
+#ifdef CURLDEBUG
+      /* allow debug builds to circumvent the HTTPS restriction */
+      getenv("CURL_ALTSVC_HTTP")
+#else
+      0
+#endif
+       )) {
     /* no connect_to match, try alt-svc! */
     enum alpnid srcalpnid;
     bool hit;