From 81cfb4ec2b37a296722de4172a4a0d29cce06961 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 22 Apr 2011 09:09:37 -0700 Subject: [PATCH] http: fix FileServer's default text content type Fixes #1729 R=rsc, adg CC=golang-dev https://golang.org/cl/4443057 --- src/pkg/http/fs.go | 2 +- src/pkg/http/fs_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pkg/http/fs.go b/src/pkg/http/fs.go index c5efffca9cd..17d5297b82c 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 692b9863e82..09d0981f26e 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) }