errorCatcher: set Content-Type authoritatively

Signed-off-by: Naman Sood <mail@nsood.in>
This commit is contained in:
Naman Sood 2021-03-20 18:07:11 -04:00
parent 809186ec09
commit edd3bd1c49

View file

@ -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