mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-15 03:00:30 +00:00
allowing ftp URLs w/ anonymous username to automatically use anonymous password. r+sr=darin, b=196286
This commit is contained in:
parent
d2fa1050d2
commit
a1da7b8665
@ -2239,17 +2239,16 @@ nsFtpState::Init(nsIFTPChannel* aChannel,
|
||||
// pull any username and/or password out of the uri
|
||||
nsCAutoString uname;
|
||||
rv = mURL->GetUsername(uname);
|
||||
if (NS_FAILED(rv)) {
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
} else {
|
||||
if (!uname.IsEmpty()) {
|
||||
mAnonymous = PR_FALSE;
|
||||
mUsername = NS_ConvertUTF8toUCS2(NS_UnescapeURL(uname));
|
||||
|
||||
// return an error if we find a CR or LF in the username
|
||||
if (uname.FindCharInSet(CRLF) >= 0)
|
||||
return NS_ERROR_MALFORMED_URI;
|
||||
}
|
||||
if (!uname.IsEmpty() && !uname.Equals(NS_LITERAL_CSTRING("anonymous"))) {
|
||||
mAnonymous = PR_FALSE;
|
||||
mUsername = NS_ConvertUTF8toUCS2(NS_UnescapeURL(uname));
|
||||
|
||||
// return an error if we find a CR or LF in the username
|
||||
if (uname.FindCharInSet(CRLF) >= 0)
|
||||
return NS_ERROR_MALFORMED_URI;
|
||||
}
|
||||
|
||||
nsCAutoString password;
|
||||
|
Loading…
Reference in New Issue
Block a user