mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 03:13:49 +08:00
Chore: Use response limit middleware from SDK (#83915)
This commit is contained in:

committed by
GitHub

parent
ecd6de826a
commit
c061cc33cc
15
pkg/registry/apis/datasource/middleware.go
Normal file
15
pkg/registry/apis/datasource/middleware.go
Normal file
@ -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