From 1bd183664a347b14dc67073f47124d33a7efa292 Mon Sep 17 00:00:00 2001 From: "badami%netscape.com" Date: Mon, 11 Mar 2002 13:25:25 +0000 Subject: [PATCH] regression in removing invalid passwords from password manager bug 127863 r=morse sr=darin a=asa --- netwerk/protocol/http/src/nsHttpChannel.cpp | 24 ++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/netwerk/protocol/http/src/nsHttpChannel.cpp b/netwerk/protocol/http/src/nsHttpChannel.cpp index 2b6c90ccd692..ff3d4427c681 100644 --- a/netwerk/protocol/http/src/nsHttpChannel.cpp +++ b/netwerk/protocol/http/src/nsHttpChannel.cpp @@ -1644,18 +1644,12 @@ nsHttpChannel::PromptForUserPass(const char *host, } // construct the domain string + // we always add the port to domain since it is used + // as the key for storing in password maanger. nsCAutoString domain; domain.Assign(host); - // Add port only if it was originally specified in the URI - PRInt32 uriPort = -1; - mURI->GetPort(&uriPort); - if (uriPort != -1) { - domain.Append(':'); - domain.AppendInt(port); - } - - NS_ConvertASCIItoUCS2 hostU(domain); - + domain.Append(':'); + domain.AppendInt(port); domain.Append(" ("); domain.Append(realm); domain.Append(')'); @@ -1670,6 +1664,16 @@ nsHttpChannel::PromptForUserPass(const char *host, if (NS_FAILED(rv)) return rv; // figure out what message to display... + nsCAutoString displayHost; + displayHost.Assign(host); + // Add port only if it was originally specified in the URI + PRInt32 uriPort = -1; + mURI->GetPort(&uriPort); + if (uriPort != -1) { + displayHost.Append(':'); + displayHost.AppendInt(port); + } + NS_ConvertASCIItoUCS2 hostU(displayHost); nsXPIDLString message; if (proxyAuth) { const PRUnichar *strings[] = { hostU.get() };