mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-14 20:22:20 +08:00
don't set Content-Type if exists
This commit is contained in:
parent
5857ddcd2c
commit
d66ef6e337
@ -54,7 +54,9 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func writeHeader(w http.ResponseWriter, code int, contentType string) {
|
func writeHeader(w http.ResponseWriter, code int, contentType string) {
|
||||||
w.Header().Set("Content-Type", contentType+"; charset=utf-8")
|
if w.Header().Get("Content-Type") == "" {
|
||||||
|
w.Header().Set("Content-Type", contentType+"; charset=utf-8")
|
||||||
|
}
|
||||||
w.WriteHeader(code)
|
w.WriteHeader(code)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user