mirror of
https://github.com/caddyserver/caddy.git
synced 2026-11-12 11:53:43 +00:00
* 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)