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 5f642809f8 Review "Restore the raw HTTP method token for methods
unknown to Tomcat"
5f642809f8 is described below
commit 5f642809f8d76f6432bcfbfda4a8eb012c3de109
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 fc4e27c7f6..e28182027e 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]