mirror of
https://github.com/curl/curl.git
synced 2026-08-06 01:56:14 +03:00
http: clear the proxy credentials as well on port or scheme change
Add tests 2009-2011 to verify switching between proxies with credentials when the switch is driven by a redirect Reported-by: Dwij Mehta Closes #21304
This commit is contained in:
parent
9ceb3ff46a
commit
188c2f166a
7 changed files with 262 additions and 16 deletions
12
lib/http.c
12
lib/http.c
|
|
@ -1278,12 +1278,24 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl,
|
|||
curlx_free(scheme);
|
||||
}
|
||||
if(clear) {
|
||||
CURLcode result = Curl_reset_userpwd(data);
|
||||
if(result) {
|
||||
curlx_free(follow_url);
|
||||
return result;
|
||||
}
|
||||
curlx_safefree(data->state.aptr.user);
|
||||
curlx_safefree(data->state.aptr.passwd);
|
||||
}
|
||||
}
|
||||
}
|
||||
DEBUGASSERT(follow_url);
|
||||
{
|
||||
CURLcode result = Curl_reset_proxypwd(data);
|
||||
if(result) {
|
||||
curlx_free(follow_url);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
if(type == FOLLOW_FAKE) {
|
||||
/* we are only figuring out the new URL if we would have followed locations
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue