Plugins: Add support for HTTP logger (#46578)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package httpclientprovider
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend/httpclient"
|
||||
@@ -13,6 +15,10 @@ type testContext struct {
|
||||
func (c *testContext) createRoundTripper(name string) http.RoundTripper {
|
||||
return httpclient.RoundTripperFunc(func(req *http.Request) (*http.Response, error) {
|
||||
c.callChain = append(c.callChain, name)
|
||||
return &http.Response{StatusCode: http.StatusOK, Request: req}, nil
|
||||
return &http.Response{
|
||||
StatusCode: http.StatusOK,
|
||||
Request: req,
|
||||
Body: ioutil.NopCloser(bytes.NewBufferString("")),
|
||||
}, nil
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user