From: Brad Fitzpatrick Date: Fri, 22 Apr 2011 16:09:37 +0000 (-0700) Subject: http: fix FileServer's default text content type X-Git-Tag: weekly.2011-04-27~67 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=81cfb4ec2b37a296722de4172a4a0d29cce06961;p=gostls13.git http: fix FileServer's default text content type Fixes #1729 R=rsc, adg CC=golang-dev https://golang.org/cl/4443057 --- diff --git a/src/pkg/http/fs.go b/src/pkg/http/fs.go index c5efffca9c..17d5297b82 100644 --- a/src/pkg/http/fs.go +++ b/src/pkg/http/fs.go @@ -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" diff --git a/src/pkg/http/fs_test.go b/src/pkg/http/fs_test.go index 692b9863e8..09d0981f26 100644 --- a/src/pkg/http/fs_test.go +++ b/src/pkg/http/fs_test.go @@ -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) }