Create a transport adapter that patches globalThis.fetch to capture
CMCD-bearing requests, normalizing each to HttpRequest (lowercase
headers, body read as UTF-8 string). Returns the adapter object
expected by CmcdReportRecorder.
Bodies are read once via Request.text() for inspection. This is
safe for the body types CMCD reports use in practice (string,
Blob, ArrayBuffer, FormData, URLSearchParams), which can be
read by the wrapper and re-read by the underlying fetch. Passing
a ReadableStream as init.body is not supported — the stream is
consumed by the wrapper and the underlying fetch will receive an
already-disturbed stream.
Create a transport adapter that patches
globalThis.fetchto capture CMCD-bearing requests, normalizing each toHttpRequest(lowercase headers, body read as UTF-8 string). Returns the adapter object expected byCmcdReportRecorder.Bodies are read once via
Request.text()for inspection. This is safe for the body types CMCD reports use in practice (string,Blob,ArrayBuffer,FormData,URLSearchParams), which can be read by the wrapper and re-read by the underlyingfetch. Passing aReadableStreamasinit.bodyis not supported — the stream is consumed by the wrapper and the underlyingfetchwill receive an already-disturbed stream.