allow no user and password for proxy too, Basic
authorDaniel Stenberg <daniel@haxx.se>
Mon, 20 Oct 2003 20:32:08 +0000 (20:32 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 20 Oct 2003 20:32:08 +0000 (20:32 +0000)
lib/http.c

index 95e06ec..bb09be1 100644 (file)
@@ -146,7 +146,9 @@ static CURLcode Curl_output_basic_proxy(struct connectdata *conn)
   char *authorization;
   struct SessionHandle *data=conn->data;
 
-  sprintf(data->state.buffer, "%s:%s", conn->proxyuser, conn->proxypasswd);
+  sprintf(data->state.buffer, "%s:%s",
+          conn->proxyuser?conn->proxyuser:"",
+          conn->proxypasswd?conn->proxypasswd:"");
   if(Curl_base64_encode(data->state.buffer, strlen(data->state.buffer),
                         &authorization) >= 0) {
     Curl_safefree(conn->allocptr.proxyuserpwd);