Summary
estimateRequestBytes (src/core/interceptor.ts:94-106) reads init.body only. When the caller constructs a Request object first and passes it to fetch, the body lives on the Request, not on a separate init argument — the SDK records 0 bytes. Common pattern in undici users and Next.js route handlers.
Fix
When the input is a Request, read input.body or input.headers.get("content-length") (the latter doesn't consume the stream).
Files
src/core/interceptor.ts
tests/interceptor.test.ts
Priority
P2 — underreports request bytes for a common modern pattern.
Summary
estimateRequestBytes(src/core/interceptor.ts:94-106) readsinit.bodyonly. When the caller constructs aRequestobject first and passes it tofetch, the body lives on the Request, not on a separateinitargument — the SDK records 0 bytes. Common pattern in undici users and Next.js route handlers.Fix
When the input is a Request, read
input.bodyorinput.headers.get("content-length")(the latter doesn't consume the stream).Files
src/core/interceptor.tstests/interceptor.test.tsPriority
P2 — underreports request bytes for a common modern pattern.