Index | Thread | Search

From:
Todd C. Miller <millert@openbsd.org>
Subject:
Re: relayd: Keep Content-Length in response to HEAD request
To:
Christopher Zimmermann <chrisz@openbsd.org>
Cc:
tech@openbsd.org
Date:
Thu, 18 Jul 2024 17:12:18 -0600

Download raw body.

Thread
On Thu, 18 Jul 2024 20:36:41 +0200, Christopher Zimmermann wrote:

> Is there any good reason to drop the Content-length header from HEAD
> responses?
> According to the commit message and comment it was removed because it
> would kind of lie about the content length:
>
> Commit message:
> > relay_read_http: strip out Content-Length if we strip the body too
> > We should not forward Content-Length if the body is not also
> > forwarded.
>
> Comment:
> > Strip Content-Length header from HEAD responses since there is no
> > actual payload in the response.
>
> I very much suspect, this was done under the assumption that a
> Content-length header in a HEAD response was wrong.
>
> millert@, is there any good reason to keep this quirk for HEAD
> responses?

I think you are correct and that case can be simply be removed.
OK millert@ for your initial diff in this thread.

 - todd