]> granicus.if.org Git - curl/commitdiff
avoid proxy (and other) auth if no user+password is given
authorDaniel Stenberg <daniel@haxx.se>
Thu, 4 Sep 2003 10:08:53 +0000 (10:08 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 4 Sep 2003 10:08:53 +0000 (10:08 +0000)
lib/http.c

index f4d200eebfec970d8633ca5054c7a4d2b32d466b..3b447dddcde70311f62c5dd8a6beade2e7ea4b58 100644 (file)
@@ -196,8 +196,10 @@ CURLcode http_auth_headers(struct connectdata *conn,
   if(!data->state.authstage) {
     if(conn->bits.httpproxy && conn->bits.proxy_user_passwd)
       Curl_http_auth_stage(data, 407);
-    else
+    else if(conn->bits.user_passwd)
       Curl_http_auth_stage(data, 401);
+    else
+      return CURLE_OK; /* no authentication with no user or password */
   }
 
   /* To prevent the user+password to get sent to other than the original