Not throwing method not allowed, when I have not allowed a PUT method and have a POST method
- Dominant language
- Go
- Stars
- 22.8k
- Forks
- 1.2k
- Avg merge
- 5h 17m
- Merged PRs (30d)
- 10
Description
I have a POST method using a custom middleware
`r.With(middleware.AuthMiddleware).Method(http.MethodPost, "/something", handlers.Handler(someHandler))`
and for this /something there is no other route or other method mentioned anywhere
So My expectation is the chi should throw a 405 method not allowed and it seems to work for other cases, however for this POST ( originally ), hitting PUT method, it doesn't throw a 405 and just redirects to some random route.
Is there something I am missing? Or some configuration I am supposed to additionally do or remove to fix this?
Contributor guide
Research direction
Start with the r.With(middleware.AuthMiddleware).Method(http.MethodPost, "/something", handlers.Handler(someHandler)) route and reproduce a PUT request to /something. Trace the router and middleware handling for an unmatched method, including the redirect, and compare it with the expected 405 response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100