From 0009bb53af525fb7f51c0ddabec984e800e9d267 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Fri, 28 Aug 2020 00:29:17 +0000 Subject: [PATCH] samesite: fix check for 0, add "false" alternative. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1881263 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/rewrite/flags.xml | 2 +- modules/mappers/mod_rewrite.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/manual/rewrite/flags.xml b/docs/manual/rewrite/flags.xml index 5e3457cfc94..a8fadf0203e 100644 --- a/docs/manual/rewrite/flags.xml +++ b/docs/manual/rewrite/flags.xml @@ -192,7 +192,7 @@ which means that the cookie is inaccessible to JavaScript code on browsers that support this feature.
samesite
-
If set to anything other than 0, the SameSite +
If set to anything other than false or 0, the SameSite attribute is set to the specified value. Typical values are None, Lax, and Strict.Available in 2.5.1 and later.
diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 661bc30f485..5a38ad03e0f 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -2647,7 +2647,7 @@ static void add_cookie(request_rec *r, char *s) "; HttpOnly" : NULL, NULL); - if (samesite && !strcasecmp(samesite, "0")) { + if (samesite && strcmp(samesite, "0") && ap_cstr_casecmp(samesite,"false")) { cookie = apr_pstrcat(rmain->pool, cookie, "; SameSite=", samesite, NULL); } -- 2.47.3