mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-24 06:14:04 +08:00
fix: disable cache for 302 redirect (close #2216)
This commit is contained in:
parent
f0a533a77a
commit
18cd45d257
@ -37,6 +37,7 @@ func Down(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
c.Header("Referrer-Policy", "no-referrer")
|
||||
c.Header("Cache-Control", "max-age=0, no-cache, no-store, must-revalidate")
|
||||
c.Redirect(302, link.URL)
|
||||
}
|
||||
}
|
||||
|
@ -232,6 +232,7 @@ func (h *Handler) handleGetHeadPost(w http.ResponseWriter, r *http.Request) (sta
|
||||
common.GetApiUrl(r),
|
||||
utils.EncodePath(reqPath, true),
|
||||
sign.Sign(path.Base(reqPath)))
|
||||
w.Header().Set("Cache-Control", "max-age=0, no-cache, no-store, must-revalidate")
|
||||
http.Redirect(w, r, u, 302)
|
||||
} else {
|
||||
link, _, err := fs.Link(ctx, reqPath, model.LinkArgs{IP: utils.ClientIP(r)})
|
||||
|
Loading…
x
Reference in New Issue
Block a user