Bug 1454242: Setting samesite cookie should not rely on NS_IsSameSiteForeign. r=valentin

This commit is contained in:
Christoph Kerschbaumer 2018-04-16 07:18:21 +02:00
Родитель 4dba84fc9a
Коммит 5f9d175cdf
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -3471,8 +3471,10 @@ nsCookieService::CanSetCookie(nsIURI* aHostURI,
// If the new cookie is same-site but in a cross site context,
// browser must ignore the cookie.
if (aCookieAttributes.sameSite != nsICookie2::SAMESITE_UNSET) {
bool isThirdParty = NS_IsSameSiteForeign(aChannel, aHostURI);
if (aCookieAttributes.sameSite != nsICookie2::SAMESITE_UNSET &&
aThirdPartyUtil) {
bool isThirdParty = false;
aThirdPartyUtil->IsThirdPartyChannel(aChannel, aHostURI, &isThirdParty);
if (isThirdParty) {
COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, savedCookieHeader,
"failed the samesite tests");