arturobernalg commented on code in PR #637:
URL: 
https://github.com/apache/httpcomponents-core/pull/637#discussion_r2845749799


##########
httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerH2StreamHandler.java:
##########
@@ -265,7 +265,16 @@ public void consumeHeader(final List<Header> headers, 
final boolean endStream) t
                 }
                 break;
             case BODY:
-                responseState.set(MessageState.COMPLETE);
+                if (!endStream) {
+                    throw new H2StreamResetException(H2Error.PROTOCOL_ERROR, 
"Trailer headers must set END_STREAM");
+                }
+                try {
+                    TrailersValidationSupport.verify(headers);
+                } catch (final H2ConnectionException ex) {
+                    throw new H2StreamResetException(H2Error.PROTOCOL_ERROR, 
ex.getMessage());

Review Comment:
   @ok2c . Good one. Thank you.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to