0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-02-17 23:45:41 -05:00
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
requestbody
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
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
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
responsewriter.go
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
staticresp.go httpcaddyfile: Update directive docs; put root after rewrite 2020-01-22 09:32:38 -07:00
staticresp_test.go
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