caddy/modules
Francis Lavoie 3f6283b385
fileserver: Add status code override (#4076)
After reading a question about the `handle_response` feature of `reverse_proxy`, I realized that we didn't have a way of serving an arbitrary file with a status code other than 200. This is an issue in situations where you want to serve a custom error page in routes that are not errors, like the aforementioned `handle_response`, where you may want to retain the status code returned by the proxy but write a response with content from a file.

This feature is super simple, basically if a status code is configured (can be a status code number, or a placeholder string) then that status will be written out before serving the file - if we write the status code first, then the stdlib won't write its own (only the first HTTP status header wins).
2021-04-08 11:09:12 -06:00
..
caddyhttp fileserver: Add status code override (#4076) 2021-04-08 11:09:12 -06:00
caddypki Minor tweaks 2021-04-01 12:49:51 -06:00
caddytls Minor tweaks 2021-04-01 12:49:51 -06:00
filestorage httpcaddyfile: Minor fixes to parsing storage options 2020-05-01 09:34:32 -06:00
logging logging: add replace filter for static value replacement (#4029) 2021-03-12 13:01:34 -07:00
metrics metrics: allow disabling OpenMetrics negotiation (#3944) 2020-12-30 11:44:02 -07:00
standard metrics: Initial integration of Prometheus metrics (#3709) 2020-09-17 12:01:20 -06:00