go/src
Dmitri Shuralyov fd29d03f70 net/http: set Content-Type header in Redirect
Setting the Content-Type header explicitly allows browsers to know what
the type of the content is. Otherwise, they have to guess the type from
the content itself, which could lead to unpredictable behavior, and
increases CPU usage.

Not setting the Content-Type despite writing a body may also trigger
unwanted warnings in user middleware, and make it more difficult to
resolve valid issues where the user forgets to set Content-Type in
some situations where it should be set.

There is some precedent for doing this in http.FileServer, which
sets "Content-Type" to "text/html; charset=utf-8" before writing
<pre><a href=...></a></pre> HTML.

Change-Id: I24286827bebf4da8adee9238b8c5a94d4069c8db
Reviewed-on: https://go-review.googlesource.com/50510
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-08-08 06:09:59 +00:00
..
archive archive/zip: remove an out of date TODO 2017-07-15 21:14:01 +00:00
bufio Revert "bufio: make Reader.Peek invalidate Unreads" 2017-07-06 03:06:44 +00:00
builtin builtin: use type aliases for rune and byte 2017-06-07 00:42:59 +00:00
bytes bytes: add example for (*Buffer).Grow 2017-07-16 03:49:43 +00:00
cmd cmd/cgo: document that structs and arrays don't work with //export 2017-08-08 04:39:05 +00:00
compress compress/lzw: don't follow code == hi if last is invalid. 2017-06-08 01:27:37 +00:00
container container/heap: avoid up() invoke if down() success at heap.Remove() 2017-05-13 19:10:24 +00:00
context
crypto crypto/x509: load all trusted certs on darwin (nocgo) 2017-07-14 18:47:10 +00:00
database/sql database/sql: fix wrong method name in description 2017-07-18 04:42:09 +00:00
debug debug/dwarf: heuristically handle both UNIX and Windows paths 2017-05-26 14:35:20 +00:00
encoding encoding/json: de-indent raw strings in remaining examples 2017-08-08 04:30:58 +00:00
errors
expvar expvar: reduce sync.Map overhead for (*Map).Set 2017-05-02 17:13:40 +00:00
flag flag: make default Usage prefer CommandLine's output over just os.Stderr 2017-08-08 01:47:47 +00:00
fmt fmt: remove unnecessary trailing commas in doc.go 2017-06-07 21:00:42 +00:00
go all: remove some manual hyphenation 2017-08-06 16:14:46 +00:00
hash all: gofmt 2017-06-21 03:14:30 +00:00
html html: updated entity spec link 2017-08-08 04:29:35 +00:00
image image/gif: fix writeImageBlock with SubImages 2017-06-16 05:45:48 +00:00
index/suffixarray
internal internal/cpu: fix style nit in variable name 2017-08-08 04:11:36 +00:00
io io/ioutil: add example for ReadFile 2017-07-15 23:28:44 +00:00
log log: adds a Logger Output method Example 2017-07-16 03:57:11 +00:00
math all: remove some manual hyphenation 2017-08-06 16:14:46 +00:00
mime mime/multipart: parse boundary with spaces properly 2017-05-23 22:56:44 +00:00
net net/http: set Content-Type header in Redirect 2017-08-08 06:09:59 +00:00
os os: remove duplicate check from windows os.Stat 2017-07-20 07:43:15 +00:00
path path/filepath: fix TestGlobError 2017-06-15 21:53:23 +00:00
plugin plugin: mention that there are known bugs with plugins 2017-07-28 00:29:08 +00:00
reflect reflect: document how DeepEqual handles cycles 2017-08-04 22:22:03 +00:00
regexp regexp: example for MatchString function 2017-07-15 21:13:35 +00:00
runtime runtime: mapassign_* should use typedmemmove to update keys 2017-08-07 06:24:42 +00:00
sort sort: add example for Strings 2017-07-15 23:17:23 +00:00
strconv strconv: apply Brad's review comment 2017-07-17 16:32:05 +00:00
strings strings: add a example for TrimFunc 2017-07-15 21:14:22 +00:00
sync sync: delete a sentence from the Map docs 2017-07-21 22:00:47 +00:00
syscall syscall: update check for UserNS support for centos 7 2017-07-17 18:18:08 +00:00
testing cmd/go: show examples with empty output in go test -list 2017-08-02 14:30:08 +00:00
text all: single space after period 2017-06-09 20:29:09 +00:00
time time: skip ZoneAbbr test in timezones with no abbreviation 2017-08-02 16:22:49 +00:00
unicode unicode: move scripts from FoldCategories to FoldScripts 2017-06-15 01:05:31 +00:00
unsafe
vendor/golang_org/x vendor: update vendored lif 2017-05-29 21:54:12 +00:00
Make.dist
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash
make.bash
make.bat
make.rc
naclmake.bash
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc