-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
caddyhttp: Add MatchWithError
to replace SetVar hack
#6596
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8fb5ebb
caddyhttp: Add `MatchWithError` to replace SetVar hack
francislavoie e1e0161
Error in IP matchers on TLS handshake not complete
francislavoie 28338a9
Use MatchWithError everywhere possible
francislavoie 1b5513c
Move implementations to MatchWithError versions
francislavoie 467f65f
Looser interface checking to allow fallback
francislavoie 1c0f014
CEL factories can return RequestMatcherWithError
francislavoie b876f2b
Clarifying comment since it's subtle that an err is returned
francislavoie 5c5f7c2
Return 425 Too Early status in IP matchers
francislavoie c8e38e4
Keep AnyMatch signature the same for now
francislavoie c1c0d00
Apparently Deprecated can't be all-uppercase to get IDE linting
francislavoie 73044e1
Linter
francislavoie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm kinda bummed because if we did this I would want it to be
Match(*http.Request) (bool, error)
.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.
I agree. I don't see how. It's like
DialContext
etc. Something to redo in v3 lmaoThere 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.
Maybe, but if we remove this interface, it'll be a breaking change anyway, so might as well break it into something that we want right? 😅
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.
We can:
RequestMatcherWithError
(this)RequestMatcher
RequestMatcher
toMatch(*http.Request) (bool, error)
(should be safe since plugins no longer use it)RequestMatcherWithError
, preferringRequestMatcher
if implementedRequestMatcherWithError
All this might take months or years but that would be the path.
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.
That's what I'm thinking too. It'll kind of suck, but... might be worth it.