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 86d538015c Align scheme variance test implementation with port variance 86d538015c is described below commit 86d538015c0533df852826eecc51332fc6364b32 Author: Mark Thomas <ma...@apache.org> AuthorDate: Mon Jul 22 20:31:57 2024 +0100 Align scheme variance test implementation with port variance Without this change, this test will incorrectly fail when BZ 69214 is fixed --- test/org/apache/catalina/filters/TestCorsFilter.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/org/apache/catalina/filters/TestCorsFilter.java b/test/org/apache/catalina/filters/TestCorsFilter.java index c78854da96..e1c6233fbe 100644 --- a/test/org/apache/catalina/filters/TestCorsFilter.java +++ b/test/org/apache/catalina/filters/TestCorsFilter.java @@ -1036,14 +1036,15 @@ public class TestCorsFilter { * @throws ServletException */ @Test - public void testCheckForSchemeVariance() throws ServletException { + public void testCheckForSchemeVariance() throws ServletException, IOException { TesterHttpServletRequest request = new TesterHttpServletRequest(); + TesterHttpServletResponse response = new TesterHttpServletResponse(); request.setHeader(CorsFilter.REQUEST_HEADER_ORIGIN, "https://tomcat.apache.org"); request.setMethod("POST"); CorsFilter corsFilter = new CorsFilter(); corsFilter.init(TesterFilterConfigs.getSpecificOriginFilterConfig()); - CorsFilter.CORSRequestType requestType = corsFilter.checkRequestType(request); - Assert.assertEquals(CorsFilter.CORSRequestType.INVALID_CORS, requestType); + corsFilter.doFilter(request, response, filterChain); + Assert.assertEquals(HttpServletResponse.SC_FORBIDDEN, response.getStatus()); } /* --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org