Fix update oxy

This commit is contained in:
Michael 2018-10-10 18:20:05 +02:00 committed by Traefiker Bot
parent 609b2630d7
commit b722748ec3
5 changed files with 7 additions and 2 deletions

2
Gopkg.lock generated
View file

@ -1322,7 +1322,7 @@
"roundrobin",
"utils"
]
revision = "fe51048067db50958154cd4040da878b10002a3a"
revision = "7d94d212f808222b72fd0b8bb171bfcd4e27ffca"
[[projects]]
name = "github.com/vulcand/predicate"

View file

@ -19,5 +19,6 @@ logLevel = "DEBUG"
[frontends]
[frontends.frontend1]
backend = "backend1"
passHostHeader = true
[frontends.frontend1.routes.test_1]
rule = "PathPrefix:/ws"

View file

@ -24,5 +24,6 @@ insecureSkipVerify=true
[frontends]
[frontends.frontend1]
backend = "backend1"
passHostHeader = true
[frontends.frontend1.routes.test_1]
rule = "Path:/echo,/ws"

View file

@ -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))
}

View file

@ -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