1
0
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:
Daniel Stenberg 2003-10-20 20:30:40 +00:00
parent 31b6bb6a41
commit 7d6584e140

View File

@ -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)