aboutsummaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-10-20 20:30:40 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-10-20 20:30:40 +0000
commit7d6584e1407ad3c4a067515faf431c15e698103b (patch)
tree9bb112a9dacca90aba58aaaff5cf70ce82a6ae3d /lib/http.c
parent31b6bb6a41ce1a59d26b27be955a9073c393a796 (diff)
allow no user and no passwd when doing basic auth
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c4
1 files changed, 3 insertions, 1 deletions
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)