From cba996978ed89b1bfdba0afa6b98706c3e9d213f Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 12 Nov 2022 00:08:56 +0100 Subject: [PATCH] nit picking of legacy --- server/context/context.go | 4 +--- server/gitea/cache.go | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/server/context/context.go b/server/context/context.go index 6fffa74..6bb599d 100644 --- a/server/context/context.go +++ b/server/context/context.go @@ -2,9 +2,7 @@ package context import ( stdContext "context" - "io" "net/http" - "strings" ) type Context struct { @@ -41,7 +39,7 @@ func (c *Context) String(raw string, status ...int) { code = status[0] } c.RespWriter.WriteHeader(code) - _, _ = io.Copy(c.RespWriter, strings.NewReader(raw)) + c.RespWriter.Write([]byte(raw)) } func (c *Context) IsMethod(m string) bool { diff --git a/server/gitea/cache.go b/server/gitea/cache.go index 248c858..19a7b1f 100644 --- a/server/gitea/cache.go +++ b/server/gitea/cache.go @@ -27,7 +27,7 @@ const ( fileCacheTimeout = 5 * time.Minute // fileCacheSizeLimit limits the maximum file size that will be cached, and is set to 1 MB by default. - fileCacheSizeLimit = int64(1024 * 1024) + fileCacheSizeLimit = int64(1000 * 1000) ) type FileResponse struct {