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 1e9b8fcef3 Remove unnecessary code 1e9b8fcef3 is described below commit 1e9b8fcef372bc50c9f2438f00187fbfca6aad74 Author: Mark Thomas <ma...@apache.org> 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 fd1e011bea..4b06ff9b71 100644 --- a/java/org/apache/coyote/http2/StreamProcessor.java +++ b/java/org/apache/coyote/http2/StreamProcessor.java @@ -506,17 +506,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: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org