This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
     new c7500c2a26 Fix messages and reformat
c7500c2a26 is described below

commit c7500c2a26829adc28c959f0c0d4fa20e1663150
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Apr 2 14:11:52 2026 +0100

    Fix messages and reformat
---
 java/org/apache/coyote/http2/Stream.java | 14 +++++++-------
 webapps/docs/changelog.xml               |  4 ++++
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/coyote/http2/Stream.java 
b/java/org/apache/coyote/http2/Stream.java
index 6be2c6306a..85cbbaf32d 100644
--- a/java/org/apache/coyote/http2/Stream.java
+++ b/java/org/apache/coyote/http2/Stream.java
@@ -324,7 +324,7 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
         // Header names must be lowercase
         if (!name.toLowerCase(Locale.US).equals(name)) {
             headerException =
-                    new StreamException(sm.getString("stream.headercase", 
getConnectionId(), getIdAsString(), name),
+                    new StreamException(sm.getString("stream.header.case", 
getConnectionId(), getIdAsString(), name),
                             Http2Error.PROTOCOL_ERROR, getIdAsInt());
             // No need for further processing. The stream will be reset.
             return;
@@ -341,7 +341,7 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
         if ("te".equals(name)) {
             if (!"trailers".equals(value)) {
                 headerException =
-                        new StreamException(sm.getString("stream.header.te", 
getConnectionId(), getIdAsString(), name),
+                        new StreamException(sm.getString("stream.header.te", 
getConnectionId(), getIdAsString(), value),
                                 Http2Error.PROTOCOL_ERROR, getIdAsInt());
                 // No need for further processing. The stream will be reset.
                 return;
@@ -356,7 +356,7 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
 
         if (name.isEmpty()) {
             headerException =
-                    new StreamException(sm.getString("stream.header.empty", 
getConnectionId(), getIdAsString(), name),
+                    new StreamException(sm.getString("stream.header.empty", 
getConnectionId(), getIdAsString()),
                             Http2Error.PROTOCOL_ERROR, getIdAsInt());
             // No need for further processing. The stream will be reset.
             return;
@@ -541,9 +541,8 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
         // Match host name with SNI if required
         if 
(!handler.getProtocol().getHttp11Protocol().checkSni(handler.getSniHostName(),
                 coyoteRequest.serverName().getString())) {
-            headerException = new StreamException(
-                    sm.getString("stream.host.sni", getConnectionId(), 
getIdAsString(), value),
-                    Http2Error.PROTOCOL_ERROR, getIdAsInt());
+            headerException = new 
StreamException(sm.getString("stream.host.sni", getConnectionId(), 
getIdAsString(),
+                    value, handler.getSniHostName()), 
Http2Error.PROTOCOL_ERROR, getIdAsInt());
         }
     }
 
@@ -559,7 +558,8 @@ class Stream extends AbstractNonZeroStream implements 
HeaderEmitter {
                 // Host value inconsistent
                 headerException = new StreamException(
                         sm.getString("stream.host.inconsistent", 
getConnectionId(), getIdAsString(), value,
-                                coyoteRequest.serverName().getString(), 
Integer.toString(coyoteRequest.getServerPort())),
+                                coyoteRequest.serverName().getString(),
+                                
Integer.toString(coyoteRequest.getServerPort())),
                         Http2Error.PROTOCOL_ERROR, getIdAsInt());
             }
         } catch (IllegalArgumentException iae) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index aebad94f7f..f1364e491f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -131,6 +131,10 @@
         Refactor the calculation of the real index in the HPACK dynamic header
         table implementation to reduce code duplication. (markt)
       </scode>
+      <fix>
+        Fix various minor issues with some HTTP/2 stream error messages for
+        HTTP/2. (markt)  
+      </fix>
     </changelog>
   </subsection>
 </section>


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

Reply via email to