diff options
author | Matthew Holt <[email protected]> | 2017-03-20 21:05:11 -0600 |
---|---|---|
committer | Matthew Holt <[email protected]> | 2017-03-20 21:05:11 -0600 |
commit | fbd6412359be76bcfbb2ba5cfdecbc273e040674 (patch) | |
tree | f60dd06f793776da1ad2695707864eb4382a1cb9 | |
parent | 36d2027493a65e76463d7075d37cd0a139dcb7f7 (diff) | |
download | caddy-fbd6412359be76bcfbb2ba5cfdecbc273e040674.tar.gz caddy-fbd6412359be76bcfbb2ba5cfdecbc273e040674.zip |
Don't modify request URL values from Caddyfile (fixes #1528)
HTTP redirects can use host-relative URLs. See discussion in #1497.
-rw-r--r-- | caddyhttp/httpserver/server.go | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/caddyhttp/httpserver/server.go b/caddyhttp/httpserver/server.go index 5aab81b09..6a00a27ab 100644 --- a/caddyhttp/httpserver/server.go +++ b/caddyhttp/httpserver/server.go @@ -9,7 +9,6 @@ import ( "log" "net" "net/http" - "net/url" "os" "runtime" "strings" @@ -350,14 +349,6 @@ func (s *Server) serveHTTP(w http.ResponseWriter, r *http.Request) (int, error) } } - // URL fields other than Path and RawQuery will be empty for most server - // requests. Hence, the request URL is updated with the scheme and host - // from the virtual host's site address. - if vhostURL, err := url.Parse(vhost.Addr.String()); err == nil { - r.URL.Scheme = vhostURL.Scheme - r.URL.Host = vhostURL.Host - } - // Apply the path-based request body size limit // The error returned by MaxBytesReader is meant to be handled // by whichever middleware/plugin that receives it when calling |