caddy/modules/caddyhttp/templates
Jay Hemnani 4e6ad67427
templates: Delete file headers on any template error (#8149)
* templates: Delete file headers on any template error

A template that fails to parse or execute (not only {{httpError}}) left
the Content-Length, Etag and related headers set by file_server on the
error response, so clients received a 500 that declared the file's size
but had no body.

* templates: Also delete Content-Encoding and Content-Range on errors

Precompressed and ranged file responses could leave these headers on the
replacement error response.

(cherry picked from commit 6727b2f3a9)
2026-11-03 00:53:03 -05:00
..
caddyfile.go caddyfile: Normalize & flatten all unmarshalers (#6037) 2024-01-23 19:36:59 -05:00
frontmatter.go chore: Use slices package where possible (#6585) 2024-09-25 14:30:56 -06:00
frontmatter_fuzz.go core: Windows service integration (#4790) 2022-07-29 14:06:54 -06:00
templates.go templates: Delete file headers on any template error (#8149) 2026-11-03 00:53:03 -05:00
templates_test.go templates: Delete file headers on any template error (#8149) 2026-11-03 00:53:03 -05:00
tplcontext.go templates: Delete file headers on any template error (#8149) 2026-11-03 00:53:03 -05:00
tplcontext_test.go caddyhttp: surface 413 for oversized request body placeholders (#7969) 2026-09-25 22:27:19 +10:00