0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00
caddy/modules/caddyhttp
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
..
caddyauth go.mod: Migrate to golang.org/x/term (#4073) 2021-03-29 12:39:08 -06:00
encode encode,staticfiles: Content negotiation, precompressed files (#4045) 2021-03-29 18:47:19 -06:00
fileserver fileserver: Add status code override (#4076) 2021-04-08 11:09:12 -06:00
headers headers: Fix Caddyfile parsing for request_header with matchers (#4085) 2021-03-29 10:55:29 -06:00
map map: Accept regex substitution in outputs (#3991) 2021-03-10 14:22:33 -07:00
push headers: Support default header values in Caddyfile with '?' (#3807) 2020-11-20 12:38:16 -07:00
requestbody Revert "requestbody: Allow overwriting remote address" 2021-01-19 18:43:01 -07:00
reverseproxy reverseproxy: Set cookie path to / when using cookie lb_policy (#4096) 2021-03-30 15:29:00 -06:00
rewrite rewrite: Implement regex path replacements 2021-03-01 18:27:59 -07:00
standard encode,staticfiles: Content negotiation, precompressed files (#4045) 2021-03-29 18:47:19 -06:00
templates templates: Add fileExists and httpError template actions 2021-01-11 13:49:20 -07:00
app.go reverseproxy: Add duration/latency placeholders (close #4012) (#4013) 2021-02-22 11:57:21 -07:00
autohttps.go httpcaddyfile: Fix default issuers when email provided 2021-02-02 16:17:26 -07:00
caddyhttp.go httpcaddyfile: Configure servers via global options (#3836) 2020-11-23 12:46:50 -07:00
celmatcher.go caddyhttp: Add support to resolve DN in CEL expression (#3608) 2020-07-31 15:06:30 -06:00
celmatcher_test.go caddyhttp: Add support to resolve DN in CEL expression (#3608) 2020-07-31 15:06:30 -06:00
errors.go ci: Use golangci's github action for linting (#3794) 2020-11-22 14:50:29 -07:00
marshalers.go ci: Use golangci's github action for linting (#3794) 2020-11-22 14:50:29 -07:00
matchers.go caddyhttp: Support placeholders in header matcher values (close #3916) 2021-02-11 16:27:09 -07:00
matchers_test.go caddyhttp: Support placeholders in header matcher values (close #3916) 2021-02-11 16:27:09 -07:00
metrics.go metrics: Always track method label in uppercase (#3742) 2020-09-22 20:10:34 -06:00
metrics_test.go metrics: Fix panic when headers aren't written (#3737) 2020-09-21 13:42:47 -06:00
replacer.go reverseproxy: Add duration/latency placeholders (close #4012) (#4013) 2021-02-22 11:57:21 -07:00
replacer_test.go caddyhttp: New placeholder for PEM of client certificate (#3662) 2020-09-16 15:06:51 -06:00
responsewriter.go caddyhttp: Fix trailers when recording responses (fixes #3236) 2020-04-22 11:10:13 -06:00
routes.go metrics: Fix hidden panic while observing with bad exemplars (#3733) 2020-09-17 21:46:24 -06:00
server.go caddyhttp: improve grammar of comment for AllowH2C (#4072) 2021-03-29 12:04:25 -06:00
staticerror.go httpcaddyfile: Add error directive for the existing handler (#4034) 2021-03-12 13:25:49 -07:00
staticresp.go caddyhttp: Check for invalid subdirectives of static_response 2021-02-02 16:19:58 -07:00
staticresp_test.go Implement config adapters and beginning of Caddyfile adapter 2019-08-09 12:05:47 -06:00
subroute.go reverseproxy: Enable changing only the status code (close #2920) 2020-06-04 12:06:38 -06:00
vars.go caddyfile: Add support for vars and vars_regexp matchers (#3730) 2020-09-25 17:50:26 -06:00