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
headers: Add support for deleting all headers as one operation #5464
Conversation
Hmm, this'll also affect the
Previously, it would take the value from |
@francislavoie Thank you for providing the test example, but surprisingly, it still works as expected in this case. This seems to be because the
Then I used
Then, I tested another case
The output of
|
Oh sorry, yeah. I meant the |
I tested the Caddyfile
Command
Result from
By switching the order it works 🤔
Result
It appears that the execution order of |
However, I am still concerned about potentially breaking something else. I have come up with a better approach: treating This should not break anything, as the |
That's cause that's two separate handler invocations instead of one handler with two operations. Did we not implement multiple operations for request headers in the Caddyfile? 🤷♂️ This might be fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch!
This LGTM -- I appreciate the careful consideration. Initially I too was thinking we just move the Delete logic up to be first, but I can see how this is probably safer and more relevant.
I just submitted suggestions to improve the comments. If you agree let's go ahead and accept those changes before merging. Thanks!
ca75fa3
to
974cc8b
Compare
This reverts commit 1b50eee.
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
974cc8b
to
75f1ef0
Compare
Related issue #5451
This PR recognizes the syntax
header_up -*
and removes all headers. After removing all headers, any desired headers can be added.Here is an example Caddyfile:
This example removes all headers sent by the client except for authorization.
As I am not familiar with the code of Caddy, I am concerned that changing the order of the header manipulation could affect other programs. Please help me review this PR :)