element-hq / element-hq/synapse

Text for 405 errors is a lie

Open
#6,894 0 comments 0 reactions 0 assignees View on GitHub
O-Uncommon S-Tolerable T-Defect z-bug z-p3
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#6894](https://github.com/matrix-org/synapse/issues/6894).

---

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: https://github.com/matrix-org/synapse/issues/6746

Contributor guide

Open the contributing guide

Research direction

Start by reproducing a GET request against /_matrix/saml2/authn_response and compare the 405 response with the media repository endpoints mentioned in the issue. Trace the request-method handling and verify that the error names the methods the endpoint actually allows, with behavior covered for the affected endpoints.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.