From bd7d6a3d736a3d9781ef3b243a8e18e93f632955 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Thu, 13 Aug 2020 10:11:24 -0400 Subject: 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 --- modules/git/command.go | 1 + modules/public/public.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/git/command.go b/modules/git/command.go index 14fab4ef3c..1496b0186e 100644 --- a/modules/git/command.go +++ b/modules/git/command.go @@ -129,6 +129,7 @@ func (c *Command) RunInDirTimeoutEnvFullPipelineFunc(env []string, timeout time. cmd.Env = append(cmd.Env, fmt.Sprintf("LC_ALL=%s", DefaultLocale)) } + // TODO: verify if this is still needed in golang 1.15 cmd.Env = append(cmd.Env, "GODEBUG=asyncpreemptoff=1") cmd.Dir = dir cmd.Stdout = stdout 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) -- cgit v1.2.3