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 9378e86596 Minor simplification
9378e86596 is described below
commit 9378e865969cbf5f0727195763f6a985a4b5dda6
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Feb 14 14:31:03 2025 +0000
Minor simplification
---
java/org/apache/catalina/filters/CorsFilter.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/java/org/apache/catalina/filters/CorsFilter.java
b/java/org/apache/catalina/filters/CorsFilter.java
index 7363aa9f62..77f0a3a6f8 100644
--- a/java/org/apache/catalina/filters/CorsFilter.java
+++ b/java/org/apache/catalina/filters/CorsFilter.java
@@ -558,10 +558,10 @@ public class CorsFilter extends GenericFilter {
if ("OPTIONS".equals(method)) {
String accessControlRequestMethodHeader =
request.getHeader(REQUEST_HEADER_ACCESS_CONTROL_REQUEST_METHOD);
if (accessControlRequestMethodHeader != null) {
- if (!accessControlRequestMethodHeader.isEmpty()) {
- return CORSRequestType.PRE_FLIGHT;
+ if (accessControlRequestMethodHeader.isEmpty()) {
+ return CORSRequestType.INVALID_CORS;
}
- return CORSRequestType.INVALID_CORS;
+ return CORSRequestType.PRE_FLIGHT;
}
return CORSRequestType.ACTUAL;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]