From e21f69338b64f81d40af42dbb1ce1ee5e23309f8 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 26 Jul 2011 11:30:11 -0700 Subject: [PATCH] http: set content type for fileserver directory listings R=bradfitz, rsc CC=golang-dev https://golang.org/cl/4815062 --- src/pkg/http/fs.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pkg/http/fs.go b/src/pkg/http/fs.go index 4a514beb0b8..bd5ff8bc68c 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)