diff options
Diffstat (limited to 'routers/web/repo/githttp.go')
-rw-r--r-- | routers/web/repo/githttp.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/web/repo/githttp.go b/routers/web/repo/githttp.go index bb85df1a86..ee1ec1fd0c 100644 --- a/routers/web/repo/githttp.go +++ b/routers/web/repo/githttp.go @@ -395,7 +395,8 @@ func (h *serviceHandler) sendFile(ctx *context.Context, contentType, file string ctx.Resp.Header().Set("Content-Type", contentType) ctx.Resp.Header().Set("Content-Length", fmt.Sprintf("%d", fi.Size())) - ctx.Resp.Header().Set("Last-Modified", fi.ModTime().Format(http.TimeFormat)) + // http.TimeFormat required a UTC time, refer to https://pkg.go.dev/net/http#TimeFormat + ctx.Resp.Header().Set("Last-Modified", fi.ModTime().UTC().Format(http.TimeFormat)) http.ServeFile(ctx.Resp, ctx.Req, reqFile) } |