mirror of
https://github.com/grafana/grafana.git
synced 2024-12-28 01:41:24 -06:00
Prometheus: Prevent duplicate registration of custom header middleware (#84860)
* remove dupe middleware * fix test
This commit is contained in:
parent
00c094f7cf
commit
c8c372c327
@ -37,7 +37,6 @@ func middlewares(logger log.Logger, httpMethod string) []sdkhttpclient.Middlewar
|
||||
middlewares := []sdkhttpclient.Middleware{
|
||||
// TODO: probably isn't needed anymore and should by done by http infra code
|
||||
middleware.CustomQueryParameters(logger),
|
||||
sdkhttpclient.CustomHeadersMiddleware(),
|
||||
}
|
||||
|
||||
// Needed to control GET vs POST method of the requests
|
||||
|
@ -22,6 +22,6 @@ func TestCreateTransportOptions(t *testing.T) {
|
||||
opts, err := CreateTransportOptions(context.Background(), settings, backend.NewLoggerWith("logger", "test"))
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, http.Header{"Foo": []string{"bar"}}, opts.Header)
|
||||
require.Equal(t, 2, len(opts.Middlewares))
|
||||
require.Equal(t, 1, len(opts.Middlewares))
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user