[
https://issues.apache.org/jira/browse/THRIFT-2844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14224230#comment-14224230
]
ASF GitHub Bot commented on THRIFT-2844:
----------------------------------------
GitHub user cameronr opened a pull request:
https://github.com/apache/thrift/pull/287
THRIFT-2844: Nodejs support broken when running under Browserify
Updated PR based on the current master branch
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/cameronr/thrift browserify
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/287.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #287
----
commit c65947ea4c08d7cdf07174e4b2a4197c08165cf6
Author: Cameron Ring <[email protected]>
Date: 2014-11-02T09:17:49Z
Add support for Browserify
When running under Browserify, response.on('data') may be called with a
string or an array buffer (not just with a Buffer). Wrap those types in
a buffer so that response.on('end') is able to process the data
correctly.
commit 1aae4cc1c649e891cd18d4b2931fc588225008af
Author: Cameron Ring <[email protected]>
Date: 2014-11-02T09:25:38Z
Add support for setting responseType
It's convenient to be able to set the expected response type for the
XHR, particularly when receiving binary data.
commit 761662e5a95ce1d8f65fe690676484691cbd02c8
Author: Cameron Ring <[email protected]>
Date: 2014-11-02T09:32:41Z
update comment about Browserify and types
commit 3113434508cb973a170d990d6794284280fa6a3e
Author: Cameron Ring <[email protected]>
Date: 2014-11-13T23:25:46Z
add IE8 support and fix bug with writing
IE8 doesn't have ArrayBuffer types, so use Object.prototype.toString
instead to detect the typed array buffer.
Fix writing binary data when running under Browserify
----
> 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
>
> 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)