Socket
Socket
Sign inDemoInstall

request

Package Overview
Dependencies
Maintainers
4
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

request - npm Package Compare versions

Comparing version 2.64.0 to 2.65.0

15

CHANGELOG.md
## Change Log
### v2.65.0 (2015/10/11)
- [#1833](https://github.com/request/request/pull/1833) Update aws-sign2 to version 0.6.0 🚀 (@greenkeeperio-bot)
- [#1811](https://github.com/request/request/pull/1811) Enable loose cookie parsing in tough-cookie (@Sebmaster)
- [#1830](https://github.com/request/request/pull/1830) Bring back tilde ranges for all dependencies (@simov)
- [#1821](https://github.com/request/request/pull/1821) Implement support for RFC 2617 MD5-sess algorithm. (@BigDSK)
- [#1828](https://github.com/request/request/pull/1828) Updated qs dependency to 5.2.0 (@acroca)
- [#1818](https://github.com/request/request/pull/1818) Extract `readResponseBody` method out of `onRequestResponse` (@pvoisin)
- [#1819](https://github.com/request/request/pull/1819) Run stringify once (@mgenereu)
- [#1814](https://github.com/request/request/pull/1814) Updated har-validator to version 2.0.2 (@greenkeeperio-bot)
- [#1807](https://github.com/request/request/pull/1807) Updated tough-cookie to version 2.1.0 (@greenkeeperio-bot)
- [#1800](https://github.com/request/request/pull/1800) Add caret ranges for devDependencies, except eslint (@simov)
- [#1799](https://github.com/request/request/pull/1799) Updated karma-browserify to version 4.4.0 (@greenkeeperio-bot)
- [#1797](https://github.com/request/request/pull/1797) Updated tape to version 4.2.0 (@greenkeeperio-bot)
- [#1788](https://github.com/request/request/pull/1788) Pinned all dependencies (@greenkeeperio-bot)
### v2.64.0 (2015/09/25)

@@ -4,0 +19,0 @@ - [#1787](https://github.com/request/request/pull/1787) npm ignore examples, release.sh and disabled.appveyor.yml (@thisconnect)

23

lib/auth.js

@@ -53,4 +53,2 @@ 'use strict'

// TODO: More complete implementation of RFC 2617.
// - check challenge.algorithm
// - support algorithm="MD5-sess"
// - handle challenge.domain

@@ -77,7 +75,24 @@ // - support qop="auth-int" only

var ha1 = md5(self.user + ':' + challenge.realm + ':' + self.pass)
var ha2 = md5(method + ':' + path)
/**
* RFC 2617: handle both MD5 and MD5-sess algorithms.
*
* If the algorithm directive's value is "MD5" or unspecified, then HA1 is
* HA1=MD5(username:realm:password)
* If the algorithm directive's value is "MD5-sess", then HA1 is
* HA1=MD5(MD5(username:realm:password):nonce:cnonce)
*/
var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) {
var ha1 = md5(user + ':' + realm + ':' + pass)
if (algorithm && algorithm.toLowerCase() === 'md5-sess') {
return md5(ha1 + ':' + nonce + ':' + cnonce)
} else {
return ha1
}
}
var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth'
var nc = qop && '00000001'
var cnonce = qop && uuid().replace(/-/g, '')
var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce)
var ha2 = md5(method + ':' + path)
var digestResponse = qop

@@ -84,0 +99,0 @@ ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2)

4

lib/cookies.js

@@ -16,3 +16,3 @@ 'use strict'

}
return Cookie.parse(str)
return Cookie.parse(str, {loose: true})
}

@@ -23,3 +23,3 @@

var self = this
self._jar = new CookieJar(store)
self._jar = new CookieJar(store, {looseMode: true})
}

@@ -26,0 +26,0 @@ RequestJar.prototype.setCookie = function(cookieOrStr, uri, options) {

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

],
"version": "2.64.0",
"version": "2.65.0",
"author": "Mikeal Rogers <mikeal.rogers@gmail.com>",

@@ -29,18 +29,18 @@ "repository": {

"extend": "~3.0.0",
"forever-agent": "~0.6.0",
"form-data": "~1.0.0-rc1",
"json-stringify-safe": "~5.0.0",
"mime-types": "~2.1.2",
"node-uuid": "~1.4.0",
"qs": "~5.1.0",
"tunnel-agent": "~0.4.0",
"tough-cookie": ">=0.12.0",
"forever-agent": "~0.6.1",
"form-data": "~1.0.0-rc3",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.7",
"node-uuid": "~1.4.3",
"qs": "~5.2.0",
"tunnel-agent": "~0.4.1",
"tough-cookie": "~2.2.0",
"http-signature": "~0.11.0",
"oauth-sign": "~0.8.0",
"hawk": "~3.1.0",
"aws-sign2": "~0.5.0",
"aws-sign2": "~0.6.0",
"stringstream": "~0.0.4",
"combined-stream": "~1.0.1",
"isstream": "~0.1.1",
"har-validator": "^1.6.1"
"combined-stream": "~1.0.5",
"isstream": "~0.1.2",
"har-validator": "~2.0.2"
},

@@ -55,22 +55,22 @@ "scripts": {

"devDependencies": {
"browserify": "~5.9.1",
"browserify-istanbul": "~0.1.3",
"buffer-equal": "0.0.1",
"codecov.io": "~0.1.2",
"coveralls": "~2.11.2",
"browserify-istanbul": "^0.1.5",
"browserify": "^11.2.0",
"buffer-equal": "^0.0.1",
"codecov.io": "^0.1.6",
"coveralls": "^2.11.4",
"eslint": "0.18.0",
"function-bind": "~1.0.0",
"istanbul": "~0.3.2",
"karma": "~0.12.21",
"karma-browserify": "~3.0.1",
"karma-cli": "0.0.4",
"karma-coverage": "0.2.6",
"karma-phantomjs-launcher": "~0.1.4",
"karma-tap": "~1.0.1",
"rimraf": "~2.2.8",
"server-destroy": "~1.0.0",
"tape": "~3.0.0",
"taper": "~0.4.0",
"bluebird": "~2.9.21"
"function-bind": "^1.0.2",
"istanbul": "^0.3.21",
"karma-browserify": "^4.4.0",
"karma": "^0.13.10",
"karma-cli": "^0.1.1",
"karma-coverage": "^0.2.6",
"karma-phantomjs-launcher": "^0.1.4",
"karma-tap": "^1.0.3",
"rimraf": "^2.2.8",
"server-destroy": "^1.0.1",
"tape": "^4.2.0",
"taper": "^0.4.0",
"bluebird": "^2.10.1"
}
}

@@ -1017,50 +1017,3 @@ 'use strict'

if (self.callback) {
var buffer = bl()
, strings = []
self.on('data', function (chunk) {
if (Buffer.isBuffer(chunk)) {
buffer.append(chunk)
} else {
strings.push(chunk)
}
})
self.on('end', function () {
debug('end event', self.uri.href)
if (self._aborted) {
debug('aborted', self.uri.href)
return
}
if (buffer.length) {
debug('has body', self.uri.href, buffer.length)
if (self.encoding === null) {
// response.body = buffer
// can't move to this until https://github.com/rvagg/bl/issues/13
response.body = buffer.slice()
} else {
response.body = buffer.toString(self.encoding)
}
} else if (strings.length) {
// The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation.
// Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse().
if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') {
strings[0] = strings[0].substring(1)
}
response.body = strings.join('')
}
if (self._json) {
try {
response.body = JSON.parse(response.body, self._jsonReviver)
} catch (e) {
debug('invalid JSON received', self.uri.href)
}
}
debug('emitting complete', self.uri.href)
if (typeof response.body === 'undefined' && !self._json) {
response.body = self.encoding === null ? new Buffer(0) : ''
}
self.emit('complete', response, response.body)
})
self.readResponseBody(response)
}

@@ -1081,2 +1034,55 @@ //if no callback

Request.prototype.readResponseBody = function (response) {
var self = this
debug('reading response\'s body')
var buffer = bl()
, strings = []
self.on('data', function (chunk) {
if (Buffer.isBuffer(chunk)) {
buffer.append(chunk)
} else {
strings.push(chunk)
}
})
self.on('end', function () {
debug('end event', self.uri.href)
if (self._aborted) {
debug('aborted', self.uri.href)
return
}
if (buffer.length) {
debug('has body', self.uri.href, buffer.length)
if (self.encoding === null) {
// response.body = buffer
// can't move to this until https://github.com/rvagg/bl/issues/13
response.body = buffer.slice()
} else {
response.body = buffer.toString(self.encoding)
}
} else if (strings.length) {
// The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation.
// Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse().
if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') {
strings[0] = strings[0].substring(1)
}
response.body = strings.join('')
}
if (self._json) {
try {
response.body = JSON.parse(response.body, self._jsonReviver)
} catch (e) {
debug('invalid JSON received', self.uri.href)
}
}
debug('emitting complete', self.uri.href)
if (typeof response.body === 'undefined' && !self._json) {
response.body = self.encoding === null ? new Buffer(0) : ''
}
self.emit('complete', response, response.body)
})
}
Request.prototype.abort = function () {

@@ -1148,8 +1154,8 @@ var self = this

if (self._qs.stringify(base) === '') {
var qs = self._qs.stringify(base)
if (qs === '') {
return self
}
var qs = self._qs.stringify(base)
self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs)

@@ -1156,0 +1162,0 @@ self.url = self.uri

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