forked from forgejo/forgejo
Add support for HEAD requests in Maven registry (#21834)
Related #18543 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
26f941fbda
commit
fc7a2d5a95
19 changed files with 162 additions and 40 deletions
|
@ -103,7 +103,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(),
|
||||
})
|
||||
}
|
||||
|
||||
// DownloadPackageFileByName finds the version and serves the contents of a package
|
||||
|
@ -146,7 +149,10 @@ func DownloadPackageFileByName(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(),
|
||||
})
|
||||
}
|
||||
|
||||
// UploadPackage creates a new package
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue