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

Unify calculating content-length #544

Merged
merged 3 commits into from
Aug 3, 2018

Conversation

szmarczak
Copy link
Collaborator

No description provided.

@@ -32,5 +32,9 @@ module.exports = async options => {
return body._buffer.length;
}

if (body && is.number(body.length)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think && !is.nodeStream(body) is missing here...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this check should be on line 21 for clarity and be if (Buffer.isBuffer(body)) {

@sindresorhus sindresorhus merged commit ba0cb0d into sindresorhus:master Aug 3, 2018
@szmarczak szmarczak deleted the patch-content-length branch January 17, 2019 18:55
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.

None yet

2 participants