Skip to content

Commit

Permalink
backend: Fix empty X-Forwared-Host header
Browse files Browse the repository at this point in the history
The header was not getting set correctly and returning an empty string

Fixes: #1968
Signed-off-by: Kautilya Tripathi <ktripathi@microsoft.com>
  • Loading branch information
knrt10 committed May 20, 2024
1 parent bd93e00 commit 2fcb5d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/cmd/headlamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ func handleClusterAPI(c *HeadlampConfig, router *mux.Router) {
}

r.Host = clusterURL.Host
r.Header.Set("X-Forwarded-Host", r.Header.Get("Host"))
r.Header.Set("X-Forwarded-Host", r.Host)
r.URL.Host = clusterURL.Host
r.URL.Path = mux.Vars(r)["api"]
r.URL.Scheme = clusterURL.Scheme
Expand Down

0 comments on commit 2fcb5d2

Please sign in to comment.