fixes bug 201986 "infinite network loop when auth realm changes" r=dougt sr=alecf

This commit is contained in:
darin%netscape.com 2003-04-14 21:35:27 +00:00
Родитель cc322f2a40
Коммит 3a149a2869
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -1806,8 +1806,11 @@ nsHttpChannel::GetCredentials(const char *challenges,
// proxy auth's never in prehost. only take user:pass from URL if this
// is the first 401 response (mIdent holds previously attempted identity).
if (!proxyAuth && mIdent.IsEmpty())
PRBool identFromURI = PR_FALSE;
if (!proxyAuth && mIdent.IsEmpty()) {
GetIdentityFromURI(authFlags, mIdent);
identFromURI = !mIdent.IsEmpty();
}
const char *host;
PRInt32 port;
@ -1875,6 +1878,11 @@ nsHttpChannel::GetCredentials(const char *challenges,
}
}
}
else if (!identFromURI) {
// hmm... identity invalid, but no auth entry! the realm probably
// changed (see bug 201986).
ident->Clear();
}
if (!entry && ident->IsEmpty()) {
// at this point we are forced to interact with the user to get their