Skip to content

Commit

Permalink
Merge pull request #29919 from mrsaldana/OIDC_Client_FAT2_CookieFix
Browse files Browse the repository at this point in the history
Removing case sensitive check on cookie attributes
  • Loading branch information
mrsaldana authored Oct 23, 2024
2 parents 2bd5b8c + cfa280b commit 5838d68
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2014, 2023 IBM Corporation and others.
* Copyright (c) 2014, 2024 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand All @@ -17,6 +17,7 @@
import java.net.URL;

import java.util.List;
import java.util.Locale;

import org.junit.Assert;
import org.junit.Test;
Expand Down Expand Up @@ -131,8 +132,9 @@ public void OidcClientCheckCookieTimeouts() throws Exception {
}
boolean foundExpiredCookie = false;
if (cookieLine != null) {
foundExpiredCookie = JakartaEEAction.isEE10OrLaterActive() ? cookieLine.contains("max-age=0") :
(cookieLine.contains("Expires=") && cookieLine.contains("16:00"));
String lowerCookieLine = cookieLine.toLowerCase(Locale.ENGLISH);
foundExpiredCookie = JakartaEEAction.isEE10OrLaterActive() ? lowerCookieLine.contains("max-age=0") :
(lowerCookieLine.contains("expires=") && cookieLine.contains("16:00"));
}
Assert.assertTrue("did not find expected expired cookie", foundExpiredCookie);
}
Expand Down

0 comments on commit 5838d68

Please sign in to comment.