mirror of
https://github.com/ipfs/kubo.git
synced 2025-08-06 11:31:54 +08:00
fix #2203: omit the charset attribute when Content-Type is text/html
License: MIT Signed-off-by: Abdeldjalil Hebal <dreamski21@gmail.com>
This commit is contained in:
@ -383,6 +383,12 @@ func (i *gatewayHandler) serveFile(w http.ResponseWriter, req *http.Request, nam
|
||||
}
|
||||
}
|
||||
|
||||
mime := http.DetectContentType(content)
|
||||
if strings.HasPrefix(mime, "text/html;") {
|
||||
mime = "text/html"
|
||||
}
|
||||
w.Header().Set("Content-Type", mime)
|
||||
|
||||
http.ServeContent(w, req, name, modtime, content)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user