fixes bug 132329 "HTTP auto goes into infinite loop"

r=gagan sr=rpotts a=valeski
This commit is contained in:
darin%netscape.com 2002-03-28 22:57:41 +00:00
parent cf03d42a52
commit 1eb206d67b

View File

@ -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;
}