Bug 1476570 - allow proxy to work on restricted domains, r=aswan
Proxies must work with all requests, however the new onRequest proxy api has maching logic using ChannelWrapper which uses WebExtensionPolicy which checks against restricted domains. We need to bypass that check when matching for proxy requests. MozReview-Commit-ID: 5zCdmV1b9M7
This commit is contained in:
@@ -521,13 +521,14 @@ ChannelWrapper::Matches(const dom::MozRequestFilter& aFilter,
|
||||
}
|
||||
|
||||
if (aExtension) {
|
||||
if (!aExtension->CanAccessURI(urlInfo)) {
|
||||
bool isProxy = aOptions.mIsProxy && aExtension->HasPermission(nsGkAtoms::proxy);
|
||||
// Proxies are allowed access to all urls, including restricted urls.
|
||||
if (!aExtension->CanAccessURI(urlInfo, false, !isProxy)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If this isn't the proxy phase of the request, check that the extension
|
||||
// has origin permissions for origin that originated the request.
|
||||
bool isProxy = aOptions.mIsProxy && aExtension->HasPermission(nsGkAtoms::proxy);
|
||||
if (!isProxy) {
|
||||
if (IsSystemLoad()) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user