Skip to content

Commit

Permalink
import change from tenfourfox:
Browse files Browse the repository at this point in the history
- closes #567: support SameSite=None on cookies (09a4a8bfc)
  • Loading branch information
roytam1 committed Aug 23, 2019
1 parent 41807f9 commit 5b8c232
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion netwerk/cookie/nsCookieService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3633,6 +3633,7 @@ nsCookieService::ParseAttributes(nsDependentCString &aCookieHeader,
static const char kHttpOnly[] = "httponly";
static const char kSameSite[] = "samesite";
static const char kSameSiteLax[] = "lax";
static const char kSameSiteNone[] = "none";
static const char kSameSiteStrict[] = "strict";

nsASingleFragmentCString::const_char_iterator tempBegin, tempEnd;
Expand Down Expand Up @@ -3693,7 +3694,11 @@ nsCookieService::ParseAttributes(nsDependentCString &aCookieHeader,
aCookieAttributes.isHttpOnly = true;

else if (tokenString.LowerCaseEqualsLiteral(kSameSite)) {
if (tokenValue.LowerCaseEqualsLiteral(kSameSiteLax)) {
if (tokenValue.LowerCaseEqualsLiteral(kSameSiteNone)) {
// Currently redundant, but may be necessary if the default
// changes in the future. TenFourFox issue 567.
aCookieAttributes.sameSite = nsICookie2::SAMESITE_UNSET;
} else if (tokenValue.LowerCaseEqualsLiteral(kSameSiteLax)) {
aCookieAttributes.sameSite = nsICookie2::SAMESITE_LAX;
} else if (tokenValue.LowerCaseEqualsLiteral(kSameSiteStrict)) {
aCookieAttributes.sameSite = nsICookie2::SAMESITE_STRICT;
Expand Down

0 comments on commit 5b8c232

Please sign in to comment.