8000 http: strip default port from URL sent to proxy · curl/curl@3bbf62b · GitHub
[go: up one dir, main page]

Skip to content

Commit 3bbf62b

Browse files
committed
http: strip default port from URL sent to proxy
To make sure the Host: header and the URL provide the same authority portion when sent to the proxy, strip the default port number from the URL if one was provided. Reported-by: Michael Brown Fixes #6769 Closes #6778
1 parent 45d1e24 commit 3bbf62b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/http.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2189,7 +2189,7 @@ CURLcode Curl_http_target(struct Curl_easy *data,
21892189
/* Extract the URL to use in the request. Store in STRING_TEMP_URL for
21902190
clean-up reasons if the function returns before the free() further
21912191
down. */
2192-
uc = curl_url_get(h, CURLUPART_URL, &url, 0);
2192+
uc = curl_url_get(h, CURLUPART_URL, &url, CURLU_NO_DEFAULT_PORT);
21932193
if(uc) {
21942194
curl_url_cleanup(h);
21952195
return CURLE_OUT_OF_MEMORY;

tests/data/test659

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ proxy
4343

4444
<verify>
4545
<protocol>
46-
GET http://www.example.com:80/ HTTP/1.1
46+
GET http://www.example.com/ HTTP/1.1
4747
Host: www.example.com
4848
Accept: */*
4949
Proxy-Connection: Keep-Alive

0 commit comments

Comments
 (0)
0