1
0
mirror of https://github.com/golang/go synced 2024-10-05 14:11:22 -06:00
go/src
Denys Honsiorovskyi eca3618fd3 net/http: support URLs without schemes in http.Redirect
Many browsers now support schemeless URLs in the Location headers
and also it is allowed in the draft HTTP/1.1 specification (see
http://stackoverflow.com/q/4831741#comment25926312_4831741), but
Go standard library lacks support for them.

This patch implements schemeless URLs support in http.Redirect().
Since url.Parse() correctly handles schemeless URLs, I've just added
an extra condition to verify URL's Host part in the absoulute/relative
check in the http.Redirect function.

Also I've moved oldpath variable initialization inside the block
of code where it is used.

Change-Id: Ib8a6347816a83e16576f00c4aa13224a89d610b5
Reviewed-on: https://go-review.googlesource.com/14172
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-01-12 16:49:07 +00:00
..
archive archive/zip: fix reading, writing of zip64 archives 2016-01-07 00:44:04 +00:00
bufio bufio: clarify Read docs 2015-12-01 20:05:25 +00:00
builtin
bytes bytes: document that buffer is reused in Truncate and Reset 2015-12-18 19:40:58 +00:00
cmd cmd/go: pass -no-pie along with -Wl,-r to gcc when supported on linux 2016-01-11 21:20:00 +00:00
compress build: shorten a few packages with long tests 2015-12-29 15:46:44 +00:00
container
crypto crypto/cipher: always zero dst buffer on GCM authentication failure. 2016-01-10 19:03:42 +00:00
database/sql database/sql: guard against panics in driver.Stmt implementation 2016-01-08 15:49:12 +00:00
debug debug/elf: rename Chdr64.Reserved to _ 2015-12-18 20:41:26 +00:00
encoding encoding/json: doc: Decode only writes to exported fields 2016-01-08 16:15:25 +00:00
errors
expvar
flag
fmt Revert "fmt: check newline in the end of input" 2015-12-11 06:35:20 +00:00
go go/types: slightly better doc strings 2016-01-11 19:01:12 +00:00
hash hash/crc32: add noescape tags to assembly functions 2015-11-25 15:01:10 +00:00
html text/template,html/template: correct comment in DefinedTemplates 2015-11-24 21:52:36 +00:00
image image/color: have NYCbCrA.RGBA work in 16-bit color. 2015-12-24 06:55:33 +00:00
index/suffixarray
internal internal/syscall/windows: correct GetACP and MultiByteToWideChar 2016-01-08 16:15:59 +00:00
io io/ioutil: add examples to functions 2015-11-30 19:47:18 +00:00
log log/syslog: document that syslog is frozen 2016-01-05 22:56:07 +00:00
math math/big: fix typo in comment 2016-01-08 20:18:10 +00:00
mime mime: fix parsing of empty string attribute value 2015-12-05 20:14:25 +00:00
net net/http: support URLs without schemes in http.Redirect 2016-01-12 16:49:07 +00:00
os runtime: for c-archive/c-shared, install signal handlers synchronously 2016-01-09 00:58:38 +00:00
path path/filepath: include test number in TestIssue13582 output 2015-12-15 06:43:35 +00:00
reflect reflect: document DeepEqual, fix case of maps with NaN keys 2015-12-11 05:50:05 +00:00
regexp regexp/syntax: fix factoring of common prefixes in alternations 2016-01-08 16:41:46 +00:00
runtime runtime: mark greyobject go:nowritebarrierrec 2016-01-12 02:01:01 +00:00
sort sort: improve average quicksort performance 2015-12-04 20:41:47 +00:00
strconv
strings
sync internal/race: add package 2015-11-26 16:50:31 +00:00
syscall syscall: fix duplicated copyright header in mksysnum_plan9.sh 2015-12-10 20:45:18 +00:00
testing testing: move comment inside T.Parallel 2016-01-06 17:59:55 +00:00
text text/template,html/template: correct comment in DefinedTemplates 2015-11-24 21:52:36 +00:00
time time: restore old error text for day out of range 2016-01-08 03:15:20 +00:00
unicode unicode/utf8: add test for FullRune 2015-12-01 10:39:06 +00:00
unsafe
vendor/golang.org/x/net/http2/hpack net/http: document GODEBUG settings, update bundled http2 2016-01-08 00:56:28 +00:00
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
iostest.bash
make.bash src: remove reference to since-deleted dist -s flag 2015-12-17 22:03:56 +00:00
make.bat
Make.dist
make.rc
nacltest.bash
race.bash cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00
race.bat cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00
run.bash cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00
run.bat cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00
run.rc cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00