Fix bad Host in dashboard's reverse proxy (#8073)

Fixes #8067

We were overridding the Host header with the target cluster address
(e.g. `grafana.grafana:3000`) which is different from the host requested
by the browser (`localhost:50750`), and recent Grafana versions are
rejecting such requests in their CSRF implementation. So here we stop
overridding that, and the reverse proxy uses the right Host header
coming from the client.
This commit is contained in:
Alejandro Pedraza 2022-03-16 09:07:37 -05:00 committed by GitHub
parent 2732f59624
commit 5a1ee1ef90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 1 deletions

View File

@ -15,7 +15,6 @@ type reverseProxy struct {
func newReverseProxy(addr string, prefix string) *reverseProxy {
director := func(req *http.Request) {
req.Host = addr
req.URL.Host = addr
req.URL.Scheme = "http"
req.URL.Path = strings.TrimPrefix(req.URL.Path, prefix)