bug 421840, relax restriction on empty user:info to fix mailnews regression bug 419116. r/sr=biesi,neil, a=dsicore
authordveditz@cruzio.com
Fri, 14 Mar 2008 18:31:42 -0700
changeset 13106 1d117b877a463b8d528cb21ec7f7a4fd68f6aff0
parent 13105 990794df70dae75bc4fac4ffdf49c2917a21e0a0
child 13107 e413593ee1deba9698bd92a3663148a4d4fe75e9
push idunknown
push userunknown
push dateunknown
reviewersdsicore
bugs421840, 419116
milestone1.9b5pre
bug 421840, relax restriction on empty user:info to fix mailnews regression bug 419116. r/sr=biesi,neil, a=dsicore
netwerk/base/src/nsURLParsers.cpp
--- a/netwerk/base/src/nsURLParsers.cpp
+++ b/netwerk/base/src/nsURLParsers.cpp
@@ -526,18 +526,21 @@ nsAuthURLParser::ParseUserInfo(const cha
                                PRUint32 *usernamePos, PRInt32 *usernameLen,
                                PRUint32 *passwordPos, PRInt32 *passwordLen)
 {
     NS_PRECONDITION(userinfo, "null pointer");
 
     if (userinfoLen < 0)
         userinfoLen = strlen(userinfo);
 
-    if (userinfoLen == 0)
-        return NS_ERROR_MALFORMED_URI;
+    if (userinfoLen == 0) {
+        SET_RESULT(username, 0, -1);
+        SET_RESULT(password, 0, -1);
+        return NS_OK;
+    }
 
     const char *p = (const char *) memchr(userinfo, ':', userinfoLen);
     if (p) {
         // userinfo = <username:password>
         if (p == userinfo) {
             // must have a username!
             return NS_ERROR_MALFORMED_URI;
         }