[ 
https://issues.apache.org/jira/browse/THRIFT-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Randy Abernethy updated THRIFT-2844:
------------------------------------
    Attachment: 0001-browserify-update-for-ArrayBuffer.patch

Hey Chi/Cameron,

First thanks for the patch. Will be nice to get the kinks out of the Thrift 
Node.js/Browserify combo.

I have one concern with the current implementation. It adds responseType to the 
nodeOptions object. This object is passed to Node and should only contain legal 
Node.js input. I do not think responseType is a current Node.js http.request() 
option. So if we were to add responseType I suspect it would belong in the 
Thrift ConnectOptions object (of which nodeOptions is an attribute). That said, 
responseType doesn't appear to be used anywhere in the Thrift library, this 
being the case I suggest we omit it. 

If you guys are ok with the attached patch I will commit it. If there are still 
issues outstanding, let me know. Please note that I am running the Node tests 
(and the JS grunt tests) and have made no effort to verify correct operation 
under Browserify. Would be nice to add a Browserify test at some point.

Best,
Randy


> 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