Bug 1654556 - Log also "failed the samesite tests" cookie rejection reason, r=baku

Differential Revision: https://phabricator.services.mozilla.com/D84555
This commit is contained in:
Honza Bambas 2020-07-23 09:45:28 +00:00
Родитель 0eff45df2a
Коммит 71af5acb52
2 изменённых файлов: 9 добавлений и 0 удалений

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

@ -1168,6 +1168,13 @@ bool CookieService::CanSetCookie(
aIsForeignAndNotAddon) {
COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, savedCookieHeader,
"failed the samesite tests");
CookieLogging::LogMessageToConsole(
aCRC, aHostURI, nsIScriptError::warningFlag, CONSOLE_SAMESITE_CATEGORY,
"CookieRejectedForNonSameSiteness"_ns,
AutoTArray<nsString, 1>{
NS_ConvertUTF8toUTF16(aCookieData.name()),
});
return newCookie;
}

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

@ -87,3 +87,5 @@ CookieRejectedThirdParty=Cookie “%1$S” has been rejected as third-party.
CookieRejectedNonsecureOverSecure=Cookie “%1$S” has been rejected because there is an existing “secure” cookie.
# LOCALIZATION NOTE (CookieRejectedExpired): %1$S is the cookie name.
CookieRejectedExpired=Cookie “%1$S” has been rejected because it is already expired.
# LOCALIZATION NOTE (CookieRejectedForNonSameSiteness): %1$S is the cookie name.
CookieRejectedForNonSameSiteness=Cookie “%1$S” has been rejected because it is in a cross-site context and its “SameSite” is “Lax” or “Strict”.