0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-06-13 09:58:59 +02:00

Fix setting displayname and avatar_url (#3125)

As per the spec, `displayname` and `avatar_url` may be empty.
This commit is contained in:
Till 2023-06-28 20:18:07 +02:00 committed by GitHub
parent a5ea928d0f
commit 4722f12fab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -104,12 +104,6 @@ func SetAvatarURL(
if resErr := httputil.UnmarshalJSONRequest(req, &r); resErr != nil {
return *resErr
}
if r.AvatarURL == "" {
return util.JSONResponse{
Code: http.StatusBadRequest,
JSON: spec.BadJSON("'avatar_url' must be supplied."),
}
}
localpart, domain, err := gomatrixserverlib.SplitID('@', userID)
if err != nil {
@ -199,12 +193,6 @@ func SetDisplayName(
if resErr := httputil.UnmarshalJSONRequest(req, &r); resErr != nil {
return *resErr
}
if r.DisplayName == "" {
return util.JSONResponse{
Code: http.StatusBadRequest,
JSON: spec.BadJSON("'displayname' must be supplied."),
}
}
localpart, domain, err := gomatrixserverlib.SplitID('@', userID)
if err != nil {