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 2024/07/22 19:32:10 UTC
(tomcat) branch 10.1.x updated: Align scheme variance test implementation with port variance
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 690788cf81 Align scheme variance test implementation with port variance
690788cf81 is described below
commit 690788cf8190e05cdf201bfec16d9d8de7ccf529
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org