You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by lp...@apache.org on 2023/12/20 03:05:22 UTC

(shiro) branch main updated: enh: remove workaround for https://github.com/jetty/jetty.project/issues/8556

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

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


The following commit(s) were added to refs/heads/main by this push:
     new de4dfdeda enh: remove workaround for https://github.com/jetty/jetty.project/issues/8556
     new 6ecb8626c Merge pull request #1241 from lprimak/remove-jetty-workaround
de4dfdeda is described below

commit de4dfdeda09b6d098d6e61b10494bd0dabd10f27
Author: lprimak <le...@flowlogix.com>
AuthorDate: Tue Dec 19 20:36:56 2023 -0600

    enh: remove workaround for https://github.com/jetty/jetty.project/issues/8556
---
 .../java/org/apache/shiro/ee/filters/FormResubmitSupportCookies.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/FormResubmitSupportCookies.java b/support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/FormResubmitSupportCookies.java
index 6a77c6e3f..465ddde94 100644
--- a/support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/FormResubmitSupportCookies.java
+++ b/support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/FormResubmitSupportCookies.java
@@ -70,8 +70,9 @@ public class FormResubmitSupportCookies {
         } else {
             try {
                 return (int) Duration.ofMinutes(request.getServletContext().getSessionTimeout()).toSeconds();
-            } catch (Throwable e) {
-                // workaround for https://github.com/eclipse/jetty.project/issues/8556
+            } catch (NoSuchMethodError noSuchMethodError) {
+                // Older servers (e.g. Jetty 9.x) do not support getSessionTimeout() at all
+                log.debug("ServletContext.getSessionTimeout() not supported", noSuchMethodError);
                 return (int) Duration.ofHours(1).toSeconds();
             }
         }