mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-31 10:43:10 -06:00
Fix push server internal http wiring
This commit is contained in:
parent
b89da40cbd
commit
c9e94b4751
|
|
@ -54,22 +54,22 @@ func AddRoutes(r api.PushserverInternalAPI, internalAPIMux *mux.Router) {
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
internalAPIMux.Handle(QueryPushRulesPath,
|
internalAPIMux.Handle(QueryPushersPath,
|
||||||
httputil.MakeInternalAPI("queryPushRules", func(req *http.Request) util.JSONResponse {
|
httputil.MakeInternalAPI("queryPushers", func(req *http.Request) util.JSONResponse {
|
||||||
request := api.QueryPushRulesRequest{}
|
request := api.QueryPushersRequest{}
|
||||||
response := api.QueryPushRulesResponse{}
|
response := api.QueryPushersResponse{}
|
||||||
if err := json.NewDecoder(req.Body).Decode(&request); err != nil {
|
if err := json.NewDecoder(req.Body).Decode(&request); err != nil {
|
||||||
return util.MessageResponse(http.StatusBadRequest, err.Error())
|
return util.MessageResponse(http.StatusBadRequest, err.Error())
|
||||||
}
|
}
|
||||||
if err := r.QueryPushRules(req.Context(), &request, &response); err != nil {
|
if err := r.QueryPushers(req.Context(), &request, &response); err != nil {
|
||||||
return util.ErrorResponse(err)
|
return util.ErrorResponse(err)
|
||||||
}
|
}
|
||||||
return util.JSONResponse{Code: http.StatusOK, JSON: &response}
|
return util.JSONResponse{Code: http.StatusOK, JSON: &response}
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
internalAPIMux.Handle(PerformPusherDeletionPath,
|
internalAPIMux.Handle(PerformPushRulesPutPath,
|
||||||
httputil.MakeInternalAPI("performPusherDeletion", func(req *http.Request) util.JSONResponse {
|
httputil.MakeInternalAPI("performPushRulesPut", func(req *http.Request) util.JSONResponse {
|
||||||
request := api.PerformPushRulesPutRequest{}
|
request := api.PerformPushRulesPutRequest{}
|
||||||
response := struct{}{}
|
response := struct{}{}
|
||||||
if err := json.NewDecoder(req.Body).Decode(&request); err != nil {
|
if err := json.NewDecoder(req.Body).Decode(&request); err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue