From 7d6584e1407ad3c4a067515faf431c15e698103b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 20 Oct 2003 20:30:40 +0000 Subject: [PATCH] allow no user and no passwd when doing basic auth --- lib/http.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/http.c b/lib/http.c index 9e2196ab2..95e06ecf8 100644 --- a/lib/http.c +++ b/lib/http.c @@ -125,7 +125,9 @@ static CURLcode Curl_output_basic(struct connectdata *conn) char *authorization; 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), &authorization) >= 0) { if(conn->allocptr.userpwd)