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.29 to 2.88.1-postman.30

2

package.json

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

],
"version": "2.88.1-postman.29",
"version": "2.88.1-postman.30",
"repository": {

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

@@ -130,2 +130,45 @@ 'use strict'

/**
* Return request headers in [{key: headerName, value: headerValue}] form
* @param {String} [headerString] - headers string created by Node stored in ClientRequest._header
*
* */
function parseRequestHeaders (headerString) {
var arr = headerString.split('\r\n')
var acc = []
// first element of accumulator is not a header
// last two elements are empty strings
for (var i = 1; i < arr.length - 2; i++) {
// header name cannot have a ':' but header value allows it
// therefore we split on the index of the first ':'
var splitIndex = arr[i].indexOf(':')
acc.push({
key: arr[i].slice(0, splitIndex),
value: arr[i].slice(splitIndex + 2)
})
}
return acc
}
/**
* Return response headers in [{key: headerName, value: headerValue}] form
* @param {Array} [rawHeaders] - https://nodejs.org/api/http.html#http_message_rawheaders
*
* */
function parseResponseHeaders (rawHeaders) {
var acc = []
for (var i = 0; i < rawHeaders.length; i = i + 2) {
acc.push({
key: rawHeaders[i],
value: rawHeaders[i + 1]
})
}
return acc
}
function Request (options) {

@@ -898,3 +941,3 @@ // if given the method property in options, set property explicitMethod to true

href: self.uri.href,
headers: this.headers,
headers: [],
proxy: (self.proxy && { href: self.proxy.href }) || undefined,

@@ -1232,3 +1275,3 @@ httpVersion: '1.1'

statusCode: response.statusCode,
headers: response.headers,
headers: parseResponseHeaders(response.rawHeaders),
httpVersion: response.httpVersion

@@ -1905,2 +1948,4 @@ }

self.req.end()
self.req._header && (self._reqResInfo.request.headers = parseRequestHeaders(self.req._header))
}

@@ -1907,0 +1952,0 @@ }

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