Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including matcher in 'handle_response' line has confusing error #6529

Open
foxt opened this issue Aug 20, 2024 · 1 comment
Open

Including matcher in 'handle_response' line has confusing error #6529

foxt opened this issue Aug 20, 2024 · 1 comment
Labels
bug 🐞 Something isn't working

Comments

@foxt
Copy link

foxt commented Aug 20, 2024

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

that just complains if there are two parameters passed to handle_response.

@mholt
Copy link
Member

mholt commented Aug 20, 2024

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.

@mholt mholt added the bug 🐞 Something isn't working label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants