This is an automated email from the ASF dual-hosted git repository.
markt 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 1ccdf4e773 HTTP methods are case sensitive - use consistent code for
testing method
1ccdf4e773 is described below
commit 1ccdf4e773f5ba1bdb10dac4134f1baed1c1f466
Author: Mark Thomas <[email protected]>
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 087cb0cfe3..7cd5b1246a 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -593,7 +593,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
@@ -612,7 +612,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
@@ -808,7 +808,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 74c6216387..bc12e98b70 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -533,7 +533,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: [email protected]
For additional commands, e-mail: [email protected]