[
https://issues.apache.org/jira/browse/HTTPCLIENT-1249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13475402#comment-13475402
]
Oleg Kalnichevski commented on HTTPCLIENT-1249:
-----------------------------------------------
Jon
Based on my interpretation of the HTTP spec (RFC 2616) the servers are expected
to generate a response to a HEAD request the same way if it was a GET except
for not including the content body. However, either Content-Length or
Transfer-Encoding headers must still be present to indicate the the resource is
expected to produce a content body. Status 404 has not special requirements
with regards to content bodies, so if both Content-Length or Transfer-Encoding
headers are absent the client has to assume the end of the message will be
indicated by closing connection (see section 4.4 Message Length). All this
makes believe the current behaviour of DefaultConnectionReuseStrategy is
actually correct. Please let me know if you agree.
Oleg
---
9.4 HEAD
The HEAD method is identical to GET except that the server MUST NOT
return a message-body in the response. The metainformation contained
in the HTTP headers in response to a HEAD request SHOULD be identical
to the information sent in response to a GET request. This method can
be used for obtaining metainformation about the entity implied by the
request without transferring the entity-body itself. This method is
often used for testing hypertext links for validity, accessibility,
and recent modification.
---
> DefaultConnectionReuseStrategy -- need to honor keep alives when receiving a
> 404 on a HEAD request
> --------------------------------------------------------------------------------------------------
>
> Key: HTTPCLIENT-1249
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1249
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 4.2.1
> Reporter: Jon Christiansen
>
> Code will not allow connection reuse if Content-Length header is not present.
> If the request was a HEAD request and the response is a 404, this header is
> not present, but HttpClient should still be able to re-use the connection.
> It should be very easy to add special case code when dealing with responses
> to HEAD requests.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]