From b2ea3a4f6af1dd30f4ceca43032898b260d6d043 Mon Sep 17 00:00:00 2001 From: kun Date: Mon, 31 Aug 2020 11:03:23 +0800 Subject: [PATCH] Revert "[patch] allow caching it when http response code 302 is got from upstream" This reverts commit 54104351f2c3e85ebabf98fa3921a9f1c736c601. --- proxy/router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/router.go b/proxy/router.go index ed2f18c..fe24361 100644 --- a/proxy/router.go +++ b/proxy/router.go @@ -67,7 +67,7 @@ func NewRouter(srv *Server, opts *RouterOptions) *Router { TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } rt.proxy.ModifyResponse = func(r *http.Response) error { - if r.StatusCode == http.StatusOK || r.StatusCode == http.StatusFound { + if r.StatusCode == http.StatusOK { var buf []byte if strings.Contains(r.Header.Get("Content-Encoding"), "gzip") { gr, err := gzip.NewReader(r.Body)