Fixed a bug where Japanese text wouldn't work properly with Gzip.
This commit is contained in:
parent
90114fae9e
commit
80f103a3d3
|
@ -661,7 +661,7 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
// Disable Gzip when SSL is disabled for security reasons?
|
// Disable Gzip when SSL is disabled for security reasons?
|
||||||
if prefix != "/ws" && strings.Contains(req.Header.Get("Accept-Encoding"), "gzip") {
|
if prefix != "/ws" && strings.Contains(req.Header.Get("Accept-Encoding"), "gzip") {
|
||||||
w.Header().Set("Content-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)
|
gz := gzip.NewWriter(w)
|
||||||
defer func() {
|
defer func() {
|
||||||
if w.Header().Get("Content-Encoding") == "gzip" {
|
if w.Header().Get("Content-Encoding") == "gzip" {
|
||||||
|
|
Loading…
Reference in New Issue