From fc7a2d5a959334f7195571a3e1db669ed7667a28 Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Thu, 24 Nov 2022 15:25:13 +0100 Subject: Add support for HEAD requests in Maven registry (#21834) Related #18543 Co-authored-by: Lunny Xiao --- routers/api/v1/repo/file.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'routers/api/v1/repo') 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 -- cgit v1.2.3