mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 16:18:48 -05:00
allow no user and no passwd when doing basic auth
This commit is contained in:
parent
31b6bb6a41
commit
7d6584e140
@ -125,7 +125,9 @@ static CURLcode Curl_output_basic(struct connectdata *conn)
|
|||||||
char *authorization;
|
char *authorization;
|
||||||
struct SessionHandle *data=conn->data;
|
struct SessionHandle *data=conn->data;
|
||||||
|
|
||||||
sprintf(data->state.buffer, "%s:%s", conn->user, conn->passwd);
|
sprintf(data->state.buffer, "%s:%s",
|
||||||
|
conn->user?conn->user:"",
|
||||||
|
conn->passwd?conn->passwd:"");
|
||||||
if(Curl_base64_encode(data->state.buffer, strlen(data->state.buffer),
|
if(Curl_base64_encode(data->state.buffer, strlen(data->state.buffer),
|
||||||
&authorization) >= 0) {
|
&authorization) >= 0) {
|
||||||
if(conn->allocptr.userpwd)
|
if(conn->allocptr.userpwd)
|
||||||
|
Loading…
Reference in New Issue
Block a user