From 946aab854c3b528767078c38dcea8e3a86659078 Mon Sep 17 00:00:00 2001 From: lprimak Date: Fri, 22 Sep 2023 19:23:33 -0500 Subject: [PATCH] bugfix(ITs): standalone deployment of Jakarta EE test app actually works now --- integration-tests/jakarta-ee/pom.xml | 1 - .../jakarta-ee/src/main/webapp/WEB-INF/faces-config.xml | 1 + .../jakarta-ee/src/main/webapp/WEB-INF/web.xml | 4 ++++ .../org/apache/shiro/ee/filters/FormResubmitSupport.java | 9 ++++----- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/integration-tests/jakarta-ee/pom.xml b/integration-tests/jakarta-ee/pom.xml index 620f368514..eec2a70bb2 100644 --- a/integration-tests/jakarta-ee/pom.xml +++ b/integration-tests/jakarta-ee/pom.xml @@ -153,7 +153,6 @@ com.flowlogix flowlogix-jee 5.5.2 - test diff --git a/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/faces-config.xml b/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/faces-config.xml index 95cd0a3d51..e66c141a19 100644 --- a/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/faces-config.xml +++ b/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/faces-config.xml @@ -30,5 +30,6 @@ org.omnifaces.resourcehandler.VersionedResourceHandler + org.omnifaces.resourcehandler.UnmappedResourceHandler diff --git a/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/web.xml b/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/web.xml index f2d6b867d2..0e1c1ab45c 100644 --- a/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/web.xml +++ b/integration-tests/jakarta-ee/src/main/webapp/WEB-INF/web.xml @@ -58,6 +58,10 @@ org.omnifaces.FACES_VIEWS_SCAN_PATHS /*.xhtml + + com.flowlogix.add-unmapped-resources + true + org.apache.shiro.ee.disabled false diff --git a/support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/FormResubmitSupport.java b/support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/FormResubmitSupport.java index cd44ced4ce..8ef3c8e39a 100644 --- a/support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/FormResubmitSupport.java +++ b/support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/FormResubmitSupport.java @@ -38,7 +38,6 @@ import java.net.CookieManager; import java.net.HttpCookie; import java.net.URI; -import java.net.URISyntaxException; import java.net.URLDecoder; import java.net.http.HttpClient; import java.net.http.HttpHeaders; @@ -240,7 +239,7 @@ static String getReferer(HttpServletRequest request) { * @param fallbackPath * @param resubmit if true, attempt to resubmit the form that was unsubmitted prior to logout */ - @SneakyThrows({IOException.class, URISyntaxException.class, InterruptedException.class}) + @SneakyThrows({IOException.class, InterruptedException.class}) static void redirectToSaved(HttpServletRequest request, HttpServletResponse response, FallbackPredicate useFallbackPath, String fallbackPath, boolean resubmit) { String savedRequest = Servlets.getRequestCookie(request, WebUtils.SAVED_REQUEST_KEY); @@ -268,7 +267,7 @@ static void redirectToSaved(HttpServletRequest request, HttpServletResponse resp private static void doRedirectToSaved(HttpServletRequest request, HttpServletResponse response, - @NonNull String savedRequest, boolean resubmit) throws IOException, URISyntaxException, InterruptedException { + @NonNull String savedRequest, boolean resubmit) throws IOException, InterruptedException { deleteCookie(response, request.getServletContext(), WebUtils.SAVED_REQUEST_KEY); String savedFormDataKey = Servlets.getRequestCookie(request, SHIRO_FORM_DATA_KEY); boolean doRedirectAtEnd = true; @@ -358,7 +357,7 @@ static boolean isLoginUrl(HttpServletRequest request) { static String resubmitSavedForm(@NonNull String savedFormData, @NonNull String savedRequest, HttpServletRequest originalRequest, HttpServletResponse originalResponse, ServletContext servletContext, boolean rememberedAjaxResubmit) - throws InterruptedException, URISyntaxException, IOException { + throws InterruptedException, IOException { if (log.isDebugEnabled()) { log.debug("saved form data: {}", savedFormData); log.debug("Set Cookie Headers: {}", originalResponse.getHeaders(SET_COOKIE)); @@ -477,7 +476,7 @@ private static String resubmitResponseCleanup(HttpServletRequest originalRequest } private static HttpClient buildHttpClient(URI savedRequest, ServletContext servletContext, - HttpServletRequest originalRequest) throws URISyntaxException { + HttpServletRequest originalRequest) { CookieManager cookieManager = new CookieManager(); var session = SecurityUtils.getSubject().getSession(); var sessionCookieName = getSessionCookieName(servletContext, SecurityUtils.getSecurityManager());