Merge 'v1.3.6'

This commit is contained in:
Fernandez Ludovic 2017-08-22 14:03:13 +02:00
commit 04e65958ee
6 changed files with 28 additions and 22 deletions

View file

@ -1,5 +1,11 @@
# Change Log
## [v1.3.6](https://github.com/containous/traefik/tree/v1.3.6) (2017-08-20)
[All Commits](https://github.com/containous/traefik/compare/v1.3.5...v1.3.6)
**Bug fixes:**
- **[oxy,websocket]** Websocket parameters and protocol. ([#1970](https://github.com/containous/traefik/pull/1970) by [ldez](https://github.com/ldez))
## [v1.3.5](https://github.com/containous/traefik/tree/v1.3.5) (2017-08-01)
[All Commits](https://github.com/containous/traefik/compare/v1.3.4...v1.3.5)

4
glide.lock generated
View file

@ -1,4 +1,4 @@
hash: b970da88f72aebed9ac07a31db3f40045de0cd63190a2aae8ce18b55ec3f434a
hash: 3d5a06016b7b56be08120ed653406a1e8d4ade7e69b4fbc37b31683cb4e9a519
updated: 2017-08-21T14:15:06.346751095+02:00
imports:
- name: cloud.google.com/go
@ -477,7 +477,7 @@ imports:
- name: github.com/urfave/negroni
version: 490e6a555d47ca891a89a150d0c1ef3922dfffe9
- name: github.com/vulcand/oxy
version: 3772a8e4408fb033d00a947d340475e116854b1a
version: 321ed9ffd102941c736731b8e7bae811820d267d
repo: https://github.com/containous/oxy.git
vcs: git
subpackages:

View file

@ -13,6 +13,7 @@ import:
- package: github.com/containous/flaeg
- package: github.com/vulcand/oxy
version: 3772a8e4408fb033d00a947d340475e116854b1a
version: 321ed9ffd102941c736731b8e7bae811820d267d
repo: https://github.com/containous/oxy.git
vcs: git
subpackages:

View file

@ -22,26 +22,26 @@ func Test(t *testing.T) {
}
func init() {
check.Suite(&SimpleSuite{})
check.Suite(&AccessLogSuite{})
check.Suite(&HTTPSSuite{})
check.Suite(&TimeoutSuite{})
check.Suite(&FileSuite{})
check.Suite(&HealthCheckSuite{})
check.Suite(&DockerSuite{})
check.Suite(&ConsulSuite{})
check.Suite(&ConsulCatalogSuite{})
check.Suite(&EtcdSuite{})
check.Suite(&MarathonSuite{})
check.Suite(&ConstraintSuite{})
check.Suite(&MesosSuite{})
check.Suite(&EurekaSuite{})
check.Suite(&AcmeSuite{})
check.Suite(&ConstraintSuite{})
check.Suite(&ConsulCatalogSuite{})
check.Suite(&ConsulSuite{})
check.Suite(&DockerSuite{})
check.Suite(&DynamoDBSuite{})
check.Suite(&ErrorPagesSuite{})
check.Suite(&WebsocketSuite{})
check.Suite(&EtcdSuite{})
check.Suite(&EurekaSuite{})
check.Suite(&FileSuite{})
check.Suite(&GRPCSuite{})
check.Suite(&HealthCheckSuite{})
check.Suite(&HTTPSSuite{})
check.Suite(&LogRotationSuite{})
check.Suite(&MarathonSuite{})
check.Suite(&MesosSuite{})
check.Suite(&SimpleSuite{})
check.Suite(&TimeoutSuite{})
check.Suite(&WebsocketSuite{})
}
var traefikBinary = "../dist/traefik"

View file

@ -258,7 +258,6 @@ func (f *websocketForwarder) serveHTTP(w http.ResponseWriter, req *http.Request,
if outReq.URL.Scheme == "wss" && f.TLSClientConfig != nil {
dialer.TLSClientConfig = f.TLSClientConfig
}
targetConn, resp, err := dialer.Dial(outReq.URL.String(), outReq.Header)
if err != nil {
ctx.log.Errorf("Error dialing `%v`: %v", outReq.Host, err)
@ -308,7 +307,6 @@ func (f *websocketForwarder) copyRequest(req *http.Request, u *url.URL) (outReq
outReq.URL = utils.CopyURL(req.URL)
outReq.URL.Scheme = u.Scheme
outReq.URL.Path = outReq.RequestURI
//sometimes backends might be registered as HTTP/HTTPS servers so translate URLs to websocket URLs.
switch u.Scheme {
@ -318,9 +316,12 @@ func (f *websocketForwarder) copyRequest(req *http.Request, u *url.URL) (outReq
outReq.URL.Scheme = "ws"
}
if requestURI, err := url.ParseRequestURI(outReq.RequestURI); err == nil {
outReq.URL.Path = requestURI.Path
outReq.URL.RawQuery = requestURI.RawQuery
}
outReq.URL.Host = u.Host
// raw query is already included in RequestURI, so ignore it to avoid dupes
outReq.URL.RawQuery = ""
outReq.Header = make(http.Header)
//gorilla websocket use this header to set the request.Host tested in checkSameOrigin

View file

@ -19,7 +19,6 @@ const (
SecWebsocketKey = "Sec-Websocket-Key"
SecWebsocketVersion = "Sec-Websocket-Version"
SecWebsocketExtensions = "Sec-Websocket-Extensions"
SecWebsocketProtocol = "Sec-Websocket-Protocol"
SecWebsocketAccept = "Sec-Websocket-Accept"
)
@ -43,7 +42,6 @@ var WebsocketDialHeaders = []string{
SecWebsocketKey,
SecWebsocketVersion,
SecWebsocketExtensions,
SecWebsocketProtocol,
SecWebsocketAccept,
}