diff options
author | techknowlogick <techknowlogick@gitea.io> | 2020-08-13 10:11:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-13 10:11:24 -0400 |
commit | bd7d6a3d736a3d9781ef3b243a8e18e93f632955 (patch) | |
tree | 264e0fdd3e5bfd2bc8547d7104acfe7af6d1c2cc /modules/public | |
parent | e01bac84047baf8b0014116715c630375ea42377 (diff) | |
download | gitea-bd7d6a3d736a3d9781ef3b243a8e18e93f632955.tar.gz gitea-bd7d6a3d736a3d9781ef3b243a8e18e93f632955.zip |
go1.15 (#12475)
* go1.15
* update makefile xgo version
* fix vet issue
* update docs to version of go in use
* add TODO for asyncpreemptoff
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules/public')
-rw-r--r-- | modules/public/public.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/public/public.go b/modules/public/public.go index 9532c9b366..008fba9b01 100644 --- a/modules/public/public.go +++ b/modules/public/public.go @@ -6,6 +6,7 @@ package public import ( "encoding/base64" + "fmt" "log" "net/http" "path" @@ -158,7 +159,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.Sprintf("%d", 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) |