MCPcopy
hub / github.com/grafana/tempo / httpGRPCResponseToHTTPResponse

Function httpGRPCResponseToHTTPResponse

modules/frontend/v1/request_batch.go:123–136  ·  view source on GitHub ↗
(resp *httpgrpc.HTTPResponse)

Source from the content-addressed store, hash-verified

121}
122
123func httpGRPCResponseToHTTPResponse(resp *httpgrpc.HTTPResponse) *http.Response {
124 // translate back
125 httpResp := &http.Response{
126 StatusCode: int(resp.Code),
127 Body: &buffer{buff: resp.Body, ReadCloser: io.NopCloser(bytes.NewReader(resp.Body))},
128 Header: http.Header{},
129 ContentLength: int64(len(resp.Body)),
130 }
131 for _, h := range resp.Headers {
132 httpResp.Header[h.Key] = h.Values
133 }
134
135 return httpResp
136}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected