]> Cypherpunks repositories - gostls13.git/commit
net/http: use relative path in Location redirect
authorRoland Shoemaker <roland@golang.org>
Tue, 27 Apr 2021 03:10:56 +0000 (20:10 -0700)
committerRoland Shoemaker <roland@golang.org>
Mon, 3 May 2021 17:34:10 +0000 (17:34 +0000)
commitb5842308892e0c4f9e772a42d5826f6f62f57be3
tree17758f68b2204ded90d2d9a21f65b0e8938fa77f
parent169155d61ede128caa8452bdff3ce9995287c138
net/http: use relative path in Location redirect

If the cleaned path did not match the requested path, ServeMux.Handler
would return a Location header which reflected the hostname in the
request, possibly leading to an incorrect redirect. Instead the
Location header should be relative, like the other cases in
ServeMux.Handler.

Change-Id: I2c220d925e708061bc128f0bdc96cca7a32764d3
Reviewed-on: https://go-review.googlesource.com/c/go/+/313950
Trust: Roland Shoemaker <roland@golang.org>
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
src/net/http/serve_test.go
src/net/http/server.go