DataProxy: Populate X-Grafana-Referer header (#60040)

* ProxyUtil: Populate X-Grafana-Referer header

* ProxyUtil: Move Referer/Origin header removal

So that the removal and setting X-Grafana-Referer logic applies to all
proxied requests and not just datasource proxy.

* ProxyUtil: Test to guard against multiline headers

* ProxyUtil: Explicitly check injected header isn't parsed
This commit is contained in:
Neil Fordyce
2022-12-15 09:08:10 +00:00
committed by GitHub
parent 5dfa59884e
commit b0874d8059
4 changed files with 42 additions and 5 deletions

View File

@ -76,10 +76,6 @@ func wrapDirector(d func(*http.Request)) func(req *http.Request) {
d(req)
PrepareProxyRequest(req)
// Clear Origin and Referer to avoid CORS issues
req.Header.Del("Origin")
req.Header.Del("Referer")
}
}