-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Synapse can return 401 when accessing profile information #8520
Comments
For completeness: the response of Synapse to
|
It's worth noting that the option I can reproduce the When Synapse attempts to query the profile from another homeserver, it makes a request, and if it receives an http code other than 200, it'll blindly return that code to the client along with an synapse/synapse/handlers/profile.py Lines 124 to 134 in 8a4a418
Synapse will not return a synapse/synapse/handlers/profile.py Lines 263 to 286 in 8a4a418
Thus, what I think is happening is Conduit is returning a Additionally, Synapse needs to fix its error handling here so that regardless of what it receives from other servers, it will not return error codes to the client that it's not expected. |
fixes matrix-org#8520 Signed-off-by: Pavel Turinsky <pavel.turinsky@matfyz.cz>
Fixes #8520 Signed-off-by: Pavel Turinsky <pavel.turinsky@matfyz.cz> Co-authored-by: Erik Johnston <erikj@jki.re>
Description
When accessing
/_matrix/client/r0/profile/@user:domain:tld
API endpoint, Synapse sometimes returns HTTP 401, which shouldn't be possible according to the Spec.According to the log, this might be caused by forwarding responses from federation:
Some clients misunderstand this as an authentication token rejection, logging the user out.
Steps to reproduce
curl -D - 'https://matrix.org/_matrix/client/r0/profile/@timo:conduit.rs'
(This endpoint is not authenticated, so this should work.)
Expected result: Either returning HTTP 200 with the response, or falling back to HTTP 404, not to confuse clients.
Version information
If not matrix.org:
pip freeze
)Additional information
There are some database errors regarding the request as well, snippet is here. But that is probably unrelated / worth separate issue.
The text was updated successfully, but these errors were encountered: