fixup make test 2011 run as well

This commit is contained in:
Daniel Stenberg 2026-04-14 15:51:24 +02:00
parent 17bd39484b
commit d6464f991c
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 24 additions and 4 deletions

View file

@ -1289,6 +1289,13 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl,
}
}
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

View file

@ -451,15 +451,25 @@ CURLcode Curl_reset_userpwd(struct Curl_easy *data)
if(!result)
result = Curl_setstropt(&data->state.aptr.passwd,
data->set.str[STRING_PASSWORD]);
return result;
}
/*
* Restore the proxy credentials to those set in options.
*/
CURLcode Curl_reset_proxypwd(struct Curl_easy *data)
{
#ifndef CURL_DISABLE_PROXY
if(!result)
result = Curl_setstropt(&data->state.aptr.proxyuser,
data->set.str[STRING_PROXYUSERNAME]);
CURLcode result = Curl_setstropt(&data->state.aptr.proxyuser,
data->set.str[STRING_PROXYUSERNAME]);
if(!result)
result = Curl_setstropt(&data->state.aptr.proxypasswd,
data->set.str[STRING_PROXYPASSWORD]);
#endif
return result;
#else
(void)data;
return CURLE_OK;
#endif
}
/*
@ -612,6 +622,8 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
if(!result)
result = Curl_reset_userpwd(data);
if(!result)
result = Curl_reset_proxypwd(data);
data->req.headerbytecount = 0;
Curl_headers_cleanup(data);

View file

@ -32,6 +32,7 @@ char *Curl_checkheaders(const struct Curl_easy *data,
void Curl_init_CONNECT(struct Curl_easy *data);
CURLcode Curl_reset_userpwd(struct Curl_easy *data);
CURLcode Curl_reset_proxypwd(struct Curl_easy *data);
CURLcode Curl_pretransfer(struct Curl_easy *data);
CURLcode Curl_sendrecv(struct Curl_easy *data);