Skip to content

Commit

Permalink
[Backport] Fix go1.15 lint error in modules/public/public.go (#12707) (
Browse files Browse the repository at this point in the history
…#12708)

* fix go1.15 lint error in modules/public/public.go

* CI.restart()
  • Loading branch information
6543 authored Sep 4, 2020
1 parent 8a51c48 commit 2806a31
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/public/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package public

import (
"encoding/base64"
"fmt"
"log"
"net/http"
"path"
Expand Down Expand Up @@ -159,7 +160,7 @@ func (opts *Options) handle(ctx *macaron.Context, log *log.Logger, opt *Options)
// Add an Expires header to the static content
if opt.ExpiresAfter > 0 {
ctx.Resp.Header().Set("Expires", time.Now().Add(opt.ExpiresAfter).UTC().Format(http.TimeFormat))
tag := GenerateETag(string(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)
if ctx.Req.Header.Get("If-None-Match") == tag {
ctx.Resp.WriteHeader(304)
Expand Down

0 comments on commit 2806a31

Please sign in to comment.