don't set Content-Type if exists

This commit is contained in:
lidashuang 2015-03-19 23:01:35 +08:00
parent 5857ddcd2c
commit d66ef6e337

View File

@ -54,7 +54,9 @@ var (
)
func writeHeader(w http.ResponseWriter, code int, contentType string) {
if w.Header().Get("Content-Type") == "" {
w.Header().Set("Content-Type", contentType+"; charset=utf-8")
}
w.WriteHeader(code)
}