зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
b3e6daca8e
Коммит
a5499452e4
|
@ -500,20 +500,23 @@ 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()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (auto origin = DocumentURLInfo()) {
|
||||
nsAutoCString baseURL;
|
||||
aExtension->GetBaseURL(baseURL);
|
||||
|
||||
if (!isProxy &&
|
||||
!StringBeginsWith(origin->CSpec(), baseURL) &&
|
||||
!aExtension->CanAccessURI(*origin)) {
|
||||
if (!isProxy) {
|
||||
if (IsSystemLoad()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (auto origin = DocumentURLInfo()) {
|
||||
nsAutoCString baseURL;
|
||||
aExtension->GetBaseURL(baseURL);
|
||||
|
||||
if (!StringBeginsWith(origin->CSpec(), baseURL) &&
|
||||
!aExtension->CanAccessURI(*origin)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче