mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
log JSON response if httpStatus >= 400
This commit is contained in:
parent
73264b952b
commit
41cab5d69f
|
@ -46,6 +46,12 @@ func writeJson(w http.ResponseWriter, r *http.Request, httpStatus int, obj inter
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if httpStatus >= 400 {
|
||||||
|
glog.V(0).Infof("response method:%s URL:%s with httpStatus:%d and JSON:%s",
|
||||||
|
r.Method, r.URL.String(), httpStatus, string(bytes))
|
||||||
|
}
|
||||||
|
|
||||||
callback := r.FormValue("callback")
|
callback := r.FormValue("callback")
|
||||||
if callback == "" {
|
if callback == "" {
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
|
Loading…
Reference in a new issue