Skip to content

Commit

Permalink
removed host headers
Browse files Browse the repository at this point in the history
  • Loading branch information
vidosits committed May 10, 2021
1 parent c649fa3 commit 56b488b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .traefik.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
displayName: Header Pattern reverse-proxy
displayName: Header Pattern Reverse-Proxy
type: middleware

import: github.com/vidosits/header-pattern-proxy
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Production:
[experimental.plugins]
[experimental.plugins.my-plugin-name]
moduleName = "github.com/vidosits/header-pattern-proxy"
version = "v1.0.0"
version = "v1.1.0"
```

or if you're using [devMode](https://doc.traefik.io/traefik-pilot/plugins/plugin-dev/#developer-mode):
Expand Down
7 changes: 0 additions & 7 deletions proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package header_pattern_proxy
import (
"context"
"fmt"
"log"
"net/http"
"net/http/httputil"
"net/url"
Expand Down Expand Up @@ -60,12 +59,6 @@ func (a *SiteProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
}

proxy := httputil.NewSingleHostReverseProxy(destinationUrl)

req.URL.Host = destinationUrl.Host
req.URL.Scheme = "http"
req.Header.Set("X-Forwarded-Host", req.Header.Get("Host"))
req.Host = destinationUrl.Host

proxy.ServeHTTP(rw, req)
}
}
Expand Down

0 comments on commit 56b488b

Please sign in to comment.