Chore: Use response limit middleware from SDK (#83915)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package datasource
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend/httpclient"
|
||||
)
|
||||
|
||||
func contextualMiddlewares(ctx context.Context) context.Context {
|
||||
cfg := backend.GrafanaConfigFromContext(ctx)
|
||||
m := httpclient.ResponseLimitMiddleware(cfg.ResponseLimit())
|
||||
|
||||
return httpclient.WithContextualMiddleware(ctx, m)
|
||||
}
|
||||
Reference in New Issue
Block a user