1
0
Fork 0
forked from forgejo/forgejo

Add support for HEAD requests in Maven registry (#21834) (#21929)

Backport of #21834

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
KN4CK3R 2022-11-25 12:46:28 +01:00 committed by GitHub
parent 9ba4ef93ff
commit ff4e292b3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 162 additions and 40 deletions

View file

@ -95,7 +95,10 @@ 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(),
})
}
// UploadPackageFile adds a file to the package. If the package does not exist, it gets created.