summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/subroute.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-06-04 12:06:38 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2020-06-04 12:06:38 -0600
commit7a99835dab64f7864186185761bbf5194216f8b6 (patch)
tree90845df820a57ac032cf7156e45d8859ebcf30eb /modules/caddyhttp/subroute.go
parent7b0962ba4df7e1dd7ab3f193fba394a4b899c431 (diff)
reverseproxy: Enable changing only the status code (close #2920)
Diffstat (limited to 'modules/caddyhttp/subroute.go')
-rw-r--r--modules/caddyhttp/subroute.go30
1 files changed, 0 insertions, 30 deletions
diff --git a/modules/caddyhttp/subroute.go b/modules/caddyhttp/subroute.go
index b1700f5..2e80d88 100644
--- a/modules/caddyhttp/subroute.go
+++ b/modules/caddyhttp/subroute.go
@@ -80,36 +80,6 @@ func (sr *Subroute) ServeHTTP(w http.ResponseWriter, r *http.Request, next Handl
return err
}
-// ResponseHandler pairs a response matcher with a route list.
-// It is useful for executing handler routes based on the
-// properties of an HTTP response that has not been written
-// out to the client yet.
-//
-// To use this type, provision it at module load time, then
-// when ready to use, match the response against its matcher;
-// if it matches (or doesn't have a matcher), invoke the routes
-// by calling `rh.Routes.Compile(next).ServeHTTP(rw, req)` (or
-// similar).
-type ResponseHandler struct {
- // The response matcher for this handler. If empty/nil,
- // it always matches.
- Match *ResponseMatcher `json:"match,omitempty"`
-
- // The list of HTTP routes to execute.
- Routes RouteList `json:"routes,omitempty"`
-}
-
-// Provision sets up the routse in rh.
-func (rh *ResponseHandler) Provision(ctx caddy.Context) error {
- if rh.Routes != nil {
- err := rh.Routes.Provision(ctx)
- if err != nil {
- return err
- }
- }
- return nil
-}
-
// Interface guards
var (
_ caddy.Provisioner = (*Subroute)(nil)