Files
caddy/modules
a bded5b05e9 templates: avoid zero content length for bodyless responses (#8153)
* templates: avoid zero content length for bodyless responses

Drop Content-Length for HEAD and statuses that cannot carry a body instead of using the empty template buffer length. Continue setting the rendered length for ordinary responses.

AI-assisted-by: Jcode (OpenAI)

* templates: test Content-Length for HEAD, 204 and 304 responses

* templates: omit Content-Length for 2xx responses to CONNECT

RFC 9110 section 8.6 forbids Content-Length in any 2xx response to
CONNECT. Non-2xx CONNECT responses still report the rendered length.

(cherry picked from commit 401582cccf)
2026-11-03 00:53:18 -05:00
..