From b722748ec3f3e9a5d6b7dec6ccd223f87dc57b52 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 10 Oct 2018 18:20:05 +0200 Subject: [PATCH] Fix update oxy --- Gopkg.lock | 2 +- integration/fixtures/websocket/config.toml | 1 + integration/fixtures/websocket/config_https.toml | 1 + vendor/github.com/vulcand/oxy/buffer/buffer.go | 2 +- vendor/github.com/vulcand/oxy/forward/fwd.go | 3 +++ 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 2af95444e..fdda17fb8 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1322,7 +1322,7 @@ "roundrobin", "utils" ] - revision = "fe51048067db50958154cd4040da878b10002a3a" + revision = "7d94d212f808222b72fd0b8bb171bfcd4e27ffca" [[projects]] name = "github.com/vulcand/predicate" diff --git a/integration/fixtures/websocket/config.toml b/integration/fixtures/websocket/config.toml index 965f3d641..480ca01fc 100644 --- a/integration/fixtures/websocket/config.toml +++ b/integration/fixtures/websocket/config.toml @@ -19,5 +19,6 @@ logLevel = "DEBUG" [frontends] [frontends.frontend1] backend = "backend1" + passHostHeader = true [frontends.frontend1.routes.test_1] rule = "PathPrefix:/ws" diff --git a/integration/fixtures/websocket/config_https.toml b/integration/fixtures/websocket/config_https.toml index d1954a578..8f9c01c01 100644 --- a/integration/fixtures/websocket/config_https.toml +++ b/integration/fixtures/websocket/config_https.toml @@ -24,5 +24,6 @@ insecureSkipVerify=true [frontends] [frontends.frontend1] backend = "backend1" + passHostHeader = true [frontends.frontend1.routes.test_1] rule = "Path:/echo,/ws" diff --git a/vendor/github.com/vulcand/oxy/buffer/buffer.go b/vendor/github.com/vulcand/oxy/buffer/buffer.go index 08eb8b3e7..404d79965 100644 --- a/vendor/github.com/vulcand/oxy/buffer/buffer.go +++ b/vendor/github.com/vulcand/oxy/buffer/buffer.go @@ -330,7 +330,7 @@ func (b *Buffer) copyRequest(req *http.Request, body io.ReadCloser, bodySize int o.TransferEncoding = []string{} // http.Transport will close the request body on any error, we are controlling the close process ourselves, so we override the closer here if body == nil { - o.Body = nil + o.Body = ioutil.NopCloser(req.Body) } else { o.Body = ioutil.NopCloser(body.(io.Reader)) } diff --git a/vendor/github.com/vulcand/oxy/forward/fwd.go b/vendor/github.com/vulcand/oxy/forward/fwd.go index e81ee89c2..5eca0a4a5 100644 --- a/vendor/github.com/vulcand/oxy/forward/fwd.go +++ b/vendor/github.com/vulcand/oxy/forward/fwd.go @@ -491,6 +491,9 @@ func (f *httpForwarder) copyWebSocketRequest(req *http.Request) (outReq *http.Re outReq.RequestURI = "" // Outgoing request should not have RequestURI outReq.URL.Host = req.URL.Host + if !f.passHost { + outReq.Host = req.URL.Host + } outReq.Header = make(http.Header) // gorilla websocket use this header to set the request.Host tested in checkSameOrigin