Open catdevnull opened 1 year ago
Can you add a proper test with the tar that fails as a fixture, without the fetch and stream wrappers
I don't really know what's the issue so I can't develop a proper fixture for it, but here you go: https://gitea.nulo.in/Nulo/tar-stream (uploaded to a self-hosted repo because GitHub doesn't allow LFS in forks...)
I'm encountering a similar (but maybe completely different?) issue.
I'm using tar-stream
with feross/buffer
in React Native (and a tar
file generated with tar-stream
).
For me, val.subarray(offset, end).toString()
in decodeOct
is evaluating to a list of numbers instead of as ASCII (e.g. 48,48,48,54,52,52
instead of 000644
).
https://github.com/mafintosh/tar-stream/blob/03da589543d45a4eeed561b4029e4b538e4fa990/headers.js#L307
Replacing that line with
return parseInt(Buffer.from(val).toString('utf-8', offset, end), 8)
and adding
const {Buffer} = require('buffer');
to the top of the file seems to fix the issue.
Edit: Upstream issue: https://github.com/feross/buffer/issues/329
I ran into a similar problem as @personalizedrefrigerator and ended up submitting a PR for it: https://github.com/mafintosh/tar-stream/pull/164
repro: