Plugins: Only configure plugin proxy transport once (#71735)

only configure plugin proxy transport once
This commit is contained in:
Will Browne 2023-07-17 13:37:03 +02:00 committed by GitHub
parent 7738a9846c
commit b59ca7fb22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,9 +14,12 @@ import (
"github.com/grafana/grafana/pkg/web" "github.com/grafana/grafana/pkg/web"
) )
var (
once sync.Once
pluginProxyTransport *http.Transport
)
func (hs *HTTPServer) ProxyPluginRequest(c *contextmodel.ReqContext) { func (hs *HTTPServer) ProxyPluginRequest(c *contextmodel.ReqContext) {
var once sync.Once
var pluginProxyTransport *http.Transport
once.Do(func() { once.Do(func() {
pluginProxyTransport = &http.Transport{ pluginProxyTransport = &http.Transport{
TLSClientConfig: &tls.Config{ TLSClientConfig: &tls.Config{