From 76d69b6e5143cd642a6d3f712f9768cf3a54a48a Mon Sep 17 00:00:00 2001 From: JessonChan Date: Wed, 24 Feb 2016 10:34:20 +0800 Subject: [PATCH] prevent auto detect of content-type https://golang.org/src/net/http/server.go#L1031 --- router.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/router.go b/router.go index 82a602e1..80956bd7 100644 --- a/router.go +++ b/router.go @@ -616,6 +616,8 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request) context.Output.Header("Server", BConfig.ServerName) } + context.Output.Header("Content-Type", "text/html; charset=utf-8") + var urlPath string if !BConfig.RouterCaseSensitive { urlPath = strings.ToLower(r.URL.Path)