set content-type to json before writing response
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Adrien Marquès 2020-03-22 14:05:47 +01:00
parent ad6de97979
commit d57f60c710
Signed by: xdrm-brackets
GPG Key ID: D75243CA236D825E
1 changed files with 1 additions and 0 deletions

View File

@ -97,6 +97,7 @@ func (server httpServer) ServeHTTP(res http.ResponseWriter, req *http.Request) {
foundHandler.Handle(*apireq, response)
// 11. apply headers
res.Header().Set("Content-Type", "application/json; charset=utf-8")
for key, values := range response.Headers {
for _, value := range values {
res.Header().Add(key, value)