Skip to content

Commit

Permalink
set Expires header on download
Browse files Browse the repository at this point in the history
more informational than anything
  • Loading branch information
odrling committed Jul 17, 2024
1 parent f8ba4ea commit 7c8aff0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7c8aff0

Please sign in to comment.