Bug 1402944: Follow-up: Clean up isProxy matching exemptions a bit. r=trivial

MozReview-Commit-ID: 8fbwNPXsCkI

--HG--
extra : amend_source : 48345b5387501421e7875da8aa34f1b2752042c7
This commit is contained in:
Kris Maglione 2017-10-25 13:54:00 -07:00
Родитель b3e6daca8e
Коммит a5499452e4
1 изменённых файлов: 14 добавлений и 11 удалений

Просмотреть файл

@ -500,8 +500,11 @@ ChannelWrapper::Matches(const dom::MozRequestFilter& aFilter,
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 && IsSystemLoad()) {
if (!isProxy) {
if (IsSystemLoad()) {
return false;
}
@ -509,13 +512,13 @@ ChannelWrapper::Matches(const dom::MozRequestFilter& aFilter,
nsAutoCString baseURL;
aExtension->GetBaseURL(baseURL);
if (!isProxy &&
!StringBeginsWith(origin->CSpec(), baseURL) &&
if (!StringBeginsWith(origin->CSpec(), baseURL) &&
!aExtension->CanAccessURI(*origin)) {
return false;
}
}
}
}
return true;
}