]> Cypherpunks repositories - gostls13.git/commitdiff
http: fix FileServer's default text content type
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 22 Apr 2011 16:09:37 +0000 (09:09 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 22 Apr 2011 16:09:37 +0000 (09:09 -0700)
Fixes #1729

R=rsc, adg
CC=golang-dev
https://golang.org/cl/4443057

src/pkg/http/fs.go
src/pkg/http/fs_test.go

index c5efffca9cdb0ae0989b6172a18d190e38fdd800..17d5297b82c86614d849a7d9ef33b3a8b13b2c4e 100644 (file)
@@ -143,7 +143,7 @@ func serveFile(w ResponseWriter, r *Request, name string, redirect bool) {
                        n, _ := io.ReadFull(f, buf[:])
                        b := buf[:n]
                        if isText(b) {
-                               ctype = "text-plain; charset=utf-8"
+                               ctype = "text/plain; charset=utf-8"
                        } else {
                                // generic binary
                                ctype = "application/octet-stream"
index 692b9863e82fdc9ba4ec85a4d11d764c47c64869..09d0981f26ee6814d1d72f2d1341e38d7909e3f5 100644 (file)
@@ -104,7 +104,7 @@ func TestServeFileContentType(t *testing.T) {
                        t.Errorf("Content-Type mismatch: got %q, want %q", h, want)
                }
        }
-       get("text-plain; charset=utf-8")
+       get("text/plain; charset=utf-8")
        override = true
        get(ctype)
 }