зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1341689 - don't take Referrer-Policy into account when response tainting is cors, r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D71439
This commit is contained in:
Родитель
ebc905d3f2
Коммит
82c4cc7f68
|
@ -412,11 +412,13 @@ bool ReferrerInfo::ShouldSetNullOriginHeader(net::HttpBaseChannel* aChannel,
|
|||
}
|
||||
}
|
||||
|
||||
// When we're dealing with CORS (mode is "cors"), we shouldn't take the
|
||||
// Referrer-Policy into account
|
||||
// When deal with CORS (mode is "cors") and go through a cross-origin URL,
|
||||
// response tainting is "cors" and we shouldn't take the Referrer-Policy into
|
||||
// account
|
||||
uint32_t corsMode = CORS_NONE;
|
||||
NS_ENSURE_SUCCESS(aChannel->GetCorsMode(&corsMode), false);
|
||||
if (corsMode == CORS_USE_CREDENTIALS) {
|
||||
bool isCrossOriginRequest = ReferrerInfo::IsCrossOriginRequest(aChannel);
|
||||
if (corsMode == CORS_USE_CREDENTIALS && isCrossOriginRequest) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -442,7 +444,7 @@ bool ReferrerInfo::ShouldSetNullOriginHeader(net::HttpBaseChannel* aChannel,
|
|||
}
|
||||
|
||||
if (policy == ReferrerPolicy::Same_origin) {
|
||||
return ReferrerInfo::IsCrossOriginRequest(aChannel);
|
||||
return isCrossOriginRequest;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -4,7 +4,3 @@
|
|||
|
||||
[Origin header and POST navigation]
|
||||
expected: FAIL
|
||||
|
||||
[Origin header and POST same-origin fetch cors mode with Referrer-Policy no-referrer]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче