Revert "[patch] allow caching it when http response code 302 is got from upstream"

This reverts commit 54104351f2.
pull/157/head v2.0.4
kun 2020-08-31 11:03:23 +08:00
parent 54104351f2
commit 2c71c26191
1 changed files with 1 additions and 1 deletions

View File

@ -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)