mirror of
https://github.com/curl/curl.git
synced 2026-08-25 23:03:39 +03:00
- Constantine Sapuntzakis posted bug report #2813123
(http://curl.haxx.se/bug/view.cgi?id=2813123) and an a patch that fixes the problem: Url A is accessed using auth. Url A redirects to Url B (on a different server0. Url B reuses a persistent connection. Url B has auth, even though it's on a different server. Note: if Url B does not reuse a persistent connection, auth is not sent.
This commit is contained in:
parent
2aaff16a87
commit
5cf78472e1
3 changed files with 36 additions and 13 deletions
22
lib/http.c
22
lib/http.c
|
|
@ -1780,17 +1780,6 @@ CURLcode Curl_http_connect(struct connectdata *conn, bool *done)
|
|||
}
|
||||
#endif /* CURL_DISABLE_PROXY */
|
||||
|
||||
if(!data->state.this_is_a_follow) {
|
||||
/* this is not a followed location, get the original host name */
|
||||
if(data->state.first_host)
|
||||
/* Free to avoid leaking memory on multiple requests*/
|
||||
free(data->state.first_host);
|
||||
|
||||
data->state.first_host = strdup(conn->host.name);
|
||||
if(!data->state.first_host)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
if(conn->protocol & PROT_HTTPS) {
|
||||
/* perform SSL initialization */
|
||||
if(data->state.used_interface == Curl_if_multi) {
|
||||
|
|
@ -2094,6 +2083,17 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
|||
else
|
||||
http = data->state.proto.http;
|
||||
|
||||
if(!data->state.this_is_a_follow) {
|
||||
/* this is not a followed location, get the original host name */
|
||||
if(data->state.first_host)
|
||||
/* Free to avoid leaking memory on multiple requests*/
|
||||
free(data->state.first_host);
|
||||
|
||||
data->state.first_host = strdup(conn->host.name);
|
||||
if(!data->state.first_host)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
if( (conn->protocol&(PROT_HTTP|PROT_FTP)) &&
|
||||
data->set.upload) {
|
||||
httpreq = HTTPREQ_PUT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue