Skip to content

Instantly share code, notes, and snippets.

@bcomnes
Created June 21, 2024 00:46
Show Gist options
  • Save bcomnes/432edff3775e158d947b96d7b967e3ac to your computer and use it in GitHub Desktop.
Save bcomnes/432edff3775e158d947b96d7b967e3ac to your computer and use it in GitHub Desktop.
// fetchfail.js
// Getting incorrect results on node 22.3.0
async function main() {
const blobUrl = 'https://socketusercontent.com/blob/QW5l4aR3idwMbxhuLo6o2qaGCUBz5YwKg1ikl7QZaajw'
const res = await fetch(blobUrl, {
method: 'GET'
})
const bytes = await res.arrayBuffer()
console.log('arrayBuffer length:', bytes.byteLength)
const res2 = await fetch(blobUrl, {
method: 'GET'
})
const str = await res2.text()
console.log('string length:', str.length)
}
main().catch(err => { console.error(err) })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment