Skip to content

Add method agnostic routes#126

Merged
mgomes merged 4 commits into
masterfrom
feat/method-agnostic-routes
Jun 27, 2026
Merged

Add method agnostic routes#126
mgomes merged 4 commits into
masterfrom
feat/method-agnostic-routes

Conversation

@mgomes

@mgomes mgomes commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Why

Some Ohm routes intentionally need to accept every request method, including extension methods that are not part of the standard net/http method set. Proxy, tunnel, and webhook boundaries should be able to preserve r.Method without forcing applications to enumerate a partial method list.

Closes #124.

mgomes commented Jun 27, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread app.go Outdated
Comment thread app.go Outdated

mgomes commented Jun 27, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread app.go Outdated

mgomes commented Jun 27, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread app.go
Comment thread app.go Outdated

mgomes commented Jun 27, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread app.go
Comment on lines +142 to 147
for _, method := range anyRouteMethods {
if a.hasExplicitRouteMethod(pattern, method) {
continue
}
a.router.Method(method, pattern, handler)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@mgomes mgomes merged commit 002c70e into master Jun 27, 2026
2 checks passed
@mgomes mgomes deleted the feat/method-agnostic-routes branch June 27, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add first-class method-agnostic HTTP routes

1 participant