Open ssured opened 10 years ago
Thanks for the issue. Are you using this library in NodeJS or in the browser?
Is renaming isBase64
to isBinary
sufficient?
I am using NodeJS right now.
Yes, renaming to isBinary is sufficient.
Even nicer would be to check for a Buffer (content instanceof Buffer
) object, if so, consider it binary data and call content.toString(‘base64’)
. Browsers < IE10 need a little care in that case http://caniuse.com/typedarrays
Hi, I have similar problem. Is relevant? Is this solved?
Thanks for the library!
When writing binary data to GitHub the API seems a little weird. Consider
buffer
to contain a gif image.This code does not work:
This code works:
It feels really weird to provide a binary string and specifying
isBase64
https://github.com/philschatz/octokit.js/blob/master/octokit.js#L764-L766 causes the problem. Some simple API aligning will fix the issue.