This is an automated email from the ASF dual-hosted git repository.
markt 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 2addd8904a Remove unnecessary code
2addd8904a is described below
commit 2addd8904a0034744924e0a0cc3833765bdd1bad
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Jul 5 17:34:03 2023 +0100
Remove unnecessary code
Dead code identified by Coverity Scan
---
java/org/apache/coyote/http2/StreamProcessor.java | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/java/org/apache/coyote/http2/StreamProcessor.java
b/java/org/apache/coyote/http2/StreamProcessor.java
index d08c875cbd..e22afa030d 100644
--- a/java/org/apache/coyote/http2/StreamProcessor.java
+++ b/java/org/apache/coyote/http2/StreamProcessor.java
@@ -505,17 +505,12 @@ class StreamProcessor extends AbstractProcessor {
}
// HTTP header names must be tokens.
+ // Stream#emitHeader() checks that all the pseudo headers appear first.
MimeHeaders headers = request.getMimeHeaders();
- boolean previousHeaderWasPseudoHeader = true;
Enumeration<String> names = headers.names();
while (names.hasMoreElements()) {
String name = names.nextElement();
- if (H2_PSEUDO_HEADERS_REQUEST.contains(name)) {
- if (!previousHeaderWasPseudoHeader) {
- return false;
- }
- } else if (!HttpParser.isToken(name)) {
- previousHeaderWasPseudoHeader = false;
+ if (!H2_PSEUDO_HEADERS_REQUEST.contains(name) &&
!HttpParser.isToken(name)) {
return false;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]