From: Robert Griesemer Date: Tue, 26 Jul 2011 18:30:11 +0000 (-0700) Subject: http: set content type for fileserver directory listings X-Git-Tag: weekly.2011-07-29~48 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e21f69338b64f81d40af42dbb1ce1ee5e23309f8;p=gostls13.git http: set content type for fileserver directory listings R=bradfitz, rsc CC=golang-dev https://golang.org/cl/4815062 --- diff --git a/src/pkg/http/fs.go b/src/pkg/http/fs.go index 4a514beb0b..bd5ff8bc68 100644 --- a/src/pkg/http/fs.go +++ b/src/pkg/http/fs.go @@ -78,6 +78,7 @@ func isText(b []byte) bool { } func dirList(w ResponseWriter, f File) { + w.Header().Set("Content-Type", "text/html; charset=utf-8") fmt.Fprintf(w, "
\n")
 	for {
 		dirs, err := f.Readdir(100)