From 7c8aff0b3087f4226e9ae21f2af892e104bab699 Mon Sep 17 00:00:00 2001 From: odrling Date: Wed, 17 Jul 2024 20:39:48 +0200 Subject: [PATCH] set Expires header on download more informational than anything --- server/files.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/files.go b/server/files.go index 6d16b01..c518ab5 100644 --- a/server/files.go +++ b/server/files.go @@ -166,6 +166,9 @@ func Download(ctx context.Context, input *DownloadInput) (*huma.StreamResponse, ctx.SetHeader("Accept-Range", "bytes") ctx.SetHeader("Content-Disposition", fmt.Sprintf("inline; filename=\"%s\"; filename*=UTF-8''%s", filename, filename)) ctx.SetHeader("Content-Type", content_type) + if stat.Expires.Unix() != 0 { + ctx.SetHeader("Expires", fmt.Sprintf("%d", stat.Expires.Unix())) + } var start int64 var end int64