summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/subroute.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-01-12 13:39:32 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2020-01-12 13:39:32 -0700
commit64f0173948e9b87a8f898d451ef35daefedf2c50 (patch)
tree635019e8ff37ec2f87320b2795842ae5813e93eb /modules/caddyhttp/subroute.go
parentfe5a531c58f9714bf379962c51d086a14661cfdb (diff)
http: Fix subroutes, ensure that next handlers can still be called
Diffstat (limited to 'modules/caddyhttp/subroute.go')
-rw-r--r--modules/caddyhttp/subroute.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/caddyhttp/subroute.go b/modules/caddyhttp/subroute.go
index a324873..2e80d88 100644
--- a/modules/caddyhttp/subroute.go
+++ b/modules/caddyhttp/subroute.go
@@ -69,12 +69,12 @@ func (sr *Subroute) Provision(ctx caddy.Context) error {
return nil
}
-func (sr *Subroute) ServeHTTP(w http.ResponseWriter, r *http.Request, _ Handler) error {
- subroute := sr.Routes.Compile()
+func (sr *Subroute) ServeHTTP(w http.ResponseWriter, r *http.Request, next Handler) error {
+ subroute := sr.Routes.Compile(next)
err := subroute.ServeHTTP(w, r)
if err != nil && sr.Errors != nil {
r = sr.Errors.WithError(r, err)
- errRoute := sr.Errors.Routes.Compile()
+ errRoute := sr.Errors.Routes.Compile(next)
return errRoute.ServeHTTP(w, r)
}
return err