diff options
| author | Matthew Holt <mholt@users.noreply.github.com> | 2020-05-11 12:14:47 -0600 | 
|---|---|---|
| committer | Matthew Holt <mholt@users.noreply.github.com> | 2020-05-11 12:14:47 -0600 | 
| commit | 7960b4259d976810691f1085332d4761abab9928 (patch) | |
| tree | f352971746e571fd178dede975106c751a5de7b5 /modules/caddyhttp/routes.go | |
| parent | 2c91688f39a80afc48e232e989f13aafbc782cf5 (diff) | |
caddyhttp: Minor refactoring for preparing requests
While building a layer4 app for Caddy, I discovered that we need the
ability to fill a request's context just like the HTTP server does,
hence this exported function PrepareRequest().
Diffstat (limited to 'modules/caddyhttp/routes.go')
| -rw-r--r-- | modules/caddyhttp/routes.go | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/modules/caddyhttp/routes.go b/modules/caddyhttp/routes.go index 27d4922..10e0c9d 100644 --- a/modules/caddyhttp/routes.go +++ b/modules/caddyhttp/routes.go @@ -113,7 +113,7 @@ func (r Route) Empty() bool {  // create a middleware chain.  type RouteList []Route -// Provision sets up both the matchers and handlers in the route. +// Provision sets up both the matchers and handlers in the routes.  func (routes RouteList) Provision(ctx caddy.Context) error {  	err := routes.ProvisionMatchers(ctx)  	if err != nil { @@ -284,7 +284,7 @@ type RawMatcherSets []caddy.ModuleMap  type MatcherSets []MatcherSet  // AnyMatch returns true if req matches any of the -// matcher sets in mss or if there are no matchers, +// matcher sets in ms or if there are no matchers,  // in which case the request always matches.  func (ms MatcherSets) AnyMatch(req *http.Request) bool {  	for _, m := range ms { | 
