Codebase list golang-github-go-kit-kit / f0a3942
Write Content-Type header on error Marcus Olsson 8 years ago
2 changed file(s) with 2 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
193193 default:
194194 w.WriteHeader(http.StatusInternalServerError)
195195 }
196 w.Header().Set("Content-Type", "application/json; charset=utf-8")
196197 json.NewEncoder(w).Encode(map[string]interface{}{
197198 "error": err.Error(),
198199 })
9292 default:
9393 w.WriteHeader(http.StatusInternalServerError)
9494 }
95 w.Header().Set("Content-Type", "application/json; charset=utf-8")
9596 json.NewEncoder(w).Encode(map[string]interface{}{
9697 "error": err.Error(),
9798 })