Merge pull request #708 from runzexia/change-status-code
api do not return 401
This commit is contained in:
@@ -177,6 +177,9 @@ func Validate(req *restful.Request, resp *restful.Response) {
|
||||
}
|
||||
|
||||
resp.Header().Set(restful.HEADER_ContentType, restful.MIME_JSON)
|
||||
if resp.StatusCode() == http.StatusUnauthorized {
|
||||
resp.WriteHeader(http.StatusPreconditionRequired)
|
||||
}
|
||||
resp.Write(res)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user