Write Content-Type header on error
Marcus Olsson
7 years ago
193 | 193 |
default:
|
194 | 194 |
w.WriteHeader(http.StatusInternalServerError)
|
195 | 195 |
}
|
|
196 |
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
196 | 197 |
json.NewEncoder(w).Encode(map[string]interface{}{
|
197 | 198 |
"error": err.Error(),
|
198 | 199 |
})
|
92 | 92 |
default:
|
93 | 93 |
w.WriteHeader(http.StatusInternalServerError)
|
94 | 94 |
}
|
|
95 |
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
95 | 96 |
json.NewEncoder(w).Encode(map[string]interface{}{
|
96 | 97 |
"error": err.Error(),
|
97 | 98 |
})
|