You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/10/12 16:43:19 UTC

[tomcat] branch main updated: Fix logic error. UNSET means "Don't set the attribute" :)

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 45d4cd4  Fix logic error. UNSET means "Don't set the attribute" :)
45d4cd4 is described below

commit 45d4cd4bc1af72207a75a31e1ba08718bf6a2425
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Oct 12 17:43:09 2021 +0100

    Fix logic error. UNSET means "Don't set the attribute" :)
---
 java/org/apache/tomcat/util/http/LegacyCookieProcessor.java  | 2 +-
 java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/http/LegacyCookieProcessor.java b/java/org/apache/tomcat/util/http/LegacyCookieProcessor.java
index 990ad3e..5867d50 100644
--- a/java/org/apache/tomcat/util/http/LegacyCookieProcessor.java
+++ b/java/org/apache/tomcat/util/http/LegacyCookieProcessor.java
@@ -332,7 +332,7 @@ public final class LegacyCookieProcessor extends CookieProcessorBase {
         if (cookieSameSite == null) {
             // Use processor config
             SameSiteCookies sameSiteCookiesValue = getSameSiteCookies();
-            if (sameSiteCookiesValue.equals(SameSiteCookies.UNSET)) {
+            if (!sameSiteCookiesValue.equals(SameSiteCookies.UNSET)) {
                 buf.append("; SameSite=");
                 buf.append(sameSiteCookiesValue.getValue());
             }
diff --git a/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java b/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java
index 5a7bcde..79fe0d9 100644
--- a/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java
+++ b/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java
@@ -171,7 +171,7 @@ public class Rfc6265CookieProcessor extends CookieProcessorBase {
         if (cookieSameSite == null) {
             // Use processor config
             SameSiteCookies sameSiteCookiesValue = getSameSiteCookies();
-            if (sameSiteCookiesValue.equals(SameSiteCookies.UNSET)) {
+            if (!sameSiteCookiesValue.equals(SameSiteCookies.UNSET)) {
                 header.append("; SameSite=");
                 header.append(sameSiteCookiesValue.getValue());
             }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org