mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 1594540 - Fix the off-by-one error that breaks login on Pinterest.com; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D53770 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
0725ad16ee
commit
eaec09c277
@ -10259,9 +10259,9 @@ bool nsContentUtils::IsURIInList(nsIURI* aURI, const nsCString& aBlackList) {
|
||||
if (StringBeginsWith(filePath, pathInBlackList) &&
|
||||
(filePath.Length() == pathInBlackList.Length() ||
|
||||
pathInBlackList.EqualsLiteral("/") ||
|
||||
filePath[pathInBlackList.Length()] == '/' ||
|
||||
filePath[pathInBlackList.Length()] == '?' ||
|
||||
filePath[pathInBlackList.Length()] == '#')) {
|
||||
filePath[pathInBlackList.Length() - 1] == '/' ||
|
||||
filePath[pathInBlackList.Length() - 1] == '?' ||
|
||||
filePath[pathInBlackList.Length() - 1] == '#')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -43,8 +43,12 @@ TEST(DOM_Base_ContentUtils, IsURIInList)
|
||||
{NS_LITERAL_CSTRING("example.com/pa,*.example.com/pa"), false, false},
|
||||
{NS_LITERAL_CSTRING("*.example.com/pa/,example.com/pa/"), false, false},
|
||||
{NS_LITERAL_CSTRING("example.com/pa/,*.example.com/pa/"), false, false},
|
||||
{NS_LITERAL_CSTRING("*.example.com/path,example.com/path"), true, false},
|
||||
{NS_LITERAL_CSTRING("example.com/path,*.example.com/path"), true, false},
|
||||
{NS_LITERAL_CSTRING("*.example.com/path,example.com/path"), false, false},
|
||||
{NS_LITERAL_CSTRING("example.com/path,*.example.com/path"), false, false},
|
||||
{NS_LITERAL_CSTRING("*.example.com/path/,example.com/path/"), true,
|
||||
false},
|
||||
{NS_LITERAL_CSTRING("example.com/path/,*.example.com/path/"), true,
|
||||
false},
|
||||
{NS_LITERAL_CSTRING("*.example.com/favicon.ico"), false, true},
|
||||
{NS_LITERAL_CSTRING("example.com/path/favicon.ico"), true, false},
|
||||
{NS_LITERAL_CSTRING("*.example.com"), false, true},
|
||||
|
Loading…
Reference in New Issue
Block a user