caddy/caddytest/integration
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
..
caddyfile_adapt fileserver: Add status code override (#4076) 2021-04-08 11:09:12 -06:00
testdata caddyfile: Add args on imports (#3423) 2020-06-01 10:43:06 -06:00
autohttps_test.go caddyhttp: Clean up internal auto-HTTPS redirect code 2020-12-10 14:36:46 -07:00
caddyfile_adapt_test.go encode,staticfiles: Content negotiation, precompressed files (#4045) 2021-03-29 18:47:19 -06:00
caddyfile_test.go refactored caddytest helpers (#3285) 2020-04-27 13:23:46 +12:00
handler_test.go browse: align template to struct field renames from 4940325 (#3706) 2020-09-08 10:45:48 -06:00
map_test.go map: Accept regex substitution in outputs (#3991) 2021-03-10 14:22:33 -07:00
reverseproxy_test.go reverseproxy: Fix dial placeholders, SRV, active health checks (#3780) 2020-10-13 10:35:20 -06:00
sni_test.go map: Reimplement; multiple outputs; optimize 2020-10-02 14:23:56 -06:00
stream_test.go reverse_proxy: fix bidirectional streams with encodings (fix #3606) (#3620) 2020-08-03 20:50:38 -06:00