mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-25 14:42:52 +00:00
Modify returned json message (#543)
This commit is contained in:
@@ -934,7 +934,7 @@ func uploadAjaxCB(rsp http.ResponseWriter, r *http.Request) *appError {
|
|||||||
func formatJSONError(rsp http.ResponseWriter, err *appError) {
|
func formatJSONError(rsp http.ResponseWriter, err *appError) {
|
||||||
if err.Message != "" {
|
if err.Message != "" {
|
||||||
rsp.Header().Set("Content-Type", "application/json; charset=utf-8")
|
rsp.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||||
err.Message = fmt.Sprintf("\"error\": \"%s\"", err.Message)
|
err.Message = fmt.Sprintf("{\"error\": \"%s\"}", err.Message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user