1
0
mirror of https://github.com/golang/go synced 2024-11-22 02:14:40 -07:00

http: set content type for fileserver directory listings

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4815062
This commit is contained in:
Robert Griesemer 2011-07-26 11:30:11 -07:00
parent 12a5774cde
commit e21f69338b

View 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)