mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-24 02:32:17 +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) {
|
||||
header := w.Header()
|
||||
if val := header["Content-Type"]; len(val) == 0 {
|
||||
header["Content-Type"] = value
|
||||
if header.Get("Content-Type") == "" {
|
||||
header.Set("Content-Type", value)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user