Socket
Socket
Sign inDemoInstall

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.16 to 2.88.1-postman.17

lib/brotli.js

3

lib/inflate.js

@@ -6,2 +6,3 @@ 'use strict'

var inherit = require('util').inherits
var Buffer = require('safe-buffer').Buffer
var Inflate

@@ -21,3 +22,3 @@

// If the response stream does not have a valid deflate header, use `InflateRaw`
if ((new Buffer(chunk, encoding)[0] & 0x0F) === 0x08) {
if ((Buffer.from(chunk, encoding)[0] & 0x0F) === 0x08) {
self._stream = zlib.createInflate(self.options)

@@ -24,0 +25,0 @@ } else {

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

],
"version": "2.88.1-postman.16",
"version": "2.88.1-postman.17",
"repository": {

@@ -27,4 +27,6 @@ "type": "git",

"dependencies": {
"@postman/tunnel-agent": "^0.6.3",
"aws-sign2": "~0.7.0",
"aws4": "^1.8.0",
"brotli": "~1.3.2",
"caseless": "~0.12.0",

@@ -34,3 +36,3 @@ "combined-stream": "~1.0.6",

"forever-agent": "~0.6.1",
"form-data": "~2.3.2",
"@postman/form-data": "~3.1.0",
"har-validator": "~5.1.3",

@@ -49,3 +51,2 @@ "http-signature": "~1.2.0",

"tough-cookie": "~2.5.0",
"@postman/tunnel-agent": "^0.6.3",
"uuid": "^3.3.2"

@@ -52,0 +53,0 @@ },

@@ -929,2 +929,3 @@

- `gzip` - if `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.
- `brotli` - if `true`, add an `Accept-Encoding` header to request Brotli compressed content encodings from the server (if not already present).
- `jar` - if `true`, remember cookies for future use (or define your custom cookie jar; see examples section)

@@ -931,0 +932,0 @@

@@ -36,2 +36,3 @@ 'use strict'

var inflate = require('./lib/inflate')
var brotli = require('./lib/brotli')
var urlParse = require('./lib/url-parse')

@@ -445,4 +446,13 @@ var safeStringify = helpers.safeStringify

if (self.gzip && !self.hasHeader('accept-encoding')) {
self.setHeader('Accept-Encoding', 'gzip, deflate')
if (!self.hasHeader('accept-encoding')) {
var acceptEncoding = ''
self.gzip && (acceptEncoding += 'gzip, deflate')
if (self.brotli) {
acceptEncoding && (acceptEncoding += ', ')
acceptEncoding += 'br'
}
acceptEncoding && self.setHeader('Accept-Encoding', acceptEncoding)
}

@@ -1231,3 +1241,3 @@

var responseContent
if (self.gzip && !noBody(response.statusCode)) {
if ((self.gzip || self.brotli) && !noBody(response.statusCode)) {
var contentEncoding = response.headers['content-encoding'] || 'identity'

@@ -1245,8 +1255,11 @@ contentEncoding = contentEncoding.trim().toLowerCase()

if (contentEncoding === 'gzip') {
if (self.gzip && contentEncoding === 'gzip') {
responseContent = zlib.createGunzip(zlibOptions)
response.pipe(responseContent)
} else if (contentEncoding === 'deflate') {
} else if (self.gzip && contentEncoding === 'deflate') {
responseContent = inflate.createInflate(zlibOptions)
response.pipe(responseContent)
} else if (self.brotli && contentEncoding === 'br') {
responseContent = brotli.createBrotliDecompress()
response.pipe(responseContent)
} else {

@@ -1253,0 +1266,0 @@ // Since previous versions didn't check for Content-Encoding header,

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