Bug 431890: nsStandardURL::SetSpec does not fail when host contains leading space " ". r+sr=cbiesinger

This commit is contained in:
Magnus Melin 2008-09-14 21:15:06 +03:00
parent e4c7e07942
commit 84837afd35
2 changed files with 4 additions and 4 deletions

View File

@ -495,6 +495,8 @@ nsStandardURL::BuildNormalizedSpec(const char *spec)
Substring(spec + mHost.mPos, spec + mHost.mPos + mHost.mLen);
if (tempHost.FindChar('\0') != kNotFound)
return NS_ERROR_MALFORMED_URI; // null embedded in hostname
if (tempHost.FindChar(' ') != kNotFound)
return NS_ERROR_MALFORMED_URI; // don't allow spaces in the hostname
if ((useEncHost = NormalizeIDN(tempHost, encHost)))
approxLen += encHost.Length();
else

View File

@ -15,10 +15,8 @@ function run_test() {
catch (e) {
success = e.result == Cr.NS_ERROR_MALFORMED_URI;
}
if (!success) {
// This is failing: bug 431890
//do_throw("We didn't throw NS_ERROR_MALFORMED_URI when a space was passed in the hostname!");
}
if (!success)
do_throw("We didn't throw NS_ERROR_MALFORMED_URI when a space was passed in the hostname!");
success = false;
try {