Content-Type header is not set according to context.Response
sboschman opened this issue · 0 comments
sboschman commented
Created a new context.Response with content-type 'text/css', but the content-type header emitted is 'text/plain'. Which results in the browser ignoring the file as a stylesheet.
func StyleSheet(req *context.Request) thinkgo.Response {
data := map[string]interface{}{}
rsp := thinkgo.Render("common.css", data)
rsp.SetContentType("text/css")
return rsp
}
curl:
< HTTP/1.1 200 OK
< Date: Tue, 15 Jan 2019 16:29:00 GMT
< Content-Type: text/plain; charset=utf-8
< Transfer-Encoding: chunked