This is an automated email from the ASF dual-hosted git repository.
markt-asf 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 70199363b0 Correctly handle a TRACE request for a resource that does
not exist
70199363b0 is described below
commit 70199363b006cfe50bf7193aa2042fe0a131750d
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Nov 4 11:25:42 2026 +0000
Correctly handle a TRACE request for a resource that does not exist
---
java/org/apache/catalina/connector/CoyoteAdapter.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index 50a36e3c11..33a39948b5 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -837,10 +837,13 @@ public class CoyoteAdapter implements Adapter {
}
}
}
- if (header != null) {
+ if (header == null) {
+ // No header, means no wrapper which means no matching
resource so need to return 404.
+ response.sendError(404);
+ } else {
res.addHeader("Allow", header.toString());
+ response.sendError(405, sm.getString("coyoteAdapter.trace"));
}
- response.sendError(405, sm.getString("coyoteAdapter.trace"));
// Safe to skip the remainder of this method.
return true;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]