From 173c4abb0d590f8ff668e4118124f190893be8c7 Mon Sep 17 00:00:00 2001 From: Doug Lauder Date: Tue, 21 Jan 2020 10:48:50 -0500 Subject: [PATCH] MM-21071 (#13564) * replace endpoint `POST server_busy/clear` with the more RESTful idiomatic `DELETE server_busy` to clear the busy flag --- api4/system.go | 2 +- model/client4.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api4/system.go b/api4/system.go index 86b3f8b3d0..f28311d488 100644 --- a/api4/system.go +++ b/api4/system.go @@ -48,7 +48,7 @@ func (api *API) InitSystem() { api.BaseRoutes.ApiRoot.Handle("/server_busy", api.ApiSessionRequired(setServerBusy)).Methods("POST") api.BaseRoutes.ApiRoot.Handle("/server_busy", api.ApiSessionRequired(getServerBusyExpires)).Methods("GET") - api.BaseRoutes.ApiRoot.Handle("/server_busy/clear", api.ApiSessionRequired(clearServerBusy)).Methods("POST") + api.BaseRoutes.ApiRoot.Handle("/server_busy", api.ApiSessionRequired(clearServerBusy)).Methods("DELETE") } func getSystemPing(c *Context, w http.ResponseWriter, r *http.Request) { diff --git a/model/client4.go b/model/client4.go index 31518f3611..0eb2f35ffd 100644 --- a/model/client4.go +++ b/model/client4.go @@ -4684,7 +4684,7 @@ func (c *Client4) SetServerBusy(secs int) (bool, *Response) { // ClearServerBusy will mark the server as not busy. func (c *Client4) ClearServerBusy() (bool, *Response) { - r, err := c.DoApiPost(c.GetServerBusyRoute()+"/clear", "") + r, err := c.DoApiDelete(c.GetServerBusyRoute()) if err != nil { return false, BuildErrorResponse(r, err) }