This commit is contained in:
6543 2022-11-12 00:06:34 +01:00
parent f635c21c64
commit b759aaf673
No known key found for this signature in database
GPG key ID: B8BE6D610E61C862

View file

@ -1,7 +1,6 @@
package html package html
import ( import (
"io"
"net/http" "net/http"
"strconv" "strconv"
"strings" "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)) 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 { func errorMessage(statusCode int) string {