mirror of
https://github.com/golang/go
synced 2024-11-25 06:07:58 -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:
parent
12a5774cde
commit
e21f69338b
@ -78,6 +78,7 @@ func isText(b []byte) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func dirList(w ResponseWriter, f File) {
|
func dirList(w ResponseWriter, f File) {
|
||||||
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
fmt.Fprintf(w, "<pre>\n")
|
fmt.Fprintf(w, "<pre>\n")
|
||||||
for {
|
for {
|
||||||
dirs, err := f.Readdir(100)
|
dirs, err := f.Readdir(100)
|
||||||
|
Loading…
Reference in New Issue
Block a user