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


##########
httpcore5-h2/src/main/java/org/apache/hc/core5/http2/protocol/H2RequestConformance.java:
##########
@@ -75,20 +76,37 @@ public H2RequestConformance() {
     public void process(final HttpRequest request, final EntityDetails entity, 
final HttpContext localContext)
             throws HttpException, IOException {
         Args.notNull(request, "HTTP request");
+
+        boolean validateTe = false;
         for (int i = 0; i < illegalHeaderNames.length; i++) {
             final String headerName = illegalHeaderNames[i];
-            final Header header = request.getFirstHeader(headerName);
-            if (header != null) {
-                if (headerName.equalsIgnoreCase(HttpHeaders.TE)) {
-                    final String value = header.getValue();
-                    if (!"trailers".equalsIgnoreCase(value)) {
-                        throw new ProtocolException("Header '%s: %s' is 
illegal for HTTP/2 messages", HttpHeaders.TE, value);
-                    }
-                } else {
-                    throw new ProtocolException("Header '%s' is illegal for 
HTTP/2 messages", headerName);
-                }
+            if (HttpHeaders.TE.equalsIgnoreCase(headerName)) {
+                validateTe = true;
+                continue;
+            }
+            if (request.getFirstHeader(headerName) != null) {

Review Comment:
   Done



-- 
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