Download raw body.
relayd: Keep Content-Length in response to HEAD request
On 2024/06/29 19:16, Christopher Zimmermann wrote: > Hi, > > responses to HEAD requests SHOULD return the same headers a GET request > would yield (https://www.rfc-editor.org/rfc/rfc9110.html#section-9.3.2). > > Therefore the Content-Length header should not be stripped from responses to > HEAD requests. > > This bit me when relaying traffic between restic and a restic-rest-server. > Restic gets confused by the missing Content-Length: header and complains > about a "negative content length" when checking for the presence of /config. There's also this, though: "However, a server MAY omit header fields for which a value is determined only while generating the content" and specifically goes on to talk about HEAD. While I'm not sure what is the most appropriate thing for relayd to do here, it seems to me that restic should not rely on getting Content-Length in response to HEAD requests either.
relayd: Keep Content-Length in response to HEAD request