You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When performing an HEAD requests the content-length is taken as the expected body size. For example Elasticsearch will report a content-length but does not return an actual body. This wil throw a underflow exception ("Unexpected end of response body after...") since version 2.8.0.
According to RFC 2616 it's correct to report the content-length and not returning a body for HEAD requests.
14.13 Content-Length
The Content-Length entity-header field indicates the size of the
entity-body, in decimal number of OCTETs, sent to the recipient or,
in the case of the HEAD method, the size of the entity-body that
would have been sent had the request been a GET.
Activity
clue commentedon May 28, 2020
@cyrnetix Thanks for reporting, I can indeed reproduce this bug and will look into fixing this as soon as time permits 👍
For the reference, here's the current link to the relevant RFC: https://tools.ietf.org/html/rfc7230#section-3.3.3
In the meantime, you should be able to downgrade to v2.7.0 to avoid this problem.