mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Fix: cache-control header in thumb redirect request
This commit is contained in:
@@ -3,6 +3,7 @@ package controllers
|
||||
import "C"
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
model "github.com/HFO4/cloudreve/models"
|
||||
"github.com/HFO4/cloudreve/pkg/filesystem"
|
||||
"github.com/HFO4/cloudreve/pkg/filesystem/driver/local"
|
||||
@@ -126,6 +127,7 @@ func Thumb(c *gin.Context) {
|
||||
}
|
||||
|
||||
if resp.Redirect {
|
||||
c.Header("Cache-Control", fmt.Sprintf("max-age=%d", resp.MaxAge))
|
||||
c.Redirect(http.StatusMovedPermanently, resp.URL)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user