mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 16:32:31 +01:00
fix (caching): obey to the no-cache http header
This commit is contained in:
parent
1f14bd94ae
commit
6a1a6507d9
1 changed files with 1 additions and 1 deletions
|
|
@ -402,7 +402,7 @@ func ServeBundle() func(*App, http.ResponseWriter, *http.Request) {
|
||||||
|
|
||||||
return func(ctx *App, res http.ResponseWriter, req *http.Request) {
|
return func(ctx *App, res http.ResponseWriter, req *http.Request) {
|
||||||
res.Header().Set("Content-Type", "application/javascript")
|
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.Header().Set("Content-Encoding", "br")
|
||||||
res.Write(bundleBr)
|
res.Write(bundleBr)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue