[ 
https://issues.apache.org/jira/browse/THRIFT-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14230996#comment-14230996
 ] 

Cameron Ring commented on THRIFT-2844:
--------------------------------------

Randy, thanks for looking into this!

On, responseType, it's used by 
[http-browserify/lib/request.js|https://github.com/substack/http-browserify/blob/master/lib/request.js]:

{code}
    if (params.responseType) try { xhr.responseType = params.responseType }
    catch (e) {}
{code}

Setting the response type is very helpful for returning binary data (otherwise 
it might be misinterpreted as a string with a charset). I'm not sure how to 
pass it down to the browserify implementation of the http module using a 
mechanism other than params (without breaking the interface). If you have any 
suggestions, I'm all ears.

Adding some browserify unit tests would be great. I'll look into adding that if 
I have some time.

thanks,
cam

> Nodejs support broken when running under Browserify
> ---------------------------------------------------
>
>                 Key: THRIFT-2844
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2844
>             Project: Thrift
>          Issue Type: Bug
>          Components: Node.js - Library
>    Affects Versions: 0.9.2
>         Environment: Browserify
>            Reporter: Cameron Ring
>            Assignee: Randy Abernethy
>         Attachments: 0001-browserify-update-for-ArrayBuffer.patch
>
>
> When running under Browserify, the NodeJS binding fails when using the HTTP 
> transport. This happens because Browserify is returning the response as a 
> Uint8Array rather than a Buffer. The fix is straightforward: in 
> response.on('data', wrap any Uint8Arrays in a buffer so the types are as 
> expected.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to