summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-08-20 13:34:51 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-08-20 13:51:06 +0200
commit059379d20cd8d414738593d938d29b46d8abf519 (patch)
tree62f50be1a8ace14312cc0789f621f20adecc2bde /lib
parentf46b83fc94148efd363a457b4631b99e7c13baec (diff)
downloadcurl-059379d20cd8d414738593d938d29b46d8abf519.tar.gz
http_proxy: fix user-agent and custom headers for CONNECT with hyper
Enable test 287 Closes #7598
Diffstat (limited to 'lib')
-rw-r--r--lib/http_proxy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/http_proxy.c b/lib/http_proxy.c
index a0168cbf5..9ce5ee848 100644
--- a/lib/http_proxy.c
+++ b/lib/http_proxy.c
@@ -840,9 +840,8 @@ static CURLcode CONNECT(struct Curl_easy *data,
Curl_hyper_header(data, headers, data->state.aptr.proxyuserpwd))
goto error;
- if(data->set.str[STRING_USERAGENT] &&
- *data->set.str[STRING_USERAGENT] &&
- data->state.aptr.uagent &&
+ if(!Curl_checkProxyheaders(data, conn, "User-Agent") &&
+ data->set.str[STRING_USERAGENT] &&
Curl_hyper_header(data, headers, data->state.aptr.uagent))
goto error;
@@ -850,6 +849,9 @@ static CURLcode CONNECT(struct Curl_easy *data,
Curl_hyper_header(data, headers, "Proxy-Connection: Keep-Alive"))
goto error;
+ if(Curl_add_custom_headers(data, TRUE, headers))
+ goto error;
+
sendtask = hyper_clientconn_send(client, req);
if(!sendtask) {
failf(data, "hyper_clientconn_send");