Create a transport adapter for CmcdReportRecorder that patches
globalThis.fetch to capture requests with CMCD data. The patched
fetch normalizes each request to HttpRequest (lowercase headers,
body read as a UTF-8 string).
The patched fetch reads each body once with Request.text() for
inspection. This read is safe for the body types that CMCD reports use
in practice: string, Blob, ArrayBuffer, FormData, and
URLSearchParams. The underlying fetch can read those bodies again.
Do not pass a ReadableStream as init.body. The patched fetch
consumes the stream, and the underlying fetch receives an
already-disturbed stream.
Create a transport adapter for
CmcdReportRecorderthat patchesglobalThis.fetchto capture requests with CMCD data. The patchedfetchnormalizes each request toHttpRequest(lowercase headers, body read as a UTF-8 string).The patched
fetchreads each body once withRequest.text()for inspection. This read is safe for the body types that CMCD reports use in practice:string,Blob,ArrayBuffer,FormData, andURLSearchParams. The underlyingfetchcan read those bodies again. Do not pass aReadableStreamasinit.body. The patchedfetchconsumes the stream, and the underlyingfetchreceives an already-disturbed stream.