rootvector2 commented on code in PR #1543:
URL: 
https://github.com/apache/httpcomponents-core/pull/1543#discussion_r4731731470


##########
httpcore5/src/main/java/org/apache/hc/core5/http/protocol/ForwardedRequest.java:
##########
@@ -166,7 +168,8 @@ public void process(final HttpRequest request, final 
EntityDetails entity, final
         if (valueBuilder.length() > 0 && !forwardedHeaderExists) {
             valueBuilder.append(";");
         }
-        
valueBuilder.append("host=\"").append(authority.getHostName()).append("\"");
+        valueBuilder.append("host=");

Review Comment:
   Done. All three now go through 
`BasicHeaderValueFormatter.INSTANCE.formatNameValuePair`, with `valueBuilder` 
switched to `CharArrayBuffer`.
   
   `host` passes `quote=true` so it stays unconditionally quoted as before. 
`by` and `for` pass `quote=false`, but the formatter quotes them anyway because 
of the `:` before the port, so the `Inet6Address` branch became dead and I 
dropped it. Side effect: IPv4 `by`/`for` go from `by=1.2.3.4:5` to 
`by="1.2.3.4:5"`, which is the correct form since `:` is not a `tchar`. Updated 
the two tests that asserted the unquoted value; full `verify` is green.



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