Add method agnostic routes#126
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2633727b82
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17fc45d179
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 406c8a4fd2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1ee26f40e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for _, method := range anyRouteMethods { | ||
| if a.hasExplicitRouteMethod(pattern, method) { | ||
| continue | ||
| } | ||
| a.router.Method(method, pattern, handler) | ||
| } |
There was a problem hiding this comment.
Avoid bypassing method-specific fallbacks for standard verbs
Because this loop installs concrete GET/POST/etc. routes for every Any handler, standard-method requests are routed by chi's path specificity before the matchesAnyRoute fallback can preserve method-specific handlers. For example, with Get("/*", ...) plus Any("/webhook", ...), GET /webhook will hit the concrete GET route created here for the Any handler, even though a GET route already matches the request; extension methods without a concrete route take the intended fallback path instead. This makes Any precedence inconsistent and can unexpectedly steal traffic from method-specific catch-alls.
Useful? React with 👍 / 👎.
Why
Some Ohm routes intentionally need to accept every request method, including extension methods that are not part of the standard
net/httpmethod set. Proxy, tunnel, and webhook boundaries should be able to preserver.Methodwithout forcing applications to enumerate a partial method list.Closes #124.