Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Return M_INVALID_PARAM instead of M_BAD_JSON when setting aliases (
Browse files Browse the repository at this point in the history
…#3297)

Part of #3223
(matrix-org/matrix-spec#1286)

(For `DELETE` we don't validate the alias, but just return a 404 if we
can't find it)
  • Loading branch information
S7evinK authored Jan 9, 2024
1 parent 13c5173 commit 9510fa0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clientapi/routing/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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'"),
}
}

Expand Down Expand Up @@ -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'"),
}
}

Expand Down

0 comments on commit 9510fa0

Please sign in to comment.