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 486432ecb6 Review "Restore the raw HTTP method token for methods
unknown to Tomcat"
486432ecb6 is described below
commit 486432ecb679439b6fa455de0b01b5bfd8cf5fbe
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 eb0fb3e7a9..37400d1516 100644
--- a/java/org/apache/coyote/http11/Http11InputBuffer.java
+++ b/java/org/apache/coyote/http11/Http11InputBuffer.java
@@ -401,6 +401,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]