MCPcopy Create free account
hub / github.com/cortexproject/cortex / createRequestWithHeaders

Function createRequestWithHeaders

pkg/util/push/push_test.go:1141–1151  ·  view source on GitHub ↗
(t *testing.T, headers map[string]string, protobuf []byte)

Source from the content-addressed store, hash-verified

1139}
1140
1141func createRequestWithHeaders(t *testing.T, headers map[string]string, protobuf []byte) *http.Request {
1142 t.Helper()
1143 inoutBytes := snappy.Encode(nil, protobuf)
1144 req, err := http.NewRequest("POST", "http://localhost/", bytes.NewReader(inoutBytes))
1145 require.NoError(t, err)
1146
1147 for k, v := range headers {
1148 req.Header.Set(k, v)
1149 }
1150 return req
1151}
1152
1153func createRequest(t *testing.T, protobuf []byte, isV2 bool) *http.Request {
1154 t.Helper()

Calls 2

EncodeMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected