This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push: new d45068fcaa HTTP methods are case sensitive - use consistent code for testing method d45068fcaa is described below commit d45068fcaa441c67cd0be94c39cd8bff7c5e6ff2 Author: Mark Thomas <ma...@apache.org> AuthorDate: Mon Nov 6 16:10:24 2023 +0000 HTTP methods are case sensitive - use consistent code for testing method --- java/org/apache/catalina/connector/CoyoteAdapter.java | 6 +++--- java/org/apache/coyote/http2/Stream.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java b/java/org/apache/catalina/connector/CoyoteAdapter.java index e1e077a2b4..fec6822add 100644 --- a/java/org/apache/catalina/connector/CoyoteAdapter.java +++ b/java/org/apache/catalina/connector/CoyoteAdapter.java @@ -592,7 +592,7 @@ public class CoyoteAdapter implements Adapter { // Check for ping OPTIONS * request if (undecodedURI.equals("*")) { - if (req.method().equalsIgnoreCase("OPTIONS")) { + if (req.method().equals("OPTIONS")) { StringBuilder allow = new StringBuilder(); allow.append("GET, HEAD, POST, PUT, DELETE, OPTIONS"); // Trace if allowed @@ -611,7 +611,7 @@ public class CoyoteAdapter implements Adapter { MessageBytes decodedURI = req.decodedURI(); // Filter CONNECT method - if (req.method().equalsIgnoreCase("CONNECT")) { + if (req.method().equals("CONNECT")) { response.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED, sm.getString("coyoteAdapter.connect")); } else { // No URI for CONNECT requests @@ -804,7 +804,7 @@ public class CoyoteAdapter implements Adapter { } // Filter TRACE method - if (!connector.getAllowTrace() && req.method().equalsIgnoreCase("TRACE")) { + if (!connector.getAllowTrace() && req.method().equals("TRACE")) { Wrapper wrapper = request.getWrapper(); String header = null; if (wrapper != null) { diff --git a/java/org/apache/coyote/http2/Stream.java b/java/org/apache/coyote/http2/Stream.java index 091f468a67..cfbbf98929 100644 --- a/java/org/apache/coyote/http2/Stream.java +++ b/java/org/apache/coyote/http2/Stream.java @@ -524,7 +524,7 @@ class Stream extends AbstractNonZeroStream implements HeaderEmitter { final boolean receivedEndOfHeaders() throws ConnectionException { if (coyoteRequest.method().isNull() || coyoteRequest.scheme().isNull() || - !coyoteRequest.method().equalsIgnoreCase("CONNECT") && coyoteRequest.requestURI().isNull()) { + !coyoteRequest.method().equals("CONNECT") && coyoteRequest.requestURI().isNull()) { throw new ConnectionException(sm.getString("stream.header.required", getConnectionId(), getIdAsString()), Http2Error.PROTOCOL_ERROR); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org