From 3b264d7282ba956acc9c629199e0e3dadb5ebc91 Mon Sep 17 00:00:00 2001 From: XOF Date: Mon, 15 Dec 2025 03:44:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20proxy/handler.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- proxy/handler.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/proxy/handler.go b/proxy/handler.go index f14c94d..6598ac9 100644 --- a/proxy/handler.go +++ b/proxy/handler.go @@ -158,8 +158,9 @@ func (h *ProxyHandler) rewriteContent(body []byte, targetURL, contentType string func (h *ProxyHandler) readResponseBody(resp *http.Response) ([]byte, error) { var reader io.Reader = resp.Body - // 处理 gzip 压缩 - if resp.Header.Get("Content-Encoding") == "gzip" { + // 处理各种压缩格式 + encoding := strings.ToLower(resp.Header.Get("Content-Encoding")) + if strings.Contains(encoding, "gzip") { gzReader, err := gzip.NewReader(resp.Body) if err != nil { return nil, err