rootvector2 commented on code in PR #751:
URL:
https://github.com/apache/httpcomponents-core/pull/751#discussion_r4645860119
##########
httpcore5/src/main/java/org/apache/hc/core5/http/impl/DefaultConnectionReuseStrategy.java:
##########
@@ -85,6 +85,12 @@ public boolean keepAlive(
if (request.containsHeader(HttpHeaders.CONTENT_LENGTH) &&
request.containsHeader(HttpHeaders.TRANSFER_ENCODING)) {
Review Comment:
Done. Both lookups are now hoisted into `contentLenPresent` and
`transferEncodingPresent` and the two checks reuse them.
##########
httpcore5/src/main/java/org/apache/hc/core5/http/impl/DefaultConnectionReuseStrategy.java:
##########
@@ -85,6 +85,12 @@ public boolean keepAlive(
if (request.containsHeader(HttpHeaders.CONTENT_LENGTH) &&
request.containsHeader(HttpHeaders.TRANSFER_ENCODING)) {
return false;
}
+ // Consider framing of a HTTP/1.0 request message with
Transfer-Encoding header faulty
+ final ProtocolVersion requestVersion = request.getVersion();
+ if (requestVersion != null &&
requestVersion.lessEquals(HttpVersion.HTTP_1_0)
+ && request.containsHeader(HttpHeaders.TRANSFER_ENCODING)) {
Review Comment:
Fixed, the HTTP/1.0 check now reuses `transferEncodingPresent` instead of
calling `containsHeader` again.
--
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]