diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-11-24 15:25:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-24 16:25:13 +0200 |
commit | fc7a2d5a959334f7195571a3e1db669ed7667a28 (patch) | |
tree | e03df232ebc29e508680686c396cfecb4eeb0902 /routers/api/v1/repo/file.go | |
parent | 26f941fbdac73844a93c902ce6d1144175ff23ed (diff) | |
download | gitea-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/v1/repo/file.go')
-rw-r--r-- | routers/api/v1/repo/file.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/api/v1/repo/file.go b/routers/api/v1/repo/file.go index 6dead81e6d..aba5b1f9e7 100644 --- a/routers/api/v1/repo/file.go +++ b/routers/api/v1/repo/file.go @@ -341,7 +341,11 @@ func download(ctx *context.APIContext, archiveName string, archiver *repo_model. return } defer fr.Close() - ctx.ServeContent(downloadName, fr, archiver.CreatedUnix.AsLocalTime()) + + ctx.ServeContent(fr, &context.ServeHeaderOptions{ + Filename: downloadName, + LastModified: archiver.CreatedUnix.AsLocalTime(), + }) } // GetEditorconfig get editor config of a repository |