Browse Source

Merge pull request #1884 from kostya-sh/patch-1

go-raw: add missing charset=utf-8 to fortune content type
Mike Smith 9 years ago
parent
commit
ad3da48f81
1 changed files with 2 additions and 2 deletions
  1. 2 2
      frameworks/Go/go-raw/src/hello/hello.go

+ 2 - 2
frameworks/Go/go-raw/src/hello/hello.go

@@ -280,7 +280,7 @@ func fortuneHandler(w http.ResponseWriter, r *http.Request) {
 
 	sort.Sort(ByMessage{fortunes})
 	w.Header().Set("Server", "Go")
-	w.Header().Set("Content-Type", "text/html")
+	w.Header().Set("Content-Type", "text/html; charset=utf-8")
 	if err := tmpl.Execute(w, fortunes); err != nil {
 		http.Error(w, err.Error(), http.StatusInternalServerError)
 	}
@@ -297,7 +297,7 @@ func fortuneInterpolateHandler(w http.ResponseWriter, r *http.Request) {
 
 	sort.Sort(ByMessage{fortunes})
 	w.Header().Set("Server", "Go")
-	w.Header().Set("Content-Type", "text/html")
+	w.Header().Set("Content-Type", "text/html; charset=utf-8")
 	if err := tmpl.Execute(w, fortunes); err != nil {
 		http.Error(w, err.Error(), http.StatusInternalServerError)
 	}