aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/packages/pypi
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-11-24 15:25:13 +0100
committerGitHub <noreply@github.com>2022-11-24 16:25:13 +0200
commitfc7a2d5a959334f7195571a3e1db669ed7667a28 (patch)
treee03df232ebc29e508680686c396cfecb4eeb0902 /routers/api/packages/pypi
parent26f941fbdac73844a93c902ce6d1144175ff23ed (diff)
downloadgitea-fc7a2d5a959334f7195571a3e1db669ed7667a28.tar.gz
gitea-fc7a2d5a959334f7195571a3e1db669ed7667a28.zip
Add support for HEAD requests in Maven registry (#21834)
Related #18543 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'routers/api/packages/pypi')
-rw-r--r--routers/api/packages/pypi/pypi.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/routers/api/packages/pypi/pypi.go b/routers/api/packages/pypi/pypi.go
index 4853e6658b..76801a92e1 100644
--- a/routers/api/packages/pypi/pypi.go
+++ b/routers/api/packages/pypi/pypi.go
@@ -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.