caddy
caddy copied to clipboard
Including matcher in 'handle_response' line has confusing error
If you use the following Caddyfile:
reverse_proxy localhost:8000 {
handle_response header Foo {
# do something
}
}
you will get the following error: adapting config using caddyfile: parsing caddyfile tokens for 'reverse_proxy': configuring 'handle_response' for status code replacement is no longer supported. Use 'replace_status' instead. even though you're not touching the status code.
If you use either
handle_response header Foo * {
or
@bad status 500
handle_response @bad {
no error is raised.
Seems to be a check implemented at https://github.com/caddyserver/caddy/blob/54a0c8f94821f393edec1a1bc9459f2363c95117/modules/caddyhttp/reverseproxy/caddyfile.go#L915 that just complains if there are two parameters passed to handle_response.
Ah thanks.
@francislavoie This was from about 2 years ago; maybe it's time to revisit while we're at it? The previous line says // TODO: Remove this check at some point in the future.