set content-type to json before writing response
This commit is contained in:
parent
ad6de97979
commit
d57f60c710
1
http.go
1
http.go
|
@ -97,6 +97,7 @@ func (server httpServer) ServeHTTP(res http.ResponseWriter, req *http.Request) {
|
||||||
foundHandler.Handle(*apireq, response)
|
foundHandler.Handle(*apireq, response)
|
||||||
|
|
||||||
// 11. apply headers
|
// 11. apply headers
|
||||||
|
res.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||||
for key, values := range response.Headers {
|
for key, values := range response.Headers {
|
||||||
for _, value := range values {
|
for _, value := range values {
|
||||||
res.Header().Add(key, value)
|
res.Header().Add(key, value)
|
||||||
|
|
Loading…
Reference in New Issue