mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
REST API: remove status from ApiResponse
it duplicates the header HTTP status
This commit is contained in:
@@ -67,9 +67,8 @@ func sendAPIResponse(w http.ResponseWriter, r *http.Request, err error, message
|
||||
errorString = err.Error()
|
||||
}
|
||||
resp := apiResponse{
|
||||
Error: errorString,
|
||||
Message: message,
|
||||
HTTPStatus: code,
|
||||
Error: errorString,
|
||||
Message: message,
|
||||
}
|
||||
ctx := context.WithValue(r.Context(), render.StatusCtxKey, code)
|
||||
render.JSON(w, r.WithContext(ctx), resp)
|
||||
|
||||
Reference in New Issue
Block a user