Created
June 21, 2024 00:46
-
-
Save bcomnes/432edff3775e158d947b96d7b967e3ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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