Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert typed arrays into regular buffers #1905

Merged
merged 1 commit into from Nov 17, 2015

Conversation

simov
Copy link
Member

@simov simov commented Nov 16, 2015

Fixes #1904

This bug was introduced in #1733 regarding this issue #1732

Bringing back the code that was removed in #1733. Converting to Buffer happens only when the body is a typed array. That way this won't affect the performance fix for #1732

One additional dependency was needed is-typedarray

simov added a commit that referenced this pull request Nov 17, 2015
Convert typed arrays into regular buffers
@simov simov merged commit a7f7e75 into request:master Nov 17, 2015
@NNM11
Copy link

NNM11 commented Dec 3, 2015

I just installed request v1.4.28. It is not fixed. I still got this error :

"http.js:852
throw new TypeError('first argument must be a string or Buffer');
^
TypeError: first argument must be a string or Buffer
at ClientRequest.OutgoingMessage.write (http.js:852:11)

at Request.write (/usr/hdc-solution/node_modules/request/request.js:1347:25)"

with
var indata = { 'key':'value', 'num':number'};
var opts = {
url : endpoint,
proxy : proxyUrl,
method : "POST",
headers : {
'Content-Type' : 'application/json', // HDC data type specific
'Content-Length' : Buffer.byteLength(JSON.stringify(indata))
},
json : indata
};

@simov
Copy link
Member Author

simov commented Dec 4, 2015

I just installed request v1.4.28. It is not fixed.

The latest request version is 2.67.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

first argument must be a string of Buffer
2 participants