mirror of
https://github.com/go-gitea/gitea.git
synced 2025-06-23 06:28:01 +02:00
Add support for HEAD requests in Maven registry (#21834)
Related #18543 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@ -426,7 +426,10 @@ func download(ctx *context.Context, archiveName string, archiver *repo_model.Rep
|
||||
}
|
||||
defer fr.Close()
|
||||
|
||||
ctx.ServeContent(downloadName, fr, archiver.CreatedUnix.AsLocalTime())
|
||||
ctx.ServeContent(fr, &context.ServeHeaderOptions{
|
||||
Filename: downloadName,
|
||||
LastModified: archiver.CreatedUnix.AsLocalTime(),
|
||||
})
|
||||
}
|
||||
|
||||
// InitiateDownload will enqueue an archival request, as needed. It may submit
|
||||
|
@ -402,5 +402,8 @@ func DownloadPackageFile(ctx *context.Context) {
|
||||
}
|
||||
defer s.Close()
|
||||
|
||||
ctx.ServeContent(pf.Name, s, pf.CreatedUnix.AsLocalTime())
|
||||
ctx.ServeContent(s, &context.ServeHeaderOptions{
|
||||
Filename: pf.Name,
|
||||
LastModified: pf.CreatedUnix.AsLocalTime(),
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user