Skip to content

Commit

Permalink
Redirect headers breakage (#234)
Browse files Browse the repository at this point in the history
* Temporary workaround without knowing the exact cause.

* Improved fix, always clone headers.
  • Loading branch information
kresike authored Jul 22, 2022
1 parent dd2e037 commit c8c6afe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/caddy/httpcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ func (s *SouinCaddyPlugin) ServeHTTP(rw http.ResponseWriter, r *http.Request, ne
return e
}

customWriter.Response.Header = customWriter.Rw.Header().Clone()
combo.req.Response = customWriter.Response

if combo.req.Response, e = s.Retriever.GetTransport().(*rfc.VaryTransport).UpdateCacheEventually(combo.req); e != nil {
return e
}
Expand Down

0 comments on commit c8c6afe

Please sign in to comment.