From 80f103a3d38d1904483905d1eaefd5f9f60a0fee Mon Sep 17 00:00:00 2001 From: Azareal Date: Wed, 22 Aug 2018 21:02:50 +1000 Subject: [PATCH] Fixed a bug where Japanese text wouldn't work properly with Gzip. --- router_gen/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/router_gen/main.go b/router_gen/main.go index 0eb3660b..25b2da88 100644 --- a/router_gen/main.go +++ b/router_gen/main.go @@ -661,7 +661,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) { // Disable Gzip when SSL is disabled for security reasons? if prefix != "/ws" && strings.Contains(req.Header.Get("Accept-Encoding"), "gzip") { w.Header().Set("Content-Encoding", "gzip") - w.Header().Set("Content-Type", "text/html") + w.Header().Set("Content-Type", "text/html; charset=utf-8") gz := gzip.NewWriter(w) defer func() { if w.Header().Get("Content-Encoding") == "gzip" {