Skip to content
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

fix: handle methodnotallowed with path variables #512

Merged
merged 1 commit into from
May 22, 2020

Conversation

caseyhadden
Copy link
Contributor

Currently, any route with a pathvariable will return a 404 on a method not allowed condition when it should return a 405. This adds the necessary bool setting to the route context for the path variable case.

We noticed this when we upgraded from v4.0.1 to v4.1.1. A little git bisect magic later, and it turned out to be in some of the regex additions. Repeating the setting of the rctx.methodNotAllowed boolean looked like the most straightforward approach.

Currently, any route with a pathvariable will return a 404 on a method
not allowed condition when it should return a 405. This adds the
necessary bool setting to the route context for the path variable case.
@pkieltyka
Copy link
Member

thanks for the report + fix

@pkieltyka pkieltyka merged commit 5704d7e into go-chi:master May 22, 2020
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.

2 participants