]> Cypherpunks repositories - gostls13.git/commitdiff
http: set content type for fileserver directory listings
authorRobert Griesemer <gri@golang.org>
Tue, 26 Jul 2011 18:30:11 +0000 (11:30 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 26 Jul 2011 18:30:11 +0000 (11:30 -0700)
R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4815062

src/pkg/http/fs.go

index 4a514beb0b8a0f26ac10f38e8204f29ecd527828..bd5ff8bc68c2da7e949b054a625f11e4f549fb61 100644 (file)
@@ -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, "<pre>\n")
        for {
                dirs, err := f.Readdir(100)