]> granicus.if.org Git - curl/commitdiff
allow no user and no passwd when doing basic auth
authorDaniel Stenberg <daniel@haxx.se>
Mon, 20 Oct 2003 20:30:40 +0000 (20:30 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 20 Oct 2003 20:30:40 +0000 (20:30 +0000)
lib/http.c

index 9e2196ab288bedfa2de1ef667386de25380b329a..95e06ecf86d7f6489c7ca78775a524f3c6229e75 100644 (file)
@@ -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)