up
This commit is contained in:
parent
d3b27eec01
commit
e959ec8721
@ -69,6 +69,12 @@ func folderRoute (superRoute *gin.RouterGroup,db *gorm.DB){
|
||||
folderRoutes.GET("/file", middlewares.CheckAuth(db), func(c *gin.Context) {
|
||||
path := c.Query("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))
|
||||
if ext == ".mp4" || ext == ".mkv" || ext == ".webm" || ext == ".mp3" {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user