reverseproxy: fix misleading handle_response error for extra matcher args (#7869)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>pull/7867/head^2
parent
75c988d118
commit
945d199724
|
|
@ -0,0 +1,10 @@
|
|||
localhost:8884 {
|
||||
reverse_proxy localhost:8000 {
|
||||
handle_response header Foo {
|
||||
respond "handled"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
----------
|
||||
parsing caddyfile tokens for 'reverse_proxy': too many arguments for 'handle_response': only a single response matcher name is allowed, but got: [header Foo]
|
||||
|
|
@ -923,13 +923,8 @@ func (h *Handler) FinalizeUnmarshalCaddyfile(helper httpcaddyfile.Helper) error
|
|||
d.Next()
|
||||
args := d.RemainingArgs()
|
||||
|
||||
// TODO: Remove this check at some point in the future
|
||||
if len(args) == 2 {
|
||||
return d.Errf("configuring 'handle_response' for status code replacement is no longer supported. Use 'replace_status' instead.")
|
||||
}
|
||||
|
||||
if len(args) > 1 {
|
||||
return d.Errf("too many arguments for 'handle_response': %s", args)
|
||||
return d.Errf("too many arguments for 'handle_response': only a single response matcher name is allowed, but got: %s", args)
|
||||
}
|
||||
|
||||
var matcher *caddyhttp.ResponseMatcher
|
||||
|
|
|
|||
Loading…
Reference in New Issue