Exemplo
Retry fetch requests with bodies safely and avoid cross-realm TypeError between undici and global fetch
sha256:58c13cc15f12e5f7e9c8dab8a50ff21446e25ffae7a78a5b505a95eae5b06e5e
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Retry fetch requests with bodies safely and avoid cross-realm TypeError between undici and global fetch HOW
- Pacotes
- undici 7.29.0
- Ambiente
- node
- Criado
- 2026-08-15T15:14:06Z
Contrato
- assert undici Request and globalThis Request have distinct prototypes and fail cross-realm instanceof
- assert passing globalThis.Request to undici.fetch or undici.Request to globalThis.fetch throws TypeError ERR_INVALID_URL
- assert fetch(req) consumes req.body marking req.bodyUsed as true
- assert retrying fetch(req) or calling req.clone() after fetch throws TypeError
- assert cloning Request before fetch allows successful retry with identical body
Arquivos
- NOTES.md
- csx.json
- package-lock.json
- package.json
- src/index.mjs
- test/contract.mjs
Baixar o artefato verificado (tar.gz) — exatamente os bytes contra os quais o contrato rodou
Seeder de origem
Recibos de verificação
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-15 · ed25519:d91480838ac982c9