Merge pull request #53 from aszxqw/master

fix bug: 'http: multiple response.WriteHeader calls'
This commit is contained in:
chrislusf 2015-01-08 06:59:30 -08:00
commit ab20cf8197
2 changed files with 2 additions and 1 deletions

2
.gitignore vendored
View file

@ -1 +1,3 @@
weed weed
tags
*.swp

View file

@ -65,7 +65,6 @@ func writeJsonQuiet(w http.ResponseWriter, r *http.Request, httpStatus int, obj
} }
} }
func writeJsonError(w http.ResponseWriter, r *http.Request, httpStatus int, err error) { func writeJsonError(w http.ResponseWriter, r *http.Request, httpStatus int, err error) {
w.WriteHeader(http.StatusInternalServerError)
m := make(map[string]interface{}) m := make(map[string]interface{})
m["error"] = err.Error() m["error"] = err.Error()
writeJsonQuiet(w, r, httpStatus, m) writeJsonQuiet(w, r, httpStatus, m)