mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-24 19:09:57 +08:00
use the Get/Set function of Header
This commit is contained in:
parent
1e88466d23
commit
52235568e0
@ -28,7 +28,7 @@ var (
|
|||||||
|
|
||||||
func writeContentType(w http.ResponseWriter, value []string) {
|
func writeContentType(w http.ResponseWriter, value []string) {
|
||||||
header := w.Header()
|
header := w.Header()
|
||||||
if val := header["Content-Type"]; len(val) == 0 {
|
if header.Get("Content-Type") == "" {
|
||||||
header["Content-Type"] = value
|
header.Set("Content-Type", value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user