(body: string)
| 25 | /** The batch re-serialized with every URL scrubbed, or `undefined` when it is |
| 26 | * not valid JSON (or too deep to scrub) and must be refused. */ |
| 27 | const scrubbedBatch = (body: string): string | undefined => { |
| 28 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: JSON.parse throws on malformed input; the refusal path (400) is the handled outcome |
| 29 | try { |
| 30 | // oxlint-disable-next-line executor/no-json-parse -- boundary: the batch is deliberately unknown-shaped (the scrub walks arbitrary JSON); there is no schema to decode into |
| 31 | return JSON.stringify(redactOtlpTraceExport(JSON.parse(body))); |
| 32 | } catch { |
| 33 | return undefined; |
| 34 | } |
| 35 | }; |
| 36 | |
| 37 | export const browserTracesResponse = ( |
| 38 | request: Request, |
no test coverage detected