mirror of
https://github.com/curl/curl.git
synced 2026-08-06 09:06:13 +03:00
url: use same credentials on redirect
Previously it could lose the username and only use the password. Added test 998 and 999 to verify. Reported-by: Tobias Bora Fixes #15262 Closes #15282
This commit is contained in:
parent
eb77297ccc
commit
9bee39bfed
6 changed files with 257 additions and 73 deletions
|
|
@ -679,6 +679,9 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
|
|||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
if(data->set.str[STRING_USERNAME] ||
|
||||
data->set.str[STRING_PASSWORD])
|
||||
data->state.creds_from = CREDS_OPTION;
|
||||
if(!result)
|
||||
result = Curl_setstropt(&data->state.aptr.user,
|
||||
data->set.str[STRING_USERNAME]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue