]> granicus.if.org Git - curl/commitdiff
bail out properly on a 407 when we can't authenticate basic, bug report
authorDaniel Stenberg <daniel@haxx.se>
Thu, 20 Nov 2003 09:53:42 +0000 (09:53 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 20 Nov 2003 09:53:42 +0000 (09:53 +0000)
#845247

lib/http.c

index 9d01ef87a9aaea9b2a4e9781fe91b12190479daf..d7496ecde000991b5c2b09bbc5d00cca635c8083 100644 (file)
@@ -402,8 +402,9 @@ CURLcode Curl_http_auth(struct connectdata *conn,
       }
       else if(checkprefix("Basic", start)) {
         *availp |= CURLAUTH_BASIC;
-        if((data->state.authwant == CURLAUTH_BASIC) && (httpcode == 401)) {
-          /* We asked for Basic authentication but got a 401 back
+        if((data->state.authwant == CURLAUTH_BASIC) &&
+           (httpcode == data->state.authstage)) {
+          /* We asked for Basic authentication but got a 40X back
              anyway, which basicly means our name+password isn't
              valid. */
           data->state.authavail = CURLAUTH_NONE;