mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-29 07:01:32 +00:00
Fix getAliasesForRoomID has no HTTP handler in aliasAPI (#705)
This PR adds back the HTTP handler for internal API GetAliasesForRoomID in roomserver, which seemed to be missing.
This commit is contained in:
parent
c725176878
commit
6106ec1399
@ -277,6 +277,20 @@ func (r *RoomserverAliasAPI) SetupHTTP(servMux *http.ServeMux) {
|
|||||||
return util.JSONResponse{Code: http.StatusOK, JSON: &response}
|
return util.JSONResponse{Code: http.StatusOK, JSON: &response}
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
servMux.Handle(
|
||||||
|
roomserverAPI.RoomserverGetAliasesForRoomIDPath,
|
||||||
|
common.MakeInternalAPI("getAliasesForRoomID", func(req *http.Request) util.JSONResponse {
|
||||||
|
var request roomserverAPI.GetAliasesForRoomIDRequest
|
||||||
|
var response roomserverAPI.GetAliasesForRoomIDResponse
|
||||||
|
if err := json.NewDecoder(req.Body).Decode(&request); err != nil {
|
||||||
|
return util.ErrorResponse(err)
|
||||||
|
}
|
||||||
|
if err := r.GetAliasesForRoomID(req.Context(), &request, &response); err != nil {
|
||||||
|
return util.ErrorResponse(err)
|
||||||
|
}
|
||||||
|
return util.JSONResponse{Code: http.StatusOK, JSON: &response}
|
||||||
|
}),
|
||||||
|
)
|
||||||
servMux.Handle(
|
servMux.Handle(
|
||||||
roomserverAPI.RoomserverRemoveRoomAliasPath,
|
roomserverAPI.RoomserverRemoveRoomAliasPath,
|
||||||
common.MakeInternalAPI("removeRoomAlias", func(req *http.Request) util.JSONResponse {
|
common.MakeInternalAPI("removeRoomAlias", func(req *http.Request) util.JSONResponse {
|
||||||
|
Loading…
Reference in New Issue
Block a user