From b28e758bd258ed040e4e1e35591089ca7500d5d5 Mon Sep 17 00:00:00 2001 From: "darin%netscape.com" Date: Thu, 28 Mar 2002 22:57:41 +0000 Subject: [PATCH] fixes bug 132329 "HTTP auto goes into infinite loop" r=gagan sr=rpotts a=valeski git-svn-id: svn://10.0.0.236/trunk@117706 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp b/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp index c0b47f85841..7052ed30dae 100644 --- a/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp @@ -1588,7 +1588,7 @@ nsHttpChannel::GetCredentials(const char *challenges, // proxy auth's never in prehost. only take user:pass from URL if this // is the first 401 response (mUser and mPass hold previously attempted // username and password). - if (!proxyAuth && mUser.IsEmpty() && mPass.IsEmpty()) + if (!proxyAuth && (mUser == nsnull) && (mPass == nsnull)) GetUserPassFromURI(getter_Copies(mUser), getter_Copies(mPass)); // figure out which challenge we can handle and which authenticator to use. @@ -1896,6 +1896,13 @@ nsHttpChannel::PromptForUserPass(const char *host, return rv; if (!retval) return NS_ERROR_ABORT; + + // if prompting succeeds, then username and password must be non-null. + if (*user == nsnull) + *user = ToNewUnicode(NS_LITERAL_STRING("")); + if (*pass == nsnull) + *pass = ToNewUnicode(NS_LITERAL_STRING("")); + return NS_OK; }