Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content-Type header is not set according to context.Response #2

Closed
sboschman opened this issue Jan 15, 2019 · 0 comments
Closed

Content-Type header is not set according to context.Response #2

sboschman opened this issue Jan 15, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@sboschman
Copy link
Contributor

sboschman commented Jan 15, 2019

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants