Refactor cache-control (#33861)

And fix #21391
This commit is contained in:
wxiaoguang authored and GitHub committed 2025-03-13 07:04:50 +08:00
1 parent 91610a987e
commit 3996518ed4
15 files changed
+96 -66

No files matched your search

+2 -2
View File
@@ -83,7 +83,7 @@ func GetRawFile(ctx *context.APIContext) {
ctx.RespHeader().Set(giteaObjectTypeHeader, string(files_service.GetObjectTypeFromTreeEntry(entry)))
if err := common.ServeBlob(ctx.Base, ctx.Repo.TreePath, blob, lastModified); err != nil {
if err := common.ServeBlob(ctx.Base, ctx.Repo.Repository, ctx.Repo.TreePath, blob, lastModified); err != nil {
ctx.APIErrorInternal(err)
}
}
@@ -144,7 +144,7 @@ func GetRawFileOrLFS(ctx *context.APIContext) {
}
// OK not cached - serve!
if err := common.ServeBlob(ctx.Base, ctx.Repo.TreePath, blob, lastModified); err != nil {
if err := common.ServeBlob(ctx.Base, ctx.Repo.Repository, ctx.Repo.TreePath, blob, lastModified); err != nil {
ctx.APIErrorInternal(err)
}
return