caddy/modules/caddyhttp
Robin Lambertz e3591009dc
caddyhttp: Add handler for unhandled errors in errorChain (#3063)
* Add handler for unhandled errors in errorChain

Currently, when an error chain is defined, the default error handler is
bypassed entirely - even if the error chain doesn't handle every error.
This results in pages returning a blank 200 OK page.

For instance, it's possible for an error chain to match on the error
status code and only handle a certain subtype of errors (like 403s). In
this case, we'd want any other errors to still go through the default
handler and return an empty page with the status code.

This PR changes the "suffix handler" passed to errorChain.Compile to
set the status code of the response to the error status code.

Fixes #3053

* Move the errorHandlerChain middleware to variable

* Style fix
2020-02-20 15:00:30 -07:00
..
caddyauth basicauth: default hash to bcrypt (#3050) 2020-02-17 12:19:59 -07:00
encode caddyfile: Refactor; NewFromNextSegment(); fix repeated matchers 2020-02-14 11:01:09 -07:00
fileserver browse: allow filter init via filter query param (#3027) 2020-02-08 12:36:37 -07:00
headers header: caddyfile: Defer header operations for deletions or manually 2020-02-04 11:05:32 -07:00
httpcache Improve godocs all around 2019-12-23 12:45:35 -07:00
requestbody Improve godocs all around 2019-12-23 12:45:35 -07:00
reverseproxy caddyfile: Refactor; NewFromNextSegment(); fix repeated matchers 2020-02-14 11:01:09 -07:00
rewrite rewrite: Prepend "/" if missing from strip path prefix 2020-01-22 09:36:05 -07:00
standard Remove Starlark, for now 2020-02-06 18:46:52 -07:00
templates v2: housekeeping: address minor lint complaints (#2957) 2020-01-03 11:33:22 -07:00
autohttps.go tls: Avoid duplication AutomationPolicies for large quantities of names 2020-02-14 11:14:52 -07:00
caddyhttp.go caddyhttp: Add handler for unhandled errors in errorChain (#3063) 2020-02-20 15:00:30 -07:00
errors.go http: Change routes to sequential matcher evaluation (#2967) 2020-01-09 10:00:13 -07:00
marshalers.go http: Fix ciphersuite logging 2020-01-16 15:44:49 -06:00
matchers.go caddyhttp: Fixes for header and header_regexp directives (#3061) 2020-02-20 10:55:47 -07:00
matchers_test.go caddyhttp: Fixes for header and header_regexp directives (#3061) 2020-02-20 10:55:47 -07:00
replacer.go http: Remove {...query_string} placeholder, in favor of {...query} 2020-01-10 17:02:11 -07:00
replacer_test.go caddyhttp: host labels placeholders endianness from right->left 2019-10-14 12:09:43 -06:00
responsewriter.go http: Always set status code via response recorder 2020-01-08 18:37:41 -07:00
routes.go httpcaddyfile: Fix nested blocks; add handle directive; refactor 2020-01-16 17:08:52 -07:00
server.go Minor tweaks to docs/comments 2020-02-14 11:01:09 -07:00
staticerror.go Export Replacer and use concrete type instead of interface 2019-12-29 13:12:52 -07:00
staticresp.go httpcaddyfile: Update directive docs; put root after rewrite 2020-01-22 09:32:38 -07:00
staticresp_test.go Implement config adapters and beginning of Caddyfile adapter 2019-08-09 12:05:47 -06:00
subroute.go http: Fix subroutes, ensure that next handlers can still be called 2020-01-12 13:39:32 -07:00
vars.go v2: Implement RegExp Vars Matcher (#2997) 2020-02-08 12:26:31 -07:00