From 4fc499eefd0e4af3066259078cde138f2405b406 Mon Sep 17 00:00:00 2001 From: zyd Date: Mon, 6 Jul 2020 18:44:46 +0800 Subject: [PATCH] update --- src/handler/proxyhandler.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/handler/proxyhandler.go b/src/handler/proxyhandler.go index 23d9689..aff263d 100644 --- a/src/handler/proxyhandler.go +++ b/src/handler/proxyhandler.go @@ -145,11 +145,13 @@ func Return(res interface{}, err error, Resp *http.Response) { } } else { - if Resp.Header.Get("Content-Encoding") == "gzip" { - b = []byte(err.Error()) - b = gzipCompress(&b) - } + Resp.Header.Set("Content-Encoding", "utf-8") + b = []byte(err.Error()) } + //if Resp.Header.Get("Content-Encoding") == "gzip" { + //Resp.Header.Set("Content-Encoding","gzip") + //b = gzipCompress(&b) + //} Resp.Header.Set("X-Log-By", "Apaas") Resp.Header.Set("Content-Length", strconv.Itoa(len(b))) Resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) -- 2.26.0