mirror of
https://github.com/curl/curl.git
synced 2026-07-16 03:17:15 +03:00
When basic is the only auth wanted (which it is by default), the auth phase
is always considered done immediately as Basic needs to extra passes. This fix corrects bug report #848371.
This commit is contained in:
parent
b3803903d1
commit
1d977b7848
1 changed files with 18 additions and 14 deletions
32
lib/http.c
32
lib/http.c
|
|
@ -227,13 +227,15 @@ CURLcode http_auth_headers(struct connectdata *conn,
|
|||
}
|
||||
else
|
||||
#endif
|
||||
if((data->state.authwant == CURLAUTH_BASIC) && /* Basic */
|
||||
conn->bits.proxy_user_passwd &&
|
||||
!checkheaders(data, "Proxy-authorization:")) {
|
||||
auth=(char *)"Basic";
|
||||
result = Curl_output_basic_proxy(conn);
|
||||
if(result)
|
||||
return result;
|
||||
if(data->state.authwant == CURLAUTH_BASIC) {
|
||||
/* Basic */
|
||||
if(conn->bits.proxy_user_passwd &&
|
||||
!checkheaders(data, "Proxy-authorization:")) {
|
||||
auth=(char *)"Basic";
|
||||
result = Curl_output_basic_proxy(conn);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
*ready = TRUE;
|
||||
/* Switch to web authentication after proxy authentication is done */
|
||||
Curl_http_auth_stage(data, 401);
|
||||
|
|
@ -276,13 +278,15 @@ CURLcode http_auth_headers(struct connectdata *conn,
|
|||
return result;
|
||||
*ready = TRUE;
|
||||
}
|
||||
else if((data->state.authwant == CURLAUTH_BASIC) && /* Basic */
|
||||
conn->bits.user_passwd &&
|
||||
!checkheaders(data, "Authorization:")) {
|
||||
auth=(char *)"Basic";
|
||||
result = Curl_output_basic(conn);
|
||||
if(result)
|
||||
return result;
|
||||
else if(data->state.authwant == CURLAUTH_BASIC) {/* Basic */
|
||||
if(conn->bits.user_passwd &&
|
||||
!checkheaders(data, "Authorization:")) {
|
||||
auth=(char *)"Basic";
|
||||
result = Curl_output_basic(conn);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
/* basic is always ready */
|
||||
*ready = TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue