Skip to content

feat: 405 Method Not Allowed with Allow header (issue #19) - #32

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue-19-405-allow
Apr 26, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue-19-405-allow

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

On no match in the current method’s router, if another method’s router would match the same request path, return 405 with an Allow header (canonical method order) and a short text/plain body.

Tests

  • GET to POST-only path → 405, Allow includes POST
  • POST to GET-only path → 405, Allow includes GET, HEAD
  • POST to unregistered path → 404

Closes #19

- Scan routers on route miss; if any method matches the path, respond 405
  with ordered Allow and plain body
- state::methods_matching_path; response::send_405_method_not_allowed
- ASGI tests: POST-only, GET+HEAD, true 404

Closes #19

@ZhuchkaTriplesix ZhuchkaTriplesix left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

123

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 6ae2d5c into dev Apr 26, 2026
16 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue-19-405-allow branch April 26, 2026 19:41
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.

1 participant