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 12754c9ba5 Fix back port (cast required)
12754c9ba5 is described below

commit 12754c9ba514d830df6cd26a3e0438a15a853a81
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Apr 23 11:23:43 2026 +0100

    Fix back port (cast required)
---
 java/org/apache/coyote/http2/Stream.java | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index 52d216b4b3..9f02b0896b 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -399,11 +399,15 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
                 if (coyoteRequest.scheme().isNull()) {
                     coyoteRequest.scheme().setString(value);
                     // Check scheme is consistent with TLS usage
-                    if ("https".equals(value) != 
handler.getProtocol().getHttp11Protocol().isSSLEnabled()) {
-                        headerException = new StreamException(
-                                
sm.getString("stream.header.inconsistentScheme", getConnectionId(), 
getIdAsString(),
-                                value, 
Boolean.toString(handler.getProtocol().getHttp11Protocol().isSSLEnabled())),
-                                Http2Error.PROTOCOL_ERROR, getIdAsInt());
+                    if ("https".equals(value) != ((AbstractHttp11Protocol<?>) 
handler.getProtocol().getHttp11Protocol())
+                            .isSSLEnabled()) {
+                        headerException =
+                                new StreamException(
+                                        
sm.getString("stream.header.inconsistentScheme", getConnectionId(),
+                                                getIdAsString(), value,
+                                                
Boolean.toString(((AbstractHttp11Protocol<?>) handler.getProtocol()
+                                                        
.getHttp11Protocol()).isSSLEnabled())),
+                                        Http2Error.PROTOCOL_ERROR, 
getIdAsInt());
                     }
                 } else {
                     headerException = new StreamException(


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to