diff options
author | Till <2353100+S7evinK@users.noreply.github.com> | 2024-01-09 20:05:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-09 20:05:45 +0100 |
commit | 9510fa00cce80882d7a59e036eb87646e279ac41 (patch) | |
tree | 63ce8a42583d51391fcf06c3fed470cf16093cd9 /clientapi | |
parent | 13c5173273852d5f16f3c3d46f20fb1fd33f99d0 (diff) |
Return `M_INVALID_PARAM` instead of `M_BAD_JSON` when setting aliases (#3297)
Part of https://github.com/matrix-org/dendrite/issues/3223
(https://github.com/matrix-org/matrix-spec/pull/1286)
(For `DELETE` we don't validate the alias, but just return a 404 if we
can't find it)
Diffstat (limited to 'clientapi')
-rw-r--r-- | clientapi/routing/directory.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clientapi/routing/directory.go b/clientapi/routing/directory.go index 90772766..9466f583 100644 --- a/clientapi/routing/directory.go +++ b/clientapi/routing/directory.go @@ -55,7 +55,7 @@ func DirectoryRoom( if err != nil { return util.JSONResponse{ Code: http.StatusBadRequest, - JSON: spec.BadJSON("Room alias must be in the form '#localpart:domain'"), + JSON: spec.InvalidParam("Room alias must be in the form '#localpart:domain'"), } } @@ -134,7 +134,7 @@ func SetLocalAlias( if err != nil { return util.JSONResponse{ Code: http.StatusBadRequest, - JSON: spec.BadJSON("Room alias must be in the form '#localpart:domain'"), + JSON: spec.InvalidParam("Room alias must be in the form '#localpart:domain'"), } } |