Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postman-request

Package Overview
Dependencies
Maintainers
3
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postman-request - npm Package Compare versions

Comparing version 2.88.1-postman.19 to 2.88.1-postman.20

2

package.json

@@ -10,3 +10,3 @@ {

],
"version": "2.88.1-postman.19",
"version": "2.88.1-postman.20",
"repository": {

@@ -13,0 +13,0 @@ "type": "git",

@@ -380,2 +380,17 @@

### Blacklisting headers
Use `options.blacklistHeaders` option to blacklist the list of headers from requests and redirects.
```js
var options = {
setHost: false, // set false to disable addition of `Host` header
blacklistHeaders: ['connection', 'content-length', 'transfer-encoding']
}
request.post('http://localhost:3000', options, function(err, res, body) {
// "POST / HTTP/1.1\r\n\r\n"
});
```
[back to top](#table-of-contents)

@@ -382,0 +397,0 @@

@@ -370,4 +370,5 @@ 'use strict'

self.setHost = false
if (!self.hasHeader('host')) {
// Add `Host` header if not defined already
self.setHost = (self.setHost === undefined || Boolean(self.setHost))
if (!self.hasHeader('host') && self.setHost) {
var hostHeaderName = self.originalHostHeaderName || 'Host'

@@ -382,3 +383,2 @@ self.setHeader(hostHeaderName, self.uri.host)

}
self.setHost = true
}

@@ -893,2 +893,13 @@

self.req = self.httpModule.request(reqOptions)
// Remove blacklisted headers from the request instance.
// @note don't check for `hasHeader` because headers like `connection`,
// 'content-length', 'transfer-encoding' etc. are added at the very end
// and `removeHeader` updates the Node.js internal state which makes sure
// these headers are not added.
if (Array.isArray(self.blacklistHeaders) && self.blacklistHeaders.length) {
self.blacklistHeaders.forEach(function (header) {
self.req.removeHeader(header)
})
}
} catch (err) {

@@ -895,0 +906,0 @@ self.emit('error', err)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc