From edd3bd1c49e7f6ea56d6eecc75fded77c31acf4a Mon Sep 17 00:00:00 2001 From: Naman Sood Date: Sat, 20 Mar 2021 18:07:11 -0400 Subject: [PATCH] errorCatcher: set Content-Type authoritatively Signed-off-by: Naman Sood --- errorCatcher.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/errorCatcher.go b/errorCatcher.go index 495fe9e..fda356b 100644 --- a/errorCatcher.go +++ b/errorCatcher.go @@ -45,7 +45,7 @@ func (ec *errorCatcher) WriteHeader(statusCode int) { if err != nil { return } - ec.res.Header().Add("content-type", "text/html") + ec.res.Header().Set("Content-Type", "text/html; charset=utf-8") ec.res.WriteHeader(statusCode) ec.res.Write([]byte(page)) ec.handledError = true @@ -63,7 +63,7 @@ func (ec *errorCatcher) WriteHeader(statusCode int) { if err != nil { return } - ec.res.Header().Add("content-type", "text/html") + ec.res.Header().Set("Content-Type", "text/html; charset=utf-8") ec.res.WriteHeader(statusCode) ec.res.Write([]byte(page)) ec.handledError = true