Comparing version 2.67.0 to 2.68.0
## Change Log | ||
### v2.68.0 (2016/01/27) | ||
- [#2036](https://github.com/request/request/pull/2036) Add AWS Signature Version 4 (@simov, @mirkods) | ||
- [#2022](https://github.com/request/request/pull/2022) Convert numeric multipart bodies to string (@simov, @feross) | ||
- [#2024](https://github.com/request/request/pull/2024) Update har-validator dependency for nsp advisory #76 (@TylerDixon) | ||
- [#2016](https://github.com/request/request/pull/2016) Update qs to version 6.0.2 🚀 (@greenkeeperio-bot) | ||
- [#2007](https://github.com/request/request/pull/2007) Use the `extend` module instead of util._extend (@simov) | ||
- [#2003](https://github.com/request/request/pull/2003) Update browserify to version 13.0.0 🚀 (@greenkeeperio-bot) | ||
- [#1989](https://github.com/request/request/pull/1989) Update buffer-equal to version 1.0.0 🚀 (@greenkeeperio-bot) | ||
- [#1956](https://github.com/request/request/pull/1956) Check form-data content-length value before setting up the header (@jongyoonlee) | ||
- [#1958](https://github.com/request/request/pull/1958) Use IncomingMessage.destroy method (@simov) | ||
- [#1952](https://github.com/request/request/pull/1952) Adds example for Tor proxy (@prometheansacrifice) | ||
- [#1943](https://github.com/request/request/pull/1943) Update eslint to version 1.10.3 🚀 (@simov, @greenkeeperio-bot) | ||
- [#1924](https://github.com/request/request/pull/1924) Update eslint to version 1.10.1 🚀 (@greenkeeperio-bot) | ||
- [#1915](https://github.com/request/request/pull/1915) Remove content-length and transfer-encoding headers from defaultProxyHeaderWhiteList (@yaxia) | ||
### v2.67.0 (2015/11/19) | ||
@@ -458,3 +473,3 @@ - [#1913](https://github.com/request/request/pull/1913) Update http-signature to version 1.1.0 🚀 (@greenkeeperio-bot) | ||
### v2.17.0 (2013/04/22) | ||
### v2.18.0 (2013/04/22) | ||
- [#523](https://github.com/request/request/pull/523) Updating dependencies (@noway421) | ||
@@ -461,0 +476,0 @@ - [#520](https://github.com/request/request/pull/520) Fixing test-tunnel.js (@noway421) |
@@ -6,3 +6,3 @@ 'use strict' | ||
var validate = require('har-validator') | ||
var util = require('util') | ||
var extend = require('extend') | ||
@@ -122,3 +122,4 @@ function Har (request) { | ||
var har = util._extend({}, options.har) | ||
var har = {} | ||
extend(har, options.har) | ||
@@ -125,0 +126,0 @@ // only process the first entry |
@@ -71,2 +71,5 @@ 'use strict' | ||
function add (part) { | ||
if (typeof part === 'number') { | ||
part = part.toString() | ||
} | ||
return chunked ? body.append(part) : body.push(new Buffer(part)) | ||
@@ -73,0 +76,0 @@ } |
@@ -15,3 +15,2 @@ 'use strict' | ||
'content-language', | ||
'content-length', | ||
'content-location', | ||
@@ -28,3 +27,2 @@ 'content-md5', | ||
'te', | ||
'transfer-encoding', | ||
'user-agent', | ||
@@ -31,0 +29,0 @@ 'via' |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "2.67.0", | ||
"version": "2.68.0", | ||
"author": "Mikeal Rogers <mikeal.rogers@gmail.com>", | ||
@@ -26,22 +26,22 @@ "repository": { | ||
"dependencies": { | ||
"aws-sign2": "~0.6.0", | ||
"bl": "~1.0.0", | ||
"caseless": "~0.11.0", | ||
"combined-stream": "~1.0.5", | ||
"extend": "~3.0.0", | ||
"forever-agent": "~0.6.1", | ||
"form-data": "~1.0.0-rc3", | ||
"har-validator": "~2.0.6", | ||
"hawk": "~3.1.0", | ||
"http-signature": "~1.1.0", | ||
"is-typedarray": "~1.0.0", | ||
"isstream": "~0.1.2", | ||
"json-stringify-safe": "~5.0.1", | ||
"mime-types": "~2.1.7", | ||
"node-uuid": "~1.4.7", | ||
"qs": "~5.2.0", | ||
"tunnel-agent": "~0.4.1", | ||
"tough-cookie": "~2.2.0", | ||
"http-signature": "~1.1.0", | ||
"oauth-sign": "~0.8.0", | ||
"hawk": "~3.1.0", | ||
"aws-sign2": "~0.6.0", | ||
"qs": "~6.0.2", | ||
"stringstream": "~0.0.4", | ||
"combined-stream": "~1.0.5", | ||
"isstream": "~0.1.2", | ||
"is-typedarray": "~1.0.0", | ||
"har-validator": "~2.0.2" | ||
"tough-cookie": "~2.2.0", | ||
"tunnel-agent": "~0.4.1" | ||
}, | ||
@@ -56,12 +56,14 @@ "scripts": { | ||
"devDependencies": { | ||
"aws4": "^1.2.1", | ||
"bluebird": "^3.0.2", | ||
"browserify": "^13.0.0", | ||
"browserify-istanbul": "^0.1.5", | ||
"browserify": "^12.0.1", | ||
"buffer-equal": "^0.0.1", | ||
"buffer-equal": "^1.0.0", | ||
"codecov.io": "^0.1.6", | ||
"coveralls": "^2.11.4", | ||
"eslint": "1.9.0", | ||
"eslint": "1.10.3", | ||
"function-bind": "^1.0.2", | ||
"istanbul": "^0.4.0", | ||
"karma": "^0.13.10", | ||
"karma-browserify": "^4.4.0", | ||
"karma": "^0.13.10", | ||
"karma-cli": "^0.1.1", | ||
@@ -74,5 +76,4 @@ "karma-coverage": "^0.5.3", | ||
"tape": "^4.2.0", | ||
"taper": "^0.4.0", | ||
"bluebird": "^3.0.2" | ||
"taper": "^0.4.0" | ||
} | ||
} |
@@ -757,3 +757,3 @@ | ||
- `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example). | ||
- `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`. Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services) | ||
- `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`. Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services). If you want to use AWS sign version 4 use the parameter `sign_version` with value `4` otherwise the default is version 2. **Note:** you need to `npm install aws4` first. | ||
- `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options. | ||
@@ -760,0 +760,0 @@ |
@@ -11,3 +11,3 @@ 'use strict' | ||
, hawk = require('hawk') | ||
, aws = require('aws-sign2') | ||
, aws2 = require('aws-sign2') | ||
, httpSignature = require('http-signature') | ||
@@ -19,2 +19,3 @@ , mime = require('mime-types') | ||
, FormData = require('form-data') | ||
, extend = require('extend') | ||
, isTypedArray = require('is-typedarray').strict | ||
@@ -128,3 +129,3 @@ , helpers = require('./lib/helpers') | ||
util._extend(self, nonReserved) | ||
extend(self, nonReserved) | ||
options = filterOutReservedFunctions(reserved, options) | ||
@@ -585,3 +586,3 @@ | ||
self._form.getLength(function (err, length) { | ||
if (!err) { | ||
if (!err && !isNaN(length)) { | ||
self.setHeader('content-length', length) | ||
@@ -1051,3 +1052,3 @@ } | ||
else if (self.response) { | ||
self.response.abort() | ||
self.response.destroy() | ||
} | ||
@@ -1236,25 +1237,48 @@ | ||
} | ||
var date = new Date() | ||
self.setHeader('date', date.toUTCString()) | ||
var auth = | ||
{ key: opts.key | ||
, secret: opts.secret | ||
, verb: self.method.toUpperCase() | ||
, date: date | ||
, contentType: self.getHeader('content-type') || '' | ||
, md5: self.getHeader('content-md5') || '' | ||
, amazonHeaders: aws.canonicalizeHeaders(self.headers) | ||
if (opts.sign_version == 4 || opts.sign_version == '4') { | ||
var aws4 = require('aws4') | ||
// use aws4 | ||
var options = { | ||
host: self.uri.host, | ||
path: self.uri.path, | ||
method: self.method, | ||
headers: { | ||
'content-type': self.getHeader('content-type') || '' | ||
}, | ||
body: self.body | ||
} | ||
var path = self.uri.path | ||
if (opts.bucket && path) { | ||
auth.resource = '/' + opts.bucket + path | ||
} else if (opts.bucket && !path) { | ||
auth.resource = '/' + opts.bucket | ||
} else if (!opts.bucket && path) { | ||
auth.resource = path | ||
} else if (!opts.bucket && !path) { | ||
auth.resource = '/' | ||
var signRes = aws4.sign(options, { | ||
accessKeyId: opts.key, | ||
secretAccessKey: opts.secret | ||
}) | ||
self.setHeader('authorization', signRes.headers.Authorization) | ||
self.setHeader('x-amz-date', signRes.headers['X-Amz-Date']) | ||
} | ||
auth.resource = aws.canonicalizeResource(auth.resource) | ||
self.setHeader('authorization', aws.authorization(auth)) | ||
else { | ||
// default: use aws-sign2 | ||
var date = new Date() | ||
self.setHeader('date', date.toUTCString()) | ||
var auth = | ||
{ key: opts.key | ||
, secret: opts.secret | ||
, verb: self.method.toUpperCase() | ||
, date: date | ||
, contentType: self.getHeader('content-type') || '' | ||
, md5: self.getHeader('content-md5') || '' | ||
, amazonHeaders: aws2.canonicalizeHeaders(self.headers) | ||
} | ||
var path = self.uri.path | ||
if (opts.bucket && path) { | ||
auth.resource = '/' + opts.bucket + path | ||
} else if (opts.bucket && !path) { | ||
auth.resource = '/' + opts.bucket | ||
} else if (!opts.bucket && path) { | ||
auth.resource = path | ||
} else if (!opts.bucket && !path) { | ||
auth.resource = '/' | ||
} | ||
auth.resource = aws2.canonicalizeResource(auth.resource) | ||
self.setHeader('authorization', aws2.authorization(auth)) | ||
} | ||
@@ -1261,0 +1285,0 @@ return self |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
188041
2362
20
+ Addedqs@6.0.4(transitive)
- Removedqs@5.2.1(transitive)
Updatedhar-validator@~2.0.6
Updatedqs@~6.0.2