This commit is contained in:
cangui 2025-07-27 16:55:26 +02:00
parent d3b27eec01
commit e959ec8721

View File

@ -69,6 +69,12 @@ func folderRoute (superRoute *gin.RouterGroup,db *gorm.DB){
folderRoutes.GET("/file", middlewares.CheckAuth(db), func(c *gin.Context) { folderRoutes.GET("/file", middlewares.CheckAuth(db), func(c *gin.Context) {
path := c.Query("path") path := c.Query("path")
filePath := filepath.Join("upload", filepath.Clean("/"+path)) filePath := filepath.Join("upload", filepath.Clean("/"+path))
c.Header("Cache-Control", "no-cache, no-store, must-revalidate")
c.Header("Pragma", "no-cache")
c.Header("Expires", "0")
// Supprime le support de "If-Modified-Since" pour forcer le 200
c.Request.Header.Del("If-Modified-Since")
ext := strings.ToLower(filepath.Ext(filePath)) ext := strings.ToLower(filepath.Ext(filePath))
if ext == ".mp4" || ext == ".mkv" || ext == ".webm" || ext == ".mp3" { if ext == ".mp4" || ext == ".mkv" || ext == ".webm" || ext == ".mp3" {