Issue #2542 - Part 1b: Fix dom.securecontext.whitelist code issues

Some minor bugfixes (wrong condition and string type)
This commit is contained in:
Moonchild 2024-07-02 22:07:39 +02:00 committed by roytam1
commit 1f4b858be2

View file

@ -393,10 +393,10 @@ bool nsMixedContentBlocker::IsPotentiallyTrustworthyOrigin(nsIURI* aURI) {
}
nsAdoptingCString whitelist = Preferences::GetCString("dom.securecontext.whitelist");
if (NS_SUCCEEDED(rv)) {
if (whitelist) {
nsCCharSeparatedTokenizer tokenizer(whitelist, ',');
while (tokenizer.hasMoreTokens()) {
const nsACString& allowedHost = tokenizer.nextToken();
const nsCSubstring& allowedHost = tokenizer.nextToken();
if (host.Equals(allowedHost)) {
return true;
}