Skip to content

Commit

Permalink
fix: Host header not arriving correctly. Closes loophole#267
Browse files Browse the repository at this point in the history
  • Loading branch information
fgmacedo committed Aug 28, 2024
1 parent 06767ef commit aecb1b7
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions internal/pkg/httpserver/httpserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package httpserver
import (
"crypto/tls"
"fmt"
"net"
"net/http"
"net/http/httputil"
"net/url"
Expand Down Expand Up @@ -121,11 +120,6 @@ func (psb *proxyServerBuilder) Build() (*http.Server, error) {
proxy.Director = func(req *http.Request) {
defaultDirector(req)

addr := net.ParseIP(target.Host)
if addr == nil {
req.Host = target.Host
}

req.Header.Set("X-Forwarded-Host", urlmaker.GetSiteFQDN(psb.serverBuilder.siteID, psb.serverBuilder.domain))
req.Header.Set("X-Forwarded-Proto", "https")
}
Expand Down

0 comments on commit aecb1b7

Please sign in to comment.