1
0
mirror of https://github.com/containous/traefik.git synced 2024-12-23 17:34:13 +03:00

Only forward X-Fowarded-Port.

This commit is contained in:
Ludovic Fernandez 2017-08-25 12:14:03 +02:00 committed by Traefiker
parent 78544f7fa2
commit 919295cffc
3 changed files with 4 additions and 6 deletions

6
glide.lock generated
View File

@ -1,5 +1,5 @@
hash: 8b1dbedc74488a75ba15557befbf44cf56060bc562e7407ef9a09791ec5cabd6 hash: 110ae989ba77357a6d7cc720f671765b06857cf447296a294a461acd2574a020
updated: 2017-08-18T16:47:14.848940186+02:00 updated: 2017-08-25T11:52:16.848940186+02:00
imports: imports:
- name: cloud.google.com/go - name: cloud.google.com/go
version: 2e6a95edb1071d750f6d7db777bf66cd2997af6c version: 2e6a95edb1071d750f6d7db777bf66cd2997af6c
@ -411,7 +411,7 @@ imports:
- name: github.com/vdemeester/docker-events - name: github.com/vdemeester/docker-events
version: be74d4929ec1ad118df54349fda4b0cba60f849b version: be74d4929ec1ad118df54349fda4b0cba60f849b
- name: github.com/vulcand/oxy - name: github.com/vulcand/oxy
version: 321ed9ffd102941c736731b8e7bae811820d267d version: 7baa97f97557ff96be2798972dc831c7ba0a46e7
repo: https://github.com/containous/oxy.git repo: https://github.com/containous/oxy.git
vcs: git vcs: git
subpackages: subpackages:

View File

@ -8,7 +8,7 @@ import:
- package: github.com/cenk/backoff - package: github.com/cenk/backoff
- package: github.com/containous/flaeg - package: github.com/containous/flaeg
- package: github.com/vulcand/oxy - package: github.com/vulcand/oxy
version: 321ed9ffd102941c736731b8e7bae811820d267d version: 7baa97f97557ff96be2798972dc831c7ba0a46e7
repo: https://github.com/containous/oxy.git repo: https://github.com/containous/oxy.git
vcs: git vcs: git
subpackages: subpackages:

View File

@ -34,8 +34,6 @@ func (rw *HeaderRewriter) Rewrite(req *http.Request) {
if xfp := req.Header.Get(XForwardedPort); xfp != "" && rw.TrustForwardHeader { if xfp := req.Header.Get(XForwardedPort); xfp != "" && rw.TrustForwardHeader {
req.Header.Set(XForwardedPort, xfp) req.Header.Set(XForwardedPort, xfp)
} else if req.URL.Port() != "" {
req.Header.Set(XForwardedPort, req.URL.Port())
} }
if xfh := req.Header.Get(XForwardedHost); xfh != "" && rw.TrustForwardHeader { if xfh := req.Header.Get(XForwardedHost); xfh != "" && rw.TrustForwardHeader {