MCPcopy Create free account
hub / github.com/PostHog/duckgres / previewBody

Function previewBody

cmd/cache-proxy/proxy.go:653–659  ·  view source on GitHub ↗

previewBody returns up to 256 bytes of the body for log lines so we don't spam multi-KiB XML envelopes into structured logs while still keeping the useful prefix (S3 puts the ... first).

(body []byte)

Source from the content-addressed store, hash-verified

651
652 req, err := http.NewRequestWithContext(ctx, r.Method, r.URL.String(), nil)
653 if err != nil {
654 return 0, "", err
655 }
656 for k, vv := range r.Header {
657 if hopByHop[strings.ToLower(k)] || isInternalPropagationHeader(k) {
658 continue
659 }
660 for _, v := range vv {
661 req.Header.Add(k, v)
662 }

Callers 2

HandleProxyMethod · 0.85
forwardUncachedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected