Plugins: Use handler middleware from the SDK (#93445)

updates sdk to v0.251.0
This commit is contained in:
Marcus Efraimsson
2024-09-30 16:33:15 +02:00
committed by GitHub
parent 54faa541c3
commit b7a7f2bd62
47 changed files with 524 additions and 1448 deletions
+4
View File
@@ -11,6 +11,7 @@ import (
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/plugins/manager/registry"
"github.com/grafana/grafana/pkg/util/proxyutil"
)
const (
@@ -101,8 +102,11 @@ func (s *Service) CallResource(ctx context.Context, req *backend.CallResourceReq
removeConnectionHeaders(res.Headers)
removeHopByHopHeaders(res.Headers)
removeNonAllowedHeaders(res.Headers)
} else {
res.Headers = map[string][]string{}
}
proxyutil.SetProxyResponseHeaders(res.Headers)
ensureContentTypeHeader(res)
}