bneradt commented on code in PR #9366:
URL: https://github.com/apache/trafficserver/pull/9366#discussion_r1147951609


##########
proxy/http2/unit_tests/test_HTTP2.cc:
##########
@@ -107,8 +107,8 @@ TEST_CASE("Convert HTTPHdr", "[HTTP2]")
 
     // check
     CHECK_THAT(buf, Catch::StartsWith("GET 
https://trafficserver.apache.org/index.html HTTP/1.1\r\n"
-                                      "Host: trafficserver.apache.org\r\n"
                                       "User-Agent: foobar\r\n"
+                                      "Host: trafficserver.apache.org\r\n"

Review Comment:
   This is a creative idea.
   
   This actually turned out to be more challenging than I expected, though. 
Setting a field's name requires that the field be in the "detached" rather than 
the "live" state. At this point in the conversion, we are modifying the HTTPHdr 
and the fields are all live. I was able to avoid an append by first detaching 
the field, modifying the value, then re-attaching (which preserved the original 
order). I'm not sure what the performance implications of the detach operation 
are, however. It does look like the results are now functionally correct, 
however. The `:authority` header, with this latest patch, is now transformed 
into a `Host:` header and that `Host:` header is at the start of the header 
block after the request list.
   
   Let me know whether you have any concerns with this.



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

Reply via email to