Smartling / api-sdk-nodejs

3 stars 10 forks source link

downloadFileAllTranslations encoding error #116

Closed folklorelabs closed 3 weeks ago

folklorelabs commented 1 month ago

Hi -- I'm running into an issue with downloadFileAllTranslations. The return value appears to be always be corrupt. After some digging I found that the function is hard-coded to return the response as a string via response.text() (https://github.com/Smartling/api-sdk-nodejs/blob/master/api/base/index.ts#L138).

I believe this should instead return the actual raw response, or at minimum response.buffer so that it is not lossy. I got it working locally by returning response.arrayBuffer() instead and submitted a PR with these changes.

PavelLoparev commented 3 weeks ago

Fixed with https://github.com/Smartling/api-sdk-nodejs/pull/115