mirror of
https://github.com/caddyserver/caddy.git
synced 2025-10-19 07:43:17 +00:00
caddyhttp: Implement better HTTP matchers including regexp; add tests
This commit is contained in:
parent
48b5a80320
commit
8ae0d6a509
5 changed files with 519 additions and 66 deletions
|
@ -13,7 +13,7 @@ type serverRoute struct {
|
|||
Apply []json.RawMessage `json:"apply"`
|
||||
Respond json.RawMessage `json:"respond"`
|
||||
|
||||
Exclusive bool `json:"exclusive"`
|
||||
Terminal bool `json:"terminal"`
|
||||
|
||||
// decoded values
|
||||
matchers []RouteMatcher
|
||||
|
@ -49,9 +49,7 @@ routeLoop:
|
|||
if responder == nil {
|
||||
responder = route.responder
|
||||
}
|
||||
// TODO: Should exclusive apply to only middlewares, or responder too?
|
||||
// i.e. what if they haven't set a responder yet, but the first middleware chain is exclusive...
|
||||
if route.Exclusive {
|
||||
if route.Terminal {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue