mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-19 15:51:33 +00:00
Bug 1273311 - Prevent DevToolsUtils.fetch from throwing when no policy is given. r=ejpbruel
This commit is contained in:
parent
da651f3cb1
commit
c07cb6835c
@ -536,11 +536,14 @@ function newChannelForURL(url, { policy, window, principal }) {
|
||||
|
||||
let channelOptions = {
|
||||
contentPolicyType: policy,
|
||||
loadUsingSystemPrincipal: true,
|
||||
securityFlags: securityFlags,
|
||||
uri: url
|
||||
};
|
||||
if (principal) {
|
||||
// contentPolicyType is required when loading with a custom principal
|
||||
if (!channelOptions.contentPolicyType) {
|
||||
channelOptions.contentPolicyType = Ci.nsIContentPolicy.TYPE_OTHER;
|
||||
}
|
||||
channelOptions.loadingPrincipal = principal;
|
||||
} else {
|
||||
channelOptions.loadUsingSystemPrincipal = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user