dimer47 / node-ovh-objectstorage

Creative Commons Attribution Share Alike 4.0 International
13 stars 11 forks source link

Fix content encoding in "Get object content" function #12

Closed Relik77 closed 4 years ago

Relik77 commented 4 years ago

Fix content encoding in "Get object content" function. Return binary data as a buffer instead of data encoded in utf8 (because data encoded in utf8 is corrupted for binary files).

@see https://www.npmjs.com/package/request#requestoptions-callback

encoding - encoding to be used on setEncoding of response data. If null, the body is returned as a Buffer. Anything else (including the default value of undefined) will be passed as the encoding parameter to toString() (meaning this is effectively utf8 by default). (Note: if you expect binary data, you should set encoding: null.)