Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorForrest L Norvell <forrest@npmjs.com>2014-11-21 10:04:48 +0300
committerForrest L Norvell <forrest@npmjs.com>2014-11-21 10:04:48 +0300
commita34c38d0732fb246d11f2a776d2ad0d8db654338 (patch)
tree4d288898975ed59c6f32592b18e3504c4dfcc288 /node_modules/request
parent319ccf633289e06e57a80d74c39706899348674c (diff)
request@2.48.0
many small bug fixes, improved OAuth support
Diffstat (limited to 'node_modules/request')
-rw-r--r--node_modules/request/CHANGELOG.md18
-rw-r--r--node_modules/request/CONTRIBUTING.md2
-rw-r--r--node_modules/request/README.md118
-rw-r--r--node_modules/request/node_modules/aws-sign2/package.json3
-rw-r--r--node_modules/request/node_modules/caseless/README.md2
-rw-r--r--node_modules/request/node_modules/caseless/index.js8
-rw-r--r--node_modules/request/node_modules/caseless/package.json17
-rw-r--r--node_modules/request/node_modules/caseless/test.js9
-rw-r--r--node_modules/request/node_modules/combined-stream/lib/combined_stream.js14
-rw-r--r--node_modules/request/node_modules/combined-stream/package.json23
-rw-r--r--node_modules/request/node_modules/forever-agent/package.json3
-rw-r--r--node_modules/request/node_modules/form-data/node_modules/mime/package.json3
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json3
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/ctype/package.json3
-rw-r--r--node_modules/request/node_modules/node-uuid/package.json3
-rw-r--r--node_modules/request/node_modules/oauth-sign/index.js37
-rw-r--r--node_modules/request/node_modules/oauth-sign/package.json25
-rw-r--r--node_modules/request/node_modules/qs/CHANGELOG.md7
-rw-r--r--node_modules/request/node_modules/qs/Makefile8
-rwxr-xr-xnode_modules/request/node_modules/qs/Readme.md2
-rw-r--r--node_modules/request/node_modules/qs/index.js2
-rwxr-xr-xnode_modules/request/node_modules/qs/lib/parse.js1
-rwxr-xr-xnode_modules/request/node_modules/qs/lib/utils.js4
-rw-r--r--[-rwxr-xr-x]node_modules/request/node_modules/qs/package.json20
-rwxr-xr-xnode_modules/request/node_modules/qs/test/parse.js39
-rwxr-xr-xnode_modules/request/node_modules/qs/test/stringify.js4
-rw-r--r--node_modules/request/node_modules/stringstream/package.json3
-rw-r--r--node_modules/request/node_modules/tunnel-agent/package.json3
-rwxr-xr-xnode_modules/request/package.json20
-rwxr-xr-xnode_modules/request/release.sh10
-rw-r--r--node_modules/request/request.js56
31 files changed, 326 insertions, 144 deletions
diff --git a/node_modules/request/CHANGELOG.md b/node_modules/request/CHANGELOG.md
index 40d7f1592..4a0a2cc25 100644
--- a/node_modules/request/CHANGELOG.md
+++ b/node_modules/request/CHANGELOG.md
@@ -1,6 +1,20 @@
## Change Log
-### upcoming (2014/10/26)
+### v2.48.0 (2014/11/12)
+- [#1263](https://github.com/request/request/pull/1263) Fixed a syntax error / typo in README.md (@xna2)
+- [#1253](https://github.com/request/request/pull/1253) Add multipart chunked flag (@simov, @nylen)
+- [#1251](https://github.com/request/request/pull/1251) Clarify that defaults() does not modify global defaults (@nylen)
+- [#1250](https://github.com/request/request/pull/1250) Improve documentation for pool and maxSockets options (@nylen)
+- [#1237](https://github.com/request/request/pull/1237) Documenting error handling when using streams (@vmattos)
+- [#1244](https://github.com/request/request/pull/1244) Finalize changelog command (@nylen)
+- [#1241](https://github.com/request/request/pull/1241) Fix typo (@alexanderGugel)
+- [#1223](https://github.com/request/request/pull/1223) Show latest version number instead of "upcoming" in changelog (@nylen)
+- [#1236](https://github.com/request/request/pull/1236) Document how to use custom CA in README (#1229) (@hypesystem)
+- [#1228](https://github.com/request/request/pull/1228) Support for oauth with RSA-SHA1 signing (@nylen)
+- [#1216](https://github.com/request/request/pull/1216) Made json and multipart options coexist (@nylen, @simov)
+- [#1225](https://github.com/request/request/pull/1225) Allow header white/exclusive lists in any case. (@RReverser)
+
+### v2.47.0 (2014/10/26)
- [#1222](https://github.com/request/request/pull/1222) Move from mikeal/request to request/request (@nylen)
- [#1220](https://github.com/request/request/pull/1220) update qs dependency to 2.3.1 (@FredKSchott)
- [#1212](https://github.com/request/request/pull/1212) Improve tests/test-timeout.js (@nylen)
@@ -295,7 +309,7 @@
- [#280](https://github.com/request/request/pull/280) Like in node.js print options if NODE_DEBUG contains the word request (@Filirom1)
- [#207](https://github.com/request/request/pull/207) Fix #206 Change HTTP/HTTPS agent when redirecting between protocols (@isaacs)
- [#214](https://github.com/request/request/pull/214) documenting additional behavior of json option (@jphaas)
-- [#272](https://github.com/request/request/pull/272) Boundary begins with CRLF? (@proksoup)
+- [#272](https://github.com/request/request/pull/272) Boundary begins with CRLF? (@elspoono)
- [#284](https://github.com/request/request/pull/284) Remove stray `console.log()` call in multipart generator. (@bcherry)
- [#241](https://github.com/request/request/pull/241) Composability updates suggested by issue #239 (@polotek)
- [#282](https://github.com/request/request/pull/282) OAuth Authorization header contains non-"oauth_" parameters (@jplock)
diff --git a/node_modules/request/CONTRIBUTING.md b/node_modules/request/CONTRIBUTING.md
index 17d383e8e..06b1968d9 100644
--- a/node_modules/request/CONTRIBUTING.md
+++ b/node_modules/request/CONTRIBUTING.md
@@ -26,7 +26,7 @@ There are a few basic ground-rules for contributors:
style & testing issues. To diagnose test failures, there are two ways to
run a single test file:
- `node_modules/.bin/taper tests/test-file.js` - run using the default
- [`taper`](/nylen/taper) test reporter.
+ [`taper`](https://github.com/nylen/taper) test reporter.
- `node tests/test-file.js` - view the raw
[tap](https://testanything.org/) output.
diff --git a/node_modules/request/README.md b/node_modules/request/README.md
index 12864ca21..c2c1c860e 100644
--- a/node_modules/request/README.md
+++ b/node_modules/request/README.md
@@ -48,6 +48,17 @@ request
.pipe(request.put('http://mysite.com/img.png'))
```
+To easily handle errors when streaming requests, listen to the `error` event before piping:
+
+```javascript
+request
+ .get('http://mysite.com/doodle.png')
+ .on('error', function(err) {
+ console.log(err)
+ })
+ .pipe(fs.createWriteStream('doodle.png'))
+```
+
Now let’s get fancy.
```javascript
@@ -245,7 +256,7 @@ var formData = {
my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),
// Pass multiple values /w an Array
attachments: [
- fs.createReadStream(__dirname + '/attacment1.jpg')
+ fs.createReadStream(__dirname + '/attacment1.jpg'),
fs.createReadStream(__dirname + '/attachment2.jpg')
],
// Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}
@@ -284,25 +295,37 @@ See the [form-data README](https://github.com/felixge/node-form-data) for more i
Some variations in different HTTP implementations require a newline/CRLF before, after, or both before and after the boundary of a `multipart/related` request (using the multipart option). This has been observed in the .NET WebAPI version 4.0. You can turn on a boundary preambleCRLF or postamble by passing them as `true` to your request options.
```javascript
- request(
- { method: 'PUT'
- , preambleCRLF: true
- , postambleCRLF: true
- , uri: 'http://service.com/upload'
- , multipart:
- [ { 'content-type': 'application/json'
- , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})
- }
- , { body: 'I am an attachment' }
+ request({
+ method: 'PUT',
+ preambleCRLF: true,
+ postambleCRLF: true,
+ uri: 'http://service.com/upload',
+ multipart: [
+ {
+ 'content-type': 'application/json'
+ body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})
+ },
+ { body: 'I am an attachment' },
+ { body: fs.createReadStream('image.png') }
+ ],
+ // alternatively pass an object containing additional options
+ multipart: {
+ chunked: false,
+ data: [
+ {
+ 'content-type': 'application/json',
+ body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})
+ },
+ { body: 'I am an attachment' }
]
}
- , function (error, response, body) {
- if (err) {
- return console.error('upload failed:', err);
- }
- console.log('Upload successful! Server responded with:', body);
+ },
+ function (error, response, body) {
+ if (error) {
+ return console.error('upload failed:', error);
}
- )
+ console.log('Upload successful! Server responded with:', body);
+ })
```
@@ -351,6 +374,10 @@ Bearer authentication is supported, and is activated when the `bearer` value is
## OAuth Signing
+[OAuth version 1.0](https://tools.ietf.org/html/rfc5849) is supported. The
+default signing algorithm is
+[HMAC-SHA1](https://tools.ietf.org/html/rfc5849#section-3.4.2):
+
```javascript
// Twitter OAuth
var qs = require('querystring')
@@ -397,6 +424,12 @@ request.post({url:url, oauth:oauth}, function (e, r, body) {
})
```
+For [RSA-SHA1 signing](https://tools.ietf.org/html/rfc5849#section-3.4.3), make
+the following changes to the OAuth options object:
+* Pass `signature_method : 'RSA-SHA1'`
+* Instead of `consumer_secret`, specify a `private_key` string in
+ [PEM format](http://how2ssl.com/articles/working_with_pem_files/)
+
## Custom HTTP Headers
HTTP Headers, such as `User-Agent`, can be set in the `options` object.
@@ -442,12 +475,12 @@ var fs = require('fs')
var options = {
url: 'https://api.some-server.com/',
agentOptions: {
- 'cert': fs.readFileSync(certFile),
- 'key': fs.readFileSync(keyFile),
+ cert: fs.readFileSync(certFile),
+ key: fs.readFileSync(keyFile),
// Or use `pfx` property replacing `cert` and `key` when using private key, certificate and CA certs in PFX or PKCS12 format:
- // 'pfx': fs.readFileSync(pfxFilePath),
- 'passphrase': 'password',
- 'securityOptions': 'SSL_OP_NO_SSLv3'
+ // pfx: fs.readFileSync(pfxFilePath),
+ passphrase: 'password',
+ securityOptions: 'SSL_OP_NO_SSLv3'
}
};
@@ -457,11 +490,23 @@ request.get(options);
It is able to force using SSLv3 only by specifying `secureProtocol`:
```javascript
+request.get({
+ url: 'https://api.some-server.com/',
+ agentOptions: {
+ secureProtocol: 'SSLv3_method'
+ }
+});
+```
+It is possible to accept other certificates than those signed by generally allowed Certificate Authorities (CAs).
+This can be useful, for example, when using self-signed certificates.
+To allow a different certificate, you can specify the signing CA by adding the contents of the CA's certificate file to the `agentOptions`:
+
+```javascript
request.get({
url: 'https://api.some-server.com/',
agentOptions: {
- 'secureProtocol': 'SSLv3_method'
+ ca: fs.readFileSync('ca.cert.pem')
}
});
```
@@ -480,11 +525,18 @@ The first argument can be either a `url` or an `options` object. The only requir
* `headers` - http headers (default: `{}`)
* `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer` or `String`, unless `json` is `true`. If `json` is `true`, then `body` must be a JSON-serializable object.
* `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See "Forms" section above.
-* `formData` - Data to pass for a `multipart/form-data` request. See "Forms" section above.
-* `multipart` - (experimental) Data to pass for a `multipart/related` request. See "Forms" section above
+* `formData` - Data to pass for a `multipart/form-data` request. See
+ [Forms](#forms) section above.
+* `multipart` - array of objects which contain their own headers and `body`
+ attributes. Sends a `multipart/related` request. See [Forms](#forms) section
+ above.
+ * Alternatively you can pass in an object `{chunked: false, data: []}` where
+ `chunked` is used to specify whether the request is sent in
+ [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)
+ (the default is `chunked: true`). In non-chunked requests, data items with
+ body streams are not allowed.
* `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above.
* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.
-* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below.
* `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.
* `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.
* `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.
@@ -493,6 +545,11 @@ The first argument can be either a `url` or an `options` object. The only requir
* `encoding` - Encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default).
* `pool` - An object describing which agents to use for the request. If this option is omitted the request will use the global agent (as long as [your options allow for it](request.js#L747)). Otherwise, request will search the pool for your custom agent. If no custom agent is found, a new agent will be created and added to the pool.
* A `maxSockets` property can also be provided on the `pool` object to set the max number of sockets for all agents created (ex: `pool: {maxSockets: Infinity}`).
+ * Note that if you are sending multiple requests in a loop and creating
+ multiple new `pool` objects, `maxSockets` will not work as intended. To
+ work around this, either use [`request.defaults`](#requestdefaultsoptions)
+ with your pool options or create the pool object with the `maxSockets`
+ property outside of the loop.
* `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request
* `proxy` - An HTTP proxy to be used. Supports proxy Auth with Basic Auth, identical to support for the `url` parameter (by embedding the auth info in the `uri`)
* `oauth` - Options for OAuth HMAC-SHA1 signing. See documentation above.
@@ -527,9 +584,14 @@ There are also shorthand methods for different HTTP METHODs and some other conve
### request.defaults(options)
-This method returns a wrapper around the normal request API that defaults to whatever options you pass in to it.
+This method **returns a wrapper** around the normal request API that defaults
+to whatever options you pass to it.
+
+**Note:** `request.defaults()` **does not** modify the global request API;
+instead, it **returns a wrapper** that has your default settings applied to it.
-**Note:** You can call `.defaults()` on the wrapper that is returned from `request.defaults` to add/override defaults that were previously defaulted.
+**Note:** You can call `.defaults()` on the wrapper that is returned from
+`request.defaults` to add/override defaults that were previously defaulted.
For example:
```javascript
diff --git a/node_modules/request/node_modules/aws-sign2/package.json b/node_modules/request/node_modules/aws-sign2/package.json
index 5712075b0..9104550c8 100644
--- a/node_modules/request/node_modules/aws-sign2/package.json
+++ b/node_modules/request/node_modules/aws-sign2/package.json
@@ -42,5 +42,6 @@
"directories": {},
"_shasum": "c57103f7a17fc037f02d7c2e64b602ea223f7d63",
"_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz",
- "homepage": "https://github.com/mikeal/aws-sign"
+ "homepage": "https://github.com/mikeal/aws-sign",
+ "scripts": {}
}
diff --git a/node_modules/request/node_modules/caseless/README.md b/node_modules/request/node_modules/caseless/README.md
index 719584c85..e5077a216 100644
--- a/node_modules/request/node_modules/caseless/README.md
+++ b/node_modules/request/node_modules/caseless/README.md
@@ -1,6 +1,6 @@
## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing.
-This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manor while also preserving the caseing of headers the first time they are set.
+This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manner while also preserving the caseing of headers the first time they are set.
## Usage
diff --git a/node_modules/request/node_modules/caseless/index.js b/node_modules/request/node_modules/caseless/index.js
index 231a997e0..2f5e1c4ad 100644
--- a/node_modules/request/node_modules/caseless/index.js
+++ b/node_modules/request/node_modules/caseless/index.js
@@ -25,12 +25,12 @@ Caseless.prototype.has = function (name) {
return false
}
Caseless.prototype.get = function (name) {
- var result, re, match
+ name = name.toLowerCase()
+ var result, key
var headers = this.dict
Object.keys(headers).forEach(function (key) {
- re = new RegExp(name, 'i')
- match = key.match(re)
- if (match) result = headers[key]
+ _key = key.toLowerCase()
+ if (name === _key) result = headers[key]
})
return result
}
diff --git a/node_modules/request/node_modules/caseless/package.json b/node_modules/request/node_modules/caseless/package.json
index 3725c1026..91e11d0c9 100644
--- a/node_modules/request/node_modules/caseless/package.json
+++ b/node_modules/request/node_modules/caseless/package.json
@@ -1,6 +1,6 @@
{
"name": "caseless",
- "version": "0.6.0",
+ "version": "0.7.0",
"description": "Caseless object set/get/has, very useful when working with HTTP headers.",
"main": "index.js",
"scripts": {
@@ -27,11 +27,12 @@
"devDependencies": {
"tape": "^2.10.2"
},
+ "gitHead": "9359e958f196e1aaa2180b551151b2c25826b8f5",
"homepage": "https://github.com/mikeal/caseless",
- "_id": "caseless@0.6.0",
- "_shasum": "8167c1ab8397fb5bb95f96d28e5a81c50f247ac4",
- "_from": "caseless@>=0.6.0 <0.7.0",
- "_npmVersion": "1.4.9",
+ "_id": "caseless@0.7.0",
+ "_shasum": "cbd705ae6229158bb0bc971bf7d7a04bdbd51ff8",
+ "_from": "caseless@>=0.7.0 <0.8.0",
+ "_npmVersion": "2.0.0",
"_npmUser": {
"name": "mikeal",
"email": "mikeal.rogers@gmail.com"
@@ -43,10 +44,10 @@
}
],
"dist": {
- "shasum": "8167c1ab8397fb5bb95f96d28e5a81c50f247ac4",
- "tarball": "http://registry.npmjs.org/caseless/-/caseless-0.6.0.tgz"
+ "shasum": "cbd705ae6229158bb0bc971bf7d7a04bdbd51ff8",
+ "tarball": "http://registry.npmjs.org/caseless/-/caseless-0.7.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.6.0.tgz",
+ "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.7.0.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/node_modules/request/node_modules/caseless/test.js b/node_modules/request/node_modules/caseless/test.js
index 5604fa075..084bbaf5e 100644
--- a/node_modules/request/node_modules/caseless/test.js
+++ b/node_modules/request/node_modules/caseless/test.js
@@ -6,7 +6,7 @@ tape('set get has', function (t) {
var headers = {}
, c = caseless(headers)
;
- t.plan(14)
+ t.plan(17)
c.set('a-Header', 'asdf')
t.equal(c.get('a-header'), 'asdf')
t.equal(c.has('a-header'), 'a-Header')
@@ -30,4 +30,11 @@ tape('set get has', function (t) {
t.notOk(c.has('idonotexist'))
t.ok(c.del('idonotexist'))
+ c.set('tva', 'test1')
+ c.set('tva-header', 'test2')
+ t.equal(c.has('tva'), 'tva')
+ t.notOk(c.has('header'))
+
+ t.equal(c.get('tva'), 'test1')
+
})
diff --git a/node_modules/request/node_modules/combined-stream/lib/combined_stream.js b/node_modules/request/node_modules/combined-stream/lib/combined_stream.js
index c18ad980d..6b5c21b6b 100644
--- a/node_modules/request/node_modules/combined-stream/lib/combined_stream.js
+++ b/node_modules/request/node_modules/combined-stream/lib/combined_stream.js
@@ -30,7 +30,7 @@ CombinedStream.create = function(options) {
CombinedStream.isStreamLike = function(stream) {
return (typeof stream !== 'function')
&& (typeof stream !== 'string')
- && (typeof stream !== 'boolean')
+ && (typeof stream !== 'boolean')
&& (typeof stream !== 'number')
&& (!Buffer.isBuffer(stream));
};
@@ -40,12 +40,12 @@ CombinedStream.prototype.append = function(stream) {
if (isStreamLike) {
if (!(stream instanceof DelayedStream)) {
- stream.on('data', this._checkDataSize.bind(this));
-
- stream = DelayedStream.create(stream, {
+ var newStream = DelayedStream.create(stream, {
maxDataSize: Infinity,
pauseStream: this.pauseStreams,
});
+ stream.on('data', this._checkDataSize.bind(this));
+ stream = newStream;
}
this._handleErrors(stream);
@@ -97,7 +97,7 @@ CombinedStream.prototype._pipeNext = function(stream) {
var isStreamLike = CombinedStream.isStreamLike(stream);
if (isStreamLike) {
- stream.on('end', this._getNext.bind(this))
+ stream.on('end', this._getNext.bind(this));
stream.pipe(this, {end: false});
return;
}
@@ -123,6 +123,7 @@ CombinedStream.prototype.pause = function() {
return;
}
+ if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();
this.emit('pause');
};
@@ -133,6 +134,7 @@ CombinedStream.prototype.resume = function() {
this._getNext();
}
+ if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();
this.emit('resume');
};
@@ -159,7 +161,7 @@ CombinedStream.prototype._checkDataSize = function() {
}
var message =
- 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
+ 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';
this._emitError(new Error(message));
};
diff --git a/node_modules/request/node_modules/combined-stream/package.json b/node_modules/request/node_modules/combined-stream/package.json
index b417730e3..a44fef984 100644
--- a/node_modules/request/node_modules/combined-stream/package.json
+++ b/node_modules/request/node_modules/combined-stream/package.json
@@ -6,7 +6,7 @@
},
"name": "combined-stream",
"description": "A stream that emits multiple other streams one after another.",
- "version": "0.0.5",
+ "version": "0.0.7",
"homepage": "https://github.com/felixge/node-combined-stream",
"repository": {
"type": "git",
@@ -25,17 +25,19 @@
"devDependencies": {
"far": "~0.0.7"
},
- "gitHead": "19d9bdd4c20f6806c2ae8adb00a53fb6fd154740",
"bugs": {
"url": "https://github.com/felixge/node-combined-stream/issues"
},
- "_id": "combined-stream@0.0.5",
- "_shasum": "29ed76e5c9aad07c4acf9ca3d32601cce28697a2",
+ "_id": "combined-stream@0.0.7",
+ "dist": {
+ "shasum": "0137e657baa5a7541c57ac37ac5fc07d73b4dc1f",
+ "tarball": "http://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz"
+ },
"_from": "combined-stream@>=0.0.5 <0.1.0",
- "_npmVersion": "1.4.14",
+ "_npmVersion": "1.4.3",
"_npmUser": {
- "name": "alexindigo",
- "email": "iam@alexindigo.com"
+ "name": "felixge",
+ "email": "felix@debuggable.com"
},
"maintainers": [
{
@@ -51,11 +53,8 @@
"email": "iam@alexindigo.com"
}
],
- "dist": {
- "shasum": "29ed76e5c9aad07c4acf9ca3d32601cce28697a2",
- "tarball": "http://registry.npmjs.org/combined-stream/-/combined-stream-0.0.5.tgz"
- },
"directories": {},
- "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.5.tgz",
+ "_shasum": "0137e657baa5a7541c57ac37ac5fc07d73b4dc1f",
+ "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/node_modules/request/node_modules/forever-agent/package.json b/node_modules/request/node_modules/forever-agent/package.json
index 833522401..1bb444193 100644
--- a/node_modules/request/node_modules/forever-agent/package.json
+++ b/node_modules/request/node_modules/forever-agent/package.json
@@ -41,5 +41,6 @@
"directories": {},
"_shasum": "6d0e09c4921f94a27f63d3b49c5feff1ea4c5130",
"_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz",
- "readme": "ERROR: No README data found!"
+ "readme": "ERROR: No README data found!",
+ "scripts": {}
}
diff --git a/node_modules/request/node_modules/form-data/node_modules/mime/package.json b/node_modules/request/node_modules/form-data/node_modules/mime/package.json
index bd09e86f1..b666b72a2 100644
--- a/node_modules/request/node_modules/form-data/node_modules/mime/package.json
+++ b/node_modules/request/node_modules/form-data/node_modules/mime/package.json
@@ -54,5 +54,6 @@
"directories": {},
"_shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10",
"_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz",
- "homepage": "https://github.com/broofa/node-mime"
+ "homepage": "https://github.com/broofa/node-mime",
+ "scripts": {}
}
diff --git a/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json b/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json
index b4cfa49be..d06cbfd73 100644
--- a/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json
+++ b/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json
@@ -33,5 +33,6 @@
"_shasum": "d93ffdbb67ac5507779be316a7d65146417beef8",
"_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz",
"_from": "assert-plus@0.1.2",
- "readme": "ERROR: No README data found!"
+ "readme": "ERROR: No README data found!",
+ "scripts": {}
}
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json b/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json
index d188daf72..5840d050c 100644
--- a/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json
+++ b/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json
@@ -31,5 +31,6 @@
"_shasum": "fe8091d468a373a0b0c9ff8bbfb3425c00973a1d",
"_resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz",
"_from": "ctype@0.5.2",
- "readme": "ERROR: No README data found!"
+ "readme": "ERROR: No README data found!",
+ "scripts": {}
}
diff --git a/node_modules/request/node_modules/node-uuid/package.json b/node_modules/request/node_modules/node-uuid/package.json
index 8e36ee769..bead110cc 100644
--- a/node_modules/request/node_modules/node-uuid/package.json
+++ b/node_modules/request/node_modules/node-uuid/package.json
@@ -49,5 +49,6 @@
"directories": {},
"_shasum": "39aef510e5889a3dca9c895b506c73aae1bac048",
"_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz",
- "homepage": "https://github.com/broofa/node-uuid"
+ "homepage": "https://github.com/broofa/node-uuid",
+ "scripts": {}
}
diff --git a/node_modules/request/node_modules/oauth-sign/index.js b/node_modules/request/node_modules/oauth-sign/index.js
index 3a86aca12..bdfd14e18 100644
--- a/node_modules/request/node_modules/oauth-sign/index.js
+++ b/node_modules/request/node_modules/oauth-sign/index.js
@@ -6,6 +6,10 @@ function sha1 (key, body) {
return crypto.createHmac('sha1', key).update(body).digest('base64')
}
+function rsa (key, body) {
+ return crypto.createSign("RSA-SHA1").update(body).sign(key, 'base64');
+}
+
function rfc3986 (str) {
return encodeURIComponent(str)
.replace(/!/g,'%21')
@@ -37,7 +41,7 @@ function compare (a, b) {
return a > b ? 1 : a < b ? -1 : 0
}
-function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) {
+function generateBase (httpMethod, base_uri, params) {
// adapted from https://dev.twitter.com/docs/auth/oauth and
// https://dev.twitter.com/docs/auth/creating-signature
@@ -69,6 +73,11 @@ function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret)
rfc3986(normalized)
].join('&')
+ return base
+}
+
+function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) {
+ var base = generateBase(httpMethod, base_uri, params)
var key = [
consumer_secret || '',
token_secret || ''
@@ -77,5 +86,31 @@ function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret)
return sha1(key, base)
}
+function rsasign (httpMethod, base_uri, params, private_key, token_secret) {
+ var base = generateBase(httpMethod, base_uri, params)
+ var key = private_key || ''
+
+ return rsa(key, base)
+}
+
+function sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) {
+ var method
+
+ switch (signMethod) {
+ case 'RSA-SHA1':
+ method = rsasign
+ break
+ case 'HMAC-SHA1':
+ method = hmacsign
+ break
+ default:
+ throw new Error("Signature method not supported: " + signMethod)
+ }
+
+ return method.apply(null, [].slice.call(arguments, 1))
+}
+
exports.hmacsign = hmacsign
+exports.rsasign = rsasign
+exports.sign = sign
exports.rfc3986 = rfc3986
diff --git a/node_modules/request/node_modules/oauth-sign/package.json b/node_modules/request/node_modules/oauth-sign/package.json
index 32b34eda2..d49bfb746 100644
--- a/node_modules/request/node_modules/oauth-sign/package.json
+++ b/node_modules/request/node_modules/oauth-sign/package.json
@@ -6,7 +6,7 @@
},
"name": "oauth-sign",
"description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.",
- "version": "0.4.0",
+ "version": "0.5.0",
"repository": {
"url": "https://github.com/mikeal/oauth-sign"
},
@@ -20,16 +20,15 @@
"scripts": {
"test": "node test.js"
},
+ "gitHead": "6fea86c2d4a38e1b3780ad0cc56f00196e5213c1",
"bugs": {
"url": "https://github.com/mikeal/oauth-sign/issues"
},
- "_id": "oauth-sign@0.4.0",
- "dist": {
- "shasum": "f22956f31ea7151a821e5f2fb32c113cad8b9f69",
- "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz"
- },
- "_from": "oauth-sign@>=0.4.0 <0.5.0",
- "_npmVersion": "1.3.2",
+ "homepage": "https://github.com/mikeal/oauth-sign",
+ "_id": "oauth-sign@0.5.0",
+ "_shasum": "d767f5169325620eab2e087ef0c472e773db6461",
+ "_from": "oauth-sign@>=0.5.0 <0.6.0",
+ "_npmVersion": "2.0.0",
"_npmUser": {
"name": "mikeal",
"email": "mikeal.rogers@gmail.com"
@@ -40,9 +39,11 @@
"email": "mikeal.rogers@gmail.com"
}
],
+ "dist": {
+ "shasum": "d767f5169325620eab2e087ef0c472e773db6461",
+ "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.5.0.tgz"
+ },
"directories": {},
- "_shasum": "f22956f31ea7151a821e5f2fb32c113cad8b9f69",
- "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz",
- "readme": "ERROR: No README data found!",
- "homepage": "https://github.com/mikeal/oauth-sign"
+ "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.5.0.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/node_modules/request/node_modules/qs/CHANGELOG.md b/node_modules/request/node_modules/qs/CHANGELOG.md
index a6dd5a570..f5ee8b464 100644
--- a/node_modules/request/node_modules/qs/CHANGELOG.md
+++ b/node_modules/request/node_modules/qs/CHANGELOG.md
@@ -1,4 +1,11 @@
+## [**2.3.3**](https://github.com/hapijs/qs/issues?milestone=18&state=open)
+- [**#59**](https://github.com/hapijs/qs/issues/59) make sure array indexes are &gt;= 0, closes #57
+- [**#58**](https://github.com/hapijs/qs/issues/58) make qs usable for browser loader
+
+## [**2.3.2**](https://github.com/hapijs/qs/issues?milestone=17&state=closed)
+- [**#55**](https://github.com/hapijs/qs/issues/55) allow merging a string into an object
+
## [**2.3.1**](https://github.com/hapijs/qs/issues?milestone=16&state=closed)
- [**#52**](https://github.com/hapijs/qs/issues/52) Return &quot;undefined&quot; and &quot;false&quot; instead of throwing &quot;TypeError&quot;.
diff --git a/node_modules/request/node_modules/qs/Makefile b/node_modules/request/node_modules/qs/Makefile
index 600a700ec..31cc899d4 100644
--- a/node_modules/request/node_modules/qs/Makefile
+++ b/node_modules/request/node_modules/qs/Makefile
@@ -1,8 +1,8 @@
test:
- @node node_modules/lab/bin/lab
+ @node node_modules/lab/bin/lab -a code -L
test-cov:
- @node node_modules/lab/bin/lab -t 100
+ @node node_modules/lab/bin/lab -a code -t 100 -L
test-cov-html:
- @node node_modules/lab/bin/lab -r html -o coverage.html
+ @node node_modules/lab/bin/lab -a code -L -r html -o coverage.html
-.PHONY: test test-cov test-cov-html \ No newline at end of file
+.PHONY: test test-cov test-cov-html
diff --git a/node_modules/request/node_modules/qs/Readme.md b/node_modules/request/node_modules/qs/Readme.md
index 4f4e743b2..21bf3faf3 100755
--- a/node_modules/request/node_modules/qs/Readme.md
+++ b/node_modules/request/node_modules/qs/Readme.md
@@ -153,6 +153,8 @@ Qs.parse('a[1]=b', { arrayLimit: 0 });
// { a: { '1': 'b' } }
```
+To disable array parsing entirely, set `arrayLimit` to `-1`.
+
If you mix notations, **qs** will merge the two items into an object:
```javascript
diff --git a/node_modules/request/node_modules/qs/index.js b/node_modules/request/node_modules/qs/index.js
index bb0a047c4..2291cd858 100644
--- a/node_modules/request/node_modules/qs/index.js
+++ b/node_modules/request/node_modules/qs/index.js
@@ -1 +1 @@
-module.exports = require('./lib');
+module.exports = require('./lib/');
diff --git a/node_modules/request/node_modules/qs/lib/parse.js b/node_modules/request/node_modules/qs/lib/parse.js
index 362739783..4e7d02a1b 100755
--- a/node_modules/request/node_modules/qs/lib/parse.js
+++ b/node_modules/request/node_modules/qs/lib/parse.js
@@ -62,6 +62,7 @@ internals.parseObject = function (chain, val, options) {
if (!isNaN(index) &&
root !== cleanRoot &&
indexString === cleanRoot &&
+ index >= 0 &&
index <= options.arrayLimit) {
obj = [];
diff --git a/node_modules/request/node_modules/qs/lib/utils.js b/node_modules/request/node_modules/qs/lib/utils.js
index 3184d071e..5240bd5b0 100755
--- a/node_modules/request/node_modules/qs/lib/utils.js
+++ b/node_modules/request/node_modules/qs/lib/utils.js
@@ -94,7 +94,7 @@ exports.compact = function (obj, refs) {
if (Array.isArray(obj)) {
var compacted = [];
- for (var i = 0, l = obj.length; i < l; ++i) {
+ for (var i = 0, il = obj.length; i < il; ++i) {
if (typeof obj[i] !== 'undefined') {
compacted.push(obj[i]);
}
@@ -104,7 +104,7 @@ exports.compact = function (obj, refs) {
}
var keys = Object.keys(obj);
- for (var i = 0, il = keys.length; i < il; ++i) {
+ for (i = 0, il = keys.length; i < il; ++i) {
var key = keys[i];
obj[key] = exports.compact(obj[key], refs);
}
diff --git a/node_modules/request/node_modules/qs/package.json b/node_modules/request/node_modules/qs/package.json
index 96b78050b..8d17dfce1 100755..100644
--- a/node_modules/request/node_modules/qs/package.json
+++ b/node_modules/request/node_modules/qs/package.json
@@ -1,12 +1,13 @@
{
"name": "qs",
- "version": "2.3.2",
+ "version": "2.3.3",
"description": "A querystring parser that supports nesting and arrays, with a depth limit",
"homepage": "https://github.com/hapijs/qs",
"main": "index.js",
"dependencies": {},
"devDependencies": {
- "lab": "4.x.x"
+ "code": "1.x.x",
+ "lab": "5.x.x"
},
"scripts": {
"test": "make test-cov"
@@ -25,14 +26,15 @@
"url": "http://github.com/hapijs/qs/raw/master/LICENSE"
}
],
- "gitHead": "58097c12559b4c5857af99927273b3141dff8529",
+ "gitHead": "9250c4cda5102fcf72441445816e6d311fc6813d",
"bugs": {
"url": "https://github.com/hapijs/qs/issues"
},
- "_id": "qs@2.3.2",
- "_shasum": "d45ec249e4b9b029af008829a101d5ff7e972790",
+ "_id": "qs@2.3.3",
+ "_shasum": "e9e85adbe75da0bbe4c8e0476a086290f863b404",
"_from": "qs@>=2.3.1 <2.4.0",
- "_npmVersion": "1.4.28",
+ "_npmVersion": "2.1.6",
+ "_nodeVersion": "0.10.32",
"_npmUser": {
"name": "nlf",
"email": "quitlahok@gmail.com"
@@ -48,10 +50,10 @@
}
],
"dist": {
- "shasum": "d45ec249e4b9b029af008829a101d5ff7e972790",
- "tarball": "http://registry.npmjs.org/qs/-/qs-2.3.2.tgz"
+ "shasum": "e9e85adbe75da0bbe4c8e0476a086290f863b404",
+ "tarball": "http://registry.npmjs.org/qs/-/qs-2.3.3.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/qs/-/qs-2.3.2.tgz",
+ "_resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/node_modules/request/node_modules/qs/test/parse.js b/node_modules/request/node_modules/qs/test/parse.js
index 2a3d1696d..6c20cc1be 100755
--- a/node_modules/request/node_modules/qs/test/parse.js
+++ b/node_modules/request/node_modules/qs/test/parse.js
@@ -1,5 +1,7 @@
+/* eslint no-extend-native:0 */
// Load modules
+var Code = require('code');
var Lab = require('lab');
var Qs = require('../');
@@ -12,7 +14,7 @@ var internals = {};
// Test shortcuts
var lab = exports.lab = Lab.script();
-var expect = Lab.expect;
+var expect = Code.expect;
var describe = lab.experiment;
var it = lab.test;
@@ -302,6 +304,8 @@ describe('parse()', function () {
it('allows overriding array limit', function (done) {
+ expect(Qs.parse('a[0]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '0': 'b' } });
+ expect(Qs.parse('a[-1]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '-1': 'b' } });
expect(Qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 })).to.deep.equal({ a: { '0': 'b', '1': 'c' } });
done();
});
@@ -309,14 +313,14 @@ describe('parse()', function () {
it('parses an object', function (done) {
var input = {
- "user[name]": {"pop[bob]": 3},
- "user[email]": null
+ 'user[name]': {'pop[bob]': 3},
+ 'user[email]': null
};
var expected = {
- "user": {
- "name": {"pop[bob]": 3},
- "email": null
+ 'user': {
+ 'name': {'pop[bob]': 3},
+ 'email': null
}
};
@@ -329,14 +333,14 @@ describe('parse()', function () {
it('parses an object and not child values', function (done) {
var input = {
- "user[name]": {"pop[bob]": { "test": 3 }},
- "user[email]": null
+ 'user[name]': {'pop[bob]': { 'test': 3 }},
+ 'user[email]': null
};
var expected = {
- "user": {
- "name": {"pop[bob]": { "test": 3 }},
- "email": null
+ 'user': {
+ 'name': {'pop[bob]': { 'test': 3 }},
+ 'email': null
}
};
@@ -350,8 +354,9 @@ describe('parse()', function () {
var tempBuffer = global.Buffer;
delete global.Buffer;
- expect(Qs.parse('a=b&c=d')).to.deep.equal({ a: 'b', c: 'd' });
+ var result = Qs.parse('a=b&c=d');
global.Buffer = tempBuffer;
+ expect(result).to.deep.equal({ a: 'b', c: 'd' });
done();
});
@@ -371,10 +376,10 @@ describe('parse()', function () {
expect(function () {
parsed = Qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a });
- }).to.not.throw(Error);
+ }).to.not.throw();
- expect(parsed).to.have.key('foo');
- expect(parsed.foo).to.have.keys('bar', 'baz');
+ expect(parsed).to.contain('foo');
+ expect(parsed.foo).to.contain('bar', 'baz');
expect(parsed.foo.bar).to.equal('baz');
expect(parsed.foo.baz).to.deep.equal(a);
done();
@@ -386,7 +391,9 @@ describe('parse()', function () {
a.b = 'c';
expect(Qs.parse(a)).to.deep.equal({ b: 'c' });
- expect(Qs.parse({ a: a })).to.deep.equal({ a: { b: 'c' } });
+ var result = Qs.parse({ a: a });
+ expect(result).to.contain('a');
+ expect(result.a).to.deep.equal(a);
done();
});
diff --git a/node_modules/request/node_modules/qs/test/stringify.js b/node_modules/request/node_modules/qs/test/stringify.js
index e82800411..75e397a74 100755
--- a/node_modules/request/node_modules/qs/test/stringify.js
+++ b/node_modules/request/node_modules/qs/test/stringify.js
@@ -1,5 +1,7 @@
+/* eslint no-extend-native:0 */
// Load modules
+var Code = require('code');
var Lab = require('lab');
var Qs = require('../');
@@ -12,7 +14,7 @@ var internals = {};
// Test shortcuts
var lab = exports.lab = Lab.script();
-var expect = Lab.expect;
+var expect = Code.expect;
var describe = lab.experiment;
var it = lab.test;
diff --git a/node_modules/request/node_modules/stringstream/package.json b/node_modules/request/node_modules/stringstream/package.json
index 7069ff8a3..b71cf2859 100644
--- a/node_modules/request/node_modules/stringstream/package.json
+++ b/node_modules/request/node_modules/stringstream/package.json
@@ -44,5 +44,6 @@
"bugs": {
"url": "https://github.com/mhart/StringStream/issues"
},
- "homepage": "https://github.com/mhart/StringStream"
+ "homepage": "https://github.com/mhart/StringStream",
+ "scripts": {}
}
diff --git a/node_modules/request/node_modules/tunnel-agent/package.json b/node_modules/request/node_modules/tunnel-agent/package.json
index 257c1a8f4..5b1ebba15 100644
--- a/node_modules/request/node_modules/tunnel-agent/package.json
+++ b/node_modules/request/node_modules/tunnel-agent/package.json
@@ -41,5 +41,6 @@
"directories": {},
"_shasum": "b1184e312ffbcf70b3b4c78e8c219de7ebb1c550",
"_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz",
- "readme": "ERROR: No README data found!"
+ "readme": "ERROR: No README data found!",
+ "scripts": {}
}
diff --git a/node_modules/request/package.json b/node_modules/request/package.json
index e7f69d9ab..d64b363ba 100755
--- a/node_modules/request/package.json
+++ b/node_modules/request/package.json
@@ -7,7 +7,7 @@
"util",
"utility"
],
- "version": "2.47.0",
+ "version": "2.48.0",
"author": {
"name": "Mikeal Rogers",
"email": "mikeal.rogers@gmail.com"
@@ -26,7 +26,7 @@
"main": "index.js",
"dependencies": {
"bl": "~0.9.0",
- "caseless": "~0.6.0",
+ "caseless": "~0.7.0",
"forever-agent": "~0.5.0",
"form-data": "~0.1.0",
"json-stringify-safe": "~5.0.0",
@@ -36,7 +36,7 @@
"tunnel-agent": "~0.4.0",
"tough-cookie": ">=0.12.0",
"http-signature": "~0.10.0",
- "oauth-sign": "~0.4.0",
+ "oauth-sign": "~0.5.0",
"hawk": "1.1.1",
"aws-sign2": "~0.5.0",
"stringstream": "~0.0.4",
@@ -52,11 +52,11 @@
"tape": "~3.0.0",
"taper": "~0.3.0"
},
- "gitHead": "0ad38bf9a51b34cb4bde1e65807dbee7e83bca82",
+ "gitHead": "0d8644ec6e0699a4dba8aad11bc0c10a101c0aec",
"homepage": "https://github.com/request/request",
- "_id": "request@2.47.0",
- "_shasum": "09e9fd1a4fed6593a805ef8202b20f0c5ecb485f",
- "_from": "request@>=2.47.0 <2.48.0",
+ "_id": "request@2.48.0",
+ "_shasum": "3ae2e091c9698282d58a0e6989ece2638f0f1f28",
+ "_from": "request@>=2.48.0 <2.49.0",
"_npmVersion": "1.4.14",
"_npmUser": {
"name": "nylen",
@@ -73,10 +73,10 @@
}
],
"dist": {
- "shasum": "09e9fd1a4fed6593a805ef8202b20f0c5ecb485f",
- "tarball": "http://registry.npmjs.org/request/-/request-2.47.0.tgz"
+ "shasum": "3ae2e091c9698282d58a0e6989ece2638f0f1f28",
+ "tarball": "http://registry.npmjs.org/request/-/request-2.48.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/request/-/request-2.47.0.tgz",
+ "_resolved": "https://registry.npmjs.org/request/-/request-2.48.0.tgz",
"readme": "ERROR: No README data found!"
}
diff --git a/node_modules/request/release.sh b/node_modules/request/release.sh
index 1362f52f9..7678bf8d8 100755
--- a/node_modules/request/release.sh
+++ b/node_modules/request/release.sh
@@ -1,7 +1,9 @@
#!/bin/sh
if [ -z "`which github-changes`" ]; then
- echo "First, do: [sudo] npm install -g github-changes"
+ # specify version because github-changes "is under heavy development. Things
+ # may break between releases" until 0.1.0
+ echo "First, do: [sudo] npm install -g github-changes@0.0.14"
exit 1
fi
@@ -19,8 +21,14 @@ github-changes -o request -r request \
--auth --verbose \
--file CHANGELOG.md \
--only-pulls --use-commit-body \
+ --date-format '(YYYY/MM/DD)' \
|| exit 1
+# Since the tag for the new version hasn't been pushed yet, any changes in it
+# will be marked as "upcoming"
+version="$(grep '"version"' package.json | cut -d'"' -f4)"
+sed -i -e "s/^### upcoming/### v$version/" CHANGELOG.md
+
# This may fail if no changelog updates
# TODO: would this ever actually happen? handle it better?
git add CHANGELOG.md; git commit -m 'Update changelog'
diff --git a/node_modules/request/request.js b/node_modules/request/request.js
index 862e3ac0b..62bd8c14a 100644
--- a/node_modules/request/request.js
+++ b/node_modules/request/request.js
@@ -117,7 +117,7 @@ function constructProxyHost(uriObject) {
function constructProxyHeaderWhiteList(headers, proxyHeaderWhiteList) {
var whiteList = proxyHeaderWhiteList
.reduce(function (set, header) {
- set[header] = true
+ set[header.toLowerCase()] = true
return set
}, {})
@@ -579,7 +579,8 @@ Request.prototype.init = function (options) {
if (options.json) {
self.json(options.json)
- } else if (options.multipart) {
+ }
+ if (options.multipart) {
self.boundary = uuid()
self.multipart(options.multipart)
}
@@ -684,7 +685,13 @@ Request.prototype.init = function (options) {
self._multipart.pipe(self)
}
if (self.body) {
- self.write(self.body)
+ if (Array.isArray(self.body)) {
+ self.body.forEach(function (part) {
+ self.write(part)
+ })
+ } else {
+ self.write(self.body)
+ }
self.end()
} else if (self.requestBodyStream) {
console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.')
@@ -1413,12 +1420,19 @@ Request.prototype.form = function (form) {
}
Request.prototype.multipart = function (multipart) {
var self = this
- self._multipart = new CombinedStream()
- if (!self.hasHeader('content-type')) {
+ var chunked = (multipart instanceof Array) || (multipart.chunked === undefined) || multipart.chunked
+ multipart = multipart.data || multipart
+
+ var items = chunked ? new CombinedStream() : []
+ function add (part) {
+ return chunked ? items.append(part) : items.push(new Buffer(part))
+ }
+
+ var headerName = self.hasHeader('content-type')
+ if (!headerName || headerName.indexOf('multipart') === -1) {
self.setHeader('content-type', 'multipart/related; boundary=' + self.boundary)
} else {
- var headerName = self.hasHeader('content-type')
self.setHeader(headerName, self.headers[headerName].split(';')[0] + '; boundary=' + self.boundary)
}
@@ -1427,7 +1441,7 @@ Request.prototype.multipart = function (multipart) {
}
if (self.preambleCRLF) {
- self._multipart.append('\r\n')
+ add('\r\n')
}
multipart.forEach(function (part) {
@@ -1441,16 +1455,17 @@ Request.prototype.multipart = function (multipart) {
preamble += key + ': ' + part[key] + '\r\n'
})
preamble += '\r\n'
- self._multipart.append(preamble)
- self._multipart.append(body)
- self._multipart.append('\r\n')
+ add(preamble)
+ add(body)
+ add('\r\n')
})
- self._multipart.append('--' + self.boundary + '--')
+ add('--' + self.boundary + '--')
if (self.postambleCRLF) {
- self._multipart.append('\r\n')
+ add('\r\n')
}
+ self[chunked ? '_multipart' : 'body'] = items
return self
}
Request.prototype.json = function (val) {
@@ -1609,17 +1624,26 @@ Request.prototype.oauth = function (_oauth) {
if (!oa.oauth_nonce) {
oa.oauth_nonce = uuid().replace(/-/g, '')
}
+ if (!oa.oauth_signature_method) {
+ oa.oauth_signature_method = 'HMAC-SHA1'
+ }
- oa.oauth_signature_method = 'HMAC-SHA1'
-
- var consumer_secret = oa.oauth_consumer_secret
+ var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key
delete oa.oauth_consumer_secret
+ delete oa.oauth_private_key
var token_secret = oa.oauth_token_secret
delete oa.oauth_token_secret
var baseurl = self.uri.protocol + '//' + self.uri.host + self.uri.pathname
var params = self.qsLib.parse([].concat(query, form, self.qsLib.stringify(oa)).join('&'))
- var signature = oauth.hmacsign(self.method, baseurl, params, consumer_secret, token_secret)
+
+ var signature = oauth.sign(
+ oa.oauth_signature_method,
+ self.method,
+ baseurl,
+ params,
+ consumer_secret_or_private_key,
+ token_secret)
var realm = _oauth.realm ? 'realm="' + _oauth.realm + '",' : ''
var authHeader = 'OAuth ' + realm +