1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-25 19:58:36 +00:00

Redirect to a presigned URL of HEAD for HEAD requests (#35088)

Resolves https://github.com/go-gitea/gitea/issues/35086.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Risu
2025-07-16 21:22:45 +10:00
committed by GitHub
parent 0d00ec7eed
commit e1e4815a1c
42 changed files with 85 additions and 72 deletions

View File

@@ -75,6 +75,7 @@ func GetRepositoryFile(ctx *context.Context) {
Filename: alpine_service.IndexArchiveFilename,
CompositeKey: fmt.Sprintf("%s|%s|%s", ctx.PathParam("branch"), ctx.PathParam("repository"), ctx.PathParam("architecture")),
},
ctx.Req.Method,
)
if err != nil {
if errors.Is(err, util.ErrNotExist) {
@@ -216,7 +217,7 @@ func DownloadPackageFile(ctx *context.Context) {
}
}
s, u, pf, err := packages_service.OpenFileForDownload(ctx, pfs[0])
s, u, pf, err := packages_service.OpenFileForDownload(ctx, pfs[0], ctx.Req.Method)
if err != nil {
if errors.Is(err, util.ErrNotExist) {
apiError(ctx, http.StatusNotFound, err)