Skip to content

Commit

Permalink
Add HTTP 403 to possible profile responses
Browse files Browse the repository at this point in the history
Some servers may not allow profile lookup over federation, and thus
respond to GET /_matrix/client/v3/profile/{userId} with an HTTP 403.

For example, Synapse can be configured to behave in this way by setting:

    allow_profile_lookup_over_federation=false

Thus, this behavior already exists in the wild, and may cause issues for
clients such as element-hq/element-web#17269.

Synapse could alter its behavior and return an HTTP 404 in these cases,
but amending the Spec seems preferable to align with extant behavior.
Further, allowing HTTP 403 gives clients more specific information as to
why a request has failed, enabling more precise error handling.

Signed-off-by: Dan Callahan <danc@element.io>
  • Loading branch information
callahad committed Nov 25, 2021
1 parent dce06f6 commit ff7f02d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelogs/client_server/newsfragments/3530.clarification
@@ -0,0 +1 @@
Document that servers may respond with an HTTP 403 to GET /_matrix/client/v3/profile/{userId}.
2 changes: 2 additions & 0 deletions data/api/client-server/profile.yaml
Expand Up @@ -211,6 +211,8 @@ paths:
displayname:
type: string
description: The user's display name if they have set one, otherwise not present.
403:
description: The server is unwilling to disclose whether the user exists and/or has profile information.
404:
description: There is no profile information for this user or this user does not exist.
tags:
Expand Down

0 comments on commit ff7f02d

Please sign in to comment.