This is an automated email from the ASF dual-hosted git repository.
markt-asf 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 a0490668ea Review "Restore the raw HTTP method token for methods
unknown to Tomcat"
a0490668ea is described below
commit a0490668ea7b68a3c13f960710dc9da3e51e1707
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Oct 30 21:09:34 2026 +0000
Review "Restore the raw HTTP method token for methods unknown to Tomcat"
Additional method validation
---
java/org/apache/coyote/http11/Http11InputBuffer.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/java/org/apache/coyote/http11/Http11InputBuffer.java
b/java/org/apache/coyote/http11/Http11InputBuffer.java
index 8e308f6f4c..05ebe9df94 100644
--- a/java/org/apache/coyote/http11/Http11InputBuffer.java
+++ b/java/org/apache/coyote/http11/Http11InputBuffer.java
@@ -389,6 +389,12 @@ public class Http11InputBuffer implements InputBuffer,
ApplicationBufferHandler,
int pos = byteBuffer.position();
chr = byteBuffer.get();
if (chr == Constants.SP || chr == Constants.HT) {
+ if (pos == parsingRequestLineStart) {
+ // No method
+ // Avoid unknown protocol triggering an additional
error
+ request.protocol().setString(Constants.HTTP_11);
+ throw new
IllegalArgumentException(sm.getString("iib.invalidmethod", ""));
+ }
space = true;
request.setMethod(byteBuffer.array(),
parsingRequestLineStart, pos - parsingRequestLineStart);
} else if (!HttpParser.isToken(chr)) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]