MCPcopy Create free account
hub / github.com/buggregator/server / writeResponse

Function writeResponse

modules/proxy/server.go:199–206  ·  view source on GitHub ↗
(w io.Writer, resp *http.Response, body []byte)

Source from the content-addressed store, hash-verified

197}
198
199func writeResponse(w io.Writer, resp *http.Response, body []byte) {
200 fmt.Fprintf(w, "HTTP/%d.%d %s\r\n", resp.ProtoMajor, resp.ProtoMinor, resp.Status)
201 resp.Header.Del("Transfer-Encoding")
202 resp.Header.Set("Content-Length", fmt.Sprintf("%d", len(body)))
203 resp.Header.Write(w)
204 fmt.Fprintf(w, "\r\n")
205 w.Write(body)
206}
207
208func (s *proxyServer) storeEvent(ctx context.Context, req *capturedRequest, resp *capturedResponse, durationMs float64, proxyErr string) {
209 inc := buildHTTPDumpEvent(req, resp, durationMs, proxyErr)

Callers 1

proxyAndRecordMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected