mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
API: don't re-add /api suffix to grafana.com API URL (#62280)
The old GrafanaComURL setting didn't have the /api suffix so needed it adding on by the proxy director, but the new GrafanaComAPIURL setting is assumed to already point directly to the API and doesn't need an additional suffix. This is the only place in the codebase that GrafanaComAPIURL is used.
This commit is contained in:
parent
f98ad926ac
commit
5ff94e528b
@ -23,15 +23,15 @@ var grafanaComProxyTransport = &http.Transport{
|
|||||||
TLSHandshakeTimeout: 10 * time.Second,
|
TLSHandshakeTimeout: 10 * time.Second,
|
||||||
}
|
}
|
||||||
|
|
||||||
func ReverseProxyGnetReq(logger log.Logger, proxyPath string, version string, grafanaComUrl string) *httputil.ReverseProxy {
|
func ReverseProxyGnetReq(logger log.Logger, proxyPath string, version string, grafanaComAPIUrl string) *httputil.ReverseProxy {
|
||||||
url, _ := url.Parse(grafanaComUrl)
|
url, _ := url.Parse(grafanaComAPIUrl)
|
||||||
|
|
||||||
director := func(req *http.Request) {
|
director := func(req *http.Request) {
|
||||||
req.URL.Scheme = url.Scheme
|
req.URL.Scheme = url.Scheme
|
||||||
req.URL.Host = url.Host
|
req.URL.Host = url.Host
|
||||||
req.Host = url.Host
|
req.Host = url.Host
|
||||||
|
|
||||||
req.URL.Path = util.JoinURLFragments(url.Path+"/api", proxyPath)
|
req.URL.Path = util.JoinURLFragments(url.Path, proxyPath)
|
||||||
|
|
||||||
// clear cookie headers
|
// clear cookie headers
|
||||||
req.Header.Del("Cookie")
|
req.Header.Del("Cookie")
|
||||||
|
Loading…
Reference in New Issue
Block a user