Caddy plugin, can't set Content-Type of HTTP response

It looks like

log.Println("Content-Type must be application/json")
w.Header().Set("Content-Type", "application/json")

the message is printed still the output has content type text/plain charset=utf8. What can be wrong?

It was my fault, sorry for the noise.

I did everything in Go except HTTP services and didn’t know Header().Set(...) must precede WriteHeader


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.