Support binary response bodies in _performSecureRequest #133

Open
evanp opened this Issue Mar 11, 2013 · 0 comments

Comments

Projects
None yet
1 participant
Contributor

evanp commented Mar 11, 2013

The response handler in _performSecureRequest forces the data returned to a string. The data variable is initialized to an empty string, and then each chunk of data is appended with +=.

It would be nice to do some detection on the Content-Type and for known binary types (image/, audio/, video/* at least) use a Buffer object instead.

@evanp evanp added a commit to evanp/node-oauth that referenced this issue Mar 11, 2013

@evanp evanp Support binary response bodies in _performSecureRequest
Change the response handling in _performSecureRequest so it can handle
binary data types in the response body. If it detects a response with
a content-type that looks binary (by default, image/*, audio/*, and
video/* types), it stores the body in a Buffer rather than an UTF-8
string.

Closes #133.
41c5405

@SamDecrock SamDecrock added a commit to SamDecrock/node-oauth that referenced this issue Apr 10, 2014

@SamDecrock SamDecrock added binary support, fixes #133 6a4ef5a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment