Bug 1519302 - Add pref to restrict BinAST feature to specific hosts. r=baku
To reduce the attack surface in early test for BinAST, add a preference to restrict the hosts that Firefox accepts BinAST file from. The preference is turned on by default (BinAST itself is turned off by default for now), and the list contains hosts which is going to be used in early test. For hosts not listed in the list, Firefox doesn't send BinAST MIME-Type in Accept field, and doesn't handle BinAST file in case the server returns BinAST file. Differential Revision: https://phabricator.services.mozilla.com/D16517
This commit is contained in:
@@ -312,7 +312,12 @@ nsresult ScriptLoadHandler::EnsureKnownDataType(
|
||||
TRACE_FOR_TEST(mRequest->Element(), "scriptloader_load_source");
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// If the request isn't allowed to accept BinAST, fallback to text
|
||||
// source. The possibly binary source will be passed to normal
|
||||
// JS parser and will throw error there.
|
||||
mRequest->SetTextSource();
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user