Revert "Merge pull request #931 from pedronasser/master"

This reverts commit 9ea0591951, reversing
changes made to 2125ae5f99.
This commit is contained in:
Matthew Holt
2016-07-21 13:31:43 -06:00
parent 4678471fe0
commit 57710e8b0d
4 changed files with 3 additions and 24 deletions
-6
View File
@@ -30,8 +30,6 @@ type Upstream interface {
Select() *UpstreamHost
// Checks if subpath is not an ignored path
AllowedPath(string) bool
// Is Upstream in transparent mode?
Transparent() bool
}
// UpstreamHostDownFunc can be used to customize how Down behaves.
@@ -96,7 +94,6 @@ func (p Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
start := time.Now()
for time.Now().Sub(start) < tryDuration {
host := upstream.Select()
if host == nil {
return http.StatusBadGateway, errUnreachable
}
@@ -128,9 +125,6 @@ func (p Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
if v, ok := host.UpstreamHeaders["Host"]; ok {
outreq.Host = replacer.Replace(v[len(v)-1])
}
if upstream.Transparent() {
host.UpstreamHeaders.Set("Host", host.Name)
}
// modify headers for request that will be sent to the upstream host
upHeaders := createHeadersByRules(host.UpstreamHeaders, r.Header, replacer)
for k, v := range upHeaders {