@cryptotaxi247 / kubo / commits / aefff4865

fix #2203: omit the charset attribute when Content-Type is text/html

License: MIT Signed-off-by: Abdeldjalil Hebal <dreamski21@gmail.com>

Djalil Dreamski committed Nov 2, 2019 at 21:56 UTC aefff4865471471deb8afd3a7cb59875e921b936
1 file changed +6
core/corehttp/gateway_handler.go
+6
@@ -383,6 +383,12 @@ func (i *gatewayHandler) serveFile(w http.ResponseWriter, req *http.Request, nam
383 }
384 }
385
386 + mime := http.DetectContentType(content)
387 + if strings.HasPrefix(mime, "text/html;") {
388 + mime = "text/html"
389 + }
390 + w.Header().Set("Content-Type", mime)
391 +
392 http.ServeContent(w, req, name, modtime, content)
393 }
394