Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Text for 405 errors is a lie #6894

Open
richvdh opened this issue Feb 11, 2020 · 2 comments
Open

Text for 405 errors is a lie #6894

richvdh opened this issue Feb 11, 2020 · 2 comments
Labels
O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. z-bug (Deprecated Label) z-p3 (Deprecated Label)

Comments

@richvdh
Copy link
Member

richvdh commented Feb 11, 2020

When you send a GET request to an endpoint that only supports POST, or vice versa, synapse sends back an error that looks like:

Method Not Allowed

Your browser approached me (at /_matrix/saml2/authn_response) with the method "GET". I only allow the method HEAD here.

We hardly support HEAD anywhere, and it doesn't say anything about POST.

(This actually only happens on a subset of endpoints, such as the media repo ones. For others we give back a 400, which I think is fine).

Related: #6746

@clokep
Copy link
Contributor

clokep commented Jul 30, 2020

If we wanted to fix this with our async resources we essentially need the logic from twisted.web.resource._computeAllowedMethods at the bottom of our _AsyncResource._async_render method.

@reivilibre reivilibre added S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. O-Uncommon Most users are unlikely to come across this or unexpected workflow labels May 23, 2023
@LutzLange
Copy link

I just hit this error. I was using python requests and did not notice that it was using a GET request instead of a POST request.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. z-bug (Deprecated Label) z-p3 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

4 participants