From 7ae6f6fa3eaaa503049caa07508c44adfe33ff60 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 6 Nov 2019 11:47:27 +0000 Subject: [PATCH] chore(gateway): document encoding fix --- core/corehttp/gateway_handler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index 07d0c59e1..c67b56ad0 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -395,6 +395,10 @@ func (i *gatewayHandler) serveFile(w http.ResponseWriter, req *http.Request, nam return } } + // Strip the encoding from the HTML Content-Type header and let the + // browser figure it out. + // + // Fixes https://github.com/ipfs/go-ipfs/issues/2203 if strings.HasPrefix(ctype, "text/html;") { ctype = "text/html" }