Bug 1590922 follow-up: the parts that didn't land in the first landing

Differential Revision: https://phabricator.services.mozilla.com/D50889

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ehsan Akhgari 2019-10-29 01:12:28 +00:00
parent 8c1d9bf15d
commit 214c8d96df
2 changed files with 4 additions and 2 deletions

View File

@ -10214,7 +10214,8 @@ bool nsContentUtils::IsURIInList(nsIURI* aURI, const nsCString& aBlackList) {
(filePath.Length() == pathInBlackList.Length() ||
pathInBlackList.EqualsLiteral("/") ||
filePath[pathInBlackList.Length()] == '/' ||
filePath[pathInBlackList.Length()] == '?')) {
filePath[pathInBlackList.Length()] == '?' ||
filePath[pathInBlackList.Length()] == '#')) {
return true;
}
}

View File

@ -21,7 +21,7 @@ TEST(DOM_Base_ContentUtils, IsURIInList)
nsCOMPtr<nsIURI> uri, subURI;
nsresult rv =
NS_NewURI(getter_AddRefs(uri),
NS_LITERAL_CSTRING("https://example.com/path/favicon.ico"));
NS_LITERAL_CSTRING("https://example.com/path/favicon.ico#"));
ASSERT_TRUE(rv == NS_OK);
rv = NS_NewURI(getter_AddRefs(subURI),
@ -46,6 +46,7 @@ TEST(DOM_Base_ContentUtils, IsURIInList)
{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},
{NS_LITERAL_CSTRING("example.com"), true, false},
{NS_LITERAL_CSTRING("foo.com"), false, false},