mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-10 12:49:52 +01:00
fix go1.15 lint error in modules/public/public.go (#12707)
Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
parent
f083bd70df
commit
d7456106bf
1 changed files with 1 additions and 1 deletions
|
@ -159,7 +159,7 @@ func (opts *Options) handle(ctx *macaron.Context, log *log.Logger, opt *Options)
|
||||||
// Add an Expires header to the static content
|
// Add an Expires header to the static content
|
||||||
if opt.ExpiresAfter > 0 {
|
if opt.ExpiresAfter > 0 {
|
||||||
ctx.Resp.Header().Set("Expires", time.Now().Add(opt.ExpiresAfter).UTC().Format(http.TimeFormat))
|
ctx.Resp.Header().Set("Expires", time.Now().Add(opt.ExpiresAfter).UTC().Format(http.TimeFormat))
|
||||||
tag := GenerateETag(fmt.Sprintf("%d", fi.Size()), fi.Name(), fi.ModTime().UTC().Format(http.TimeFormat))
|
tag := GenerateETag(fmt.Sprint(fi.Size()), fi.Name(), fi.ModTime().UTC().Format(http.TimeFormat))
|
||||||
ctx.Resp.Header().Set("ETag", tag)
|
ctx.Resp.Header().Set("ETag", tag)
|
||||||
if ctx.Req.Header.Get("If-None-Match") == tag {
|
if ctx.Req.Header.Get("If-None-Match") == tag {
|
||||||
ctx.Resp.WriteHeader(304)
|
ctx.Resp.WriteHeader(304)
|
||||||
|
|
Loading…
Reference in a new issue