This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 053395489e Correctly handle a TRACE request for a resource that does
not exist
053395489e is described below
commit 053395489e1dd6f0ca056c84db2b8f87f3a97534
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 2775e3cdfb..589eddcef5 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]