postman-request
Advanced tools
Comparing version 2.81.1-postman.1 to 2.81.1-postman.2
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "2.81.1-postman.1", | ||
"version": "2.81.1-postman.2", | ||
"repository": { | ||
@@ -46,2 +46,3 @@ "type": "git", | ||
"safe-buffer": "^5.0.1", | ||
"stream-length": "^1.0.2", | ||
"stringstream": "~0.0.4", | ||
@@ -48,0 +49,0 @@ "tough-cookie": "~2.3.0", |
@@ -9,2 +9,3 @@ | ||
- Redirect behavior for 307 responses when Host header is set: https://github.com/request/request/issues/2666 | ||
- Fix missing `content-length` header for streaming requests: https://github.com/request/request/issues/316 | ||
@@ -11,0 +12,0 @@ ## Super simple to use |
@@ -20,2 +20,3 @@ 'use strict' | ||
var isstream = require('isstream') | ||
var streamLength = require('stream-length') | ||
var isTypedArray = require('is-typedarray').strict | ||
@@ -540,3 +541,12 @@ var helpers = require('./lib/helpers') | ||
if (isstream(self.body)) { | ||
self.body.pipe(self) | ||
if (self.hasHeader('content-length')) { | ||
self.body.pipe(self) | ||
} else { // certain servers require content-length to function. we try to pre-detect if possible | ||
streamLength(self.body, {}, function (err, len) { | ||
if (!(err || self._started || self.hasHeader('content-length') || len === null || len < 0)) { | ||
self.setHeader('content-length', len) | ||
} | ||
self.body.pipe(self) | ||
}) | ||
} | ||
} else { | ||
@@ -543,0 +553,0 @@ setContentLength() |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
206388
2636
1095
24
4
+ Addedstream-length@^1.0.2
+ Addedbluebird@2.11.0(transitive)
+ Addedstream-length@1.0.2(transitive)