mirror of
https://github.com/curl/curl.git
synced 2025-02-17 14:59:45 +08:00
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
This commit is contained in:
parent
45d1e24b74
commit
3bbf62b5a4
@ -2189,7 +2189,7 @@ CURLcode Curl_http_target(struct Curl_easy *data,
|
||||
/* Extract the URL to use in the request. Store in STRING_TEMP_URL for
|
||||
clean-up reasons if the function returns before the free() further
|
||||
down. */
|
||||
uc = curl_url_get(h, CURLUPART_URL, &url, 0);
|
||||
uc = curl_url_get(h, CURLUPART_URL, &url, CURLU_NO_DEFAULT_PORT);
|
||||
if(uc) {
|
||||
curl_url_cleanup(h);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
@ -43,7 +43,7 @@ proxy
|
||||
|
||||
<verify>
|
||||
<protocol>
|
||||
GET http://www.example.com:80/ HTTP/1.1
|
||||
GET http://www.example.com/ HTTP/1.1
|
||||
Host: www.example.com
|
||||
Accept: */*
|
||||
Proxy-Connection: Keep-Alive
|
||||
|
Loading…
Reference in New Issue
Block a user