From b759aaf67331965ac4515b23a0d50e2b9bed848d Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 12 Nov 2022 00:06:34 +0100 Subject: [PATCH] nit --- html/error.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/html/error.go b/html/error.go index a1537e1..33b24c8 100644 --- a/html/error.go +++ b/html/error.go @@ -1,7 +1,6 @@ package html import ( - "io" "net/http" "strconv" "strings" @@ -22,7 +21,7 @@ func ReturnErrorPage(ctx *context.Context, msg string, statusCode int) { msg = strings.ReplaceAll(strings.ReplaceAll(ErrorPage, "%message%", msg), "%status%", http.StatusText(statusCode)) } - _, _ = io.Copy(ctx.RespWriter, strings.NewReader(msg)) + ctx.RespWriter.Write([]byte(msg)) } func errorMessage(statusCode int) string {