From d57f60c710f51f77b2ed1a135625ef1c14797536 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 22 Mar 2020 14:05:47 +0100 Subject: [PATCH] set content-type to json before writing response --- http.go | 1 + 1 file changed, 1 insertion(+) diff --git a/http.go b/http.go index 722be73..9c0914e 100644 --- a/http.go +++ b/http.go @@ -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)