mirror of
https://github.com/boringproxy/boringproxy.git
synced 2025-02-25 18:55:29 -06:00
Add X-Forwarded-Host header to upstream requests
This commit is contained in:
parent
13e998e87d
commit
f234049877
6
api.go
6
api.go
@ -116,12 +116,12 @@ func (a *Api) handleDeleteTunnel(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
domain := query["domain"][0]
|
||||
|
||||
err := a.tunMan.DeleteTunnel(domain)
|
||||
if err != nil {
|
||||
err := a.tunMan.DeleteTunnel(domain)
|
||||
if err != nil {
|
||||
w.WriteHeader(500)
|
||||
io.WriteString(w, "Failed to delete tunnel")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (a *Api) validateSession(h http.Handler) http.Handler {
|
||||
|
@ -124,6 +124,8 @@ func (p *BoringProxy) proxyRequest(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
upstreamReq.Header = downstreamReqHeaders
|
||||
|
||||
upstreamReq.Header["X-Forwarded-Host"] = []string{r.Host}
|
||||
|
||||
upstreamRes, err := p.httpClient.Do(upstreamReq)
|
||||
if err != nil {
|
||||
log.Print(err)
|
||||
|
Loading…
Reference in New Issue
Block a user