mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-27 19:53:41 +08:00
fix (caching): obey to the no-cache http header
This commit is contained in:
@ -402,7 +402,7 @@ func ServeBundle() func(*App, http.ResponseWriter, *http.Request) {
|
||||
|
||||
return func(ctx *App, res http.ResponseWriter, req *http.Request) {
|
||||
res.Header().Set("Content-Type", "application/javascript")
|
||||
if strings.Contains(req.Header.Get("Accept-Encoding"), "br") {
|
||||
if strings.Contains(req.Header.Get("Accept-Encoding"), "br") && req.Header.Get("Cache-Control") != "no-cache" {
|
||||
res.Header().Set("Content-Encoding", "br")
|
||||
res.Write(bundleBr)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user