| 197 | } |
| 198 | |
| 199 | func 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 | |
| 208 | func (s *proxyServer) storeEvent(ctx context.Context, req *capturedRequest, resp *capturedResponse, durationMs float64, proxyErr string) { |
| 209 | inc := buildHTTPDumpEvent(req, resp, durationMs, proxyErr) |