Skip to content

Commit

Permalink
[patch] allow caching it when http response code 302 is got from upst…
Browse files Browse the repository at this point in the history
…ream
  • Loading branch information
Sammy Huang authored and oiooj committed Jul 15, 2020
1 parent ead1140 commit 5410435
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proxy/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5410435

Please sign in to comment.