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
Undue 405 error with POST request #2384
Comments
Try |
@ahopkins Could we change the default to |
Thanks for the tip and the detailed explanation. This is unfortunate but reasonable. The "strict" behavior should be default IMO, as it's the least prone to confusion. As a matter of fact, should it be strict by default, my app wouldn't break as I'm pretty strict with trailing slashes myself, and I think this matter is best solved by redirections on NGinX side. You may close this issue, thank you again for your help. |
That does not seem sensible IMO. It would be a breaking change for a lot of applications. I would think that most people on the Internet would assume Since we corrected the bug in the old router, this is the 3rd time this has come up (I just went back to check). I would not call that frequent. I would call it a failure of the docs. We should fix that. If we want to do anything, then maybe we discuss whether or not @johndoe46 Here is a more thorough discussion: #2239 (comment) And, it is also probably worth mentioning the alternative I gave there that |
Describe the bug
Sanic gives a HTTP 405 on POST request while it should give a HTTP 200. Problem does not happen with previous Sanic versions.
Code snippet
Example app:
Client test:
Result with Sanic 21.12.1:
(<Response [405]>, <Response [200]>)
Result with Sanic 20.12.3:
(<Response [200]>, <Response [200]>)
Expected behavior
Sanic should give an HTTP 200 to the POST request.
Environment (please complete the following information):
Additional context
Complete server traces:
The text was updated successfully, but these errors were encountered: