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

pull/156/head v2.0.3
Sammy Huang 2020-07-14 09:40:51 +08:00 committed by kun
parent ead1140c92
commit 54104351f2
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 {
if r.StatusCode == http.StatusOK || r.StatusCode == http.StatusFound {
var buf []byte
if strings.Contains(r.Header.Get("Content-Encoding"), "gzip") {
gr, err := gzip.NewReader(r.Body)