summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-09-13 09:42:37 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-09-13 09:42:37 +0200
commit3b1a69badec62b8411d6fb6b2dc227b6ade8782a (patch)
treebf06ea6fc2e0b8b2edff6456dd51643566437fca
parent2ddaed81b334bfb23a4f850a4714cbace1113a6d (diff)
downloadcurl-bagder/proxy-connect-ua.tar.gz
fixup the CONNECT user-agent fix for hyper backend as wellbagder/proxy-connect-ua
-rw-r--r--lib/http_proxy.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/http_proxy.c b/lib/http_proxy.c
index fe63b8c15..58489abec 100644
--- a/lib/http_proxy.c
+++ b/lib/http_proxy.c
@@ -836,9 +836,17 @@ static CURLcode CONNECT(struct Curl_easy *data,
goto error;
if(!Curl_checkProxyheaders(data, conn, "User-Agent") &&
- data->set.str[STRING_USERAGENT] &&
- Curl_hyper_header(data, headers, data->state.aptr.uagent))
- goto error;
+ data->set.str[STRING_USERAGENT]) {
+ struct dynbuf ua;
+ Curl_dyn_init(&ua, DYN_HTTP_REQUEST);
+ result = Curl_dyn_addf(&ua, "User-Agent: %s\r\n",
+ data->set.str[STRING_USERAGENT]);
+ if(result)
+ goto error;
+ if(Curl_hyper_header(data, headers, Curl_dyn_ptr(&ua)))
+ goto error;
+ Curl_dyn_free(&ua);
+ }
if(!Curl_checkProxyheaders(data, conn, "Proxy-Connection") &&
Curl_hyper_header(data, headers, "Proxy-Connection: Keep-Alive"))