summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/request
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/request')
-rw-r--r--deps/npm/node_modules/request/CHANGELOG.md34
-rw-r--r--deps/npm/node_modules/request/README.md120
-rwxr-xr-xdeps/npm/node_modules/request/index.js27
-rw-r--r--deps/npm/node_modules/request/lib/auth.js11
-rw-r--r--deps/npm/node_modules/request/lib/cookies.js15
-rw-r--r--deps/npm/node_modules/request/lib/getProxyFromURI.js36
-rw-r--r--deps/npm/node_modules/request/lib/har.js20
-rw-r--r--deps/npm/node_modules/request/lib/helpers.js20
-rw-r--r--deps/npm/node_modules/request/lib/multipart.js13
-rw-r--r--deps/npm/node_modules/request/lib/oauth.js44
-rw-r--r--deps/npm/node_modules/request/lib/querystring.js5
-rw-r--r--deps/npm/node_modules/request/lib/redirect.js17
-rw-r--r--deps/npm/node_modules/request/lib/tunnel.js51
-rw-r--r--deps/npm/node_modules/request/package.json68
-rw-r--r--deps/npm/node_modules/request/request.js221
15 files changed, 362 insertions, 340 deletions
diff --git a/deps/npm/node_modules/request/CHANGELOG.md b/deps/npm/node_modules/request/CHANGELOG.md
index 059d98d2fe..af76719b4b 100644
--- a/deps/npm/node_modules/request/CHANGELOG.md
+++ b/deps/npm/node_modules/request/CHANGELOG.md
@@ -1,38 +1,7 @@
## Change Log
-### v2.86.0 (2018/05/15)
-- [#2885](https://github.com/request/request/pull/2885) Remove redundant code (for Node.js 0.9.4 and below) and dependency (@ChALkeR)
-- [#2942](https://github.com/request/request/pull/2942) Make Test GREEN Again! (@simov)
-- [#2923](https://github.com/request/request/pull/2923) Alterations for failing CI tests (@gareth-robinson)
-
-### v2.85.0 (2018/03/12)
-- [#2880](https://github.com/request/request/pull/2880) Revert "Update hawk to 7.0.7 (#2880)" (@simov)
-
-### v2.84.0 (2018/03/12)
-- [#2793](https://github.com/request/request/pull/2793) Fixed calculation of oauth_body_hash, issue #2792 (@dvishniakov)
-- [#2880](https://github.com/request/request/pull/2880) Update hawk to 7.0.7 (#2880) (@kornel-kedzierski)
-
-### v2.83.0 (2017/09/27)
-- [#2776](https://github.com/request/request/pull/2776) Updating tough-cookie due to security fix. (#2776) (@karlnorling)
-
-### v2.82.0 (2017/09/19)
-- [#2703](https://github.com/request/request/pull/2703) Add Node.js v8 to Travis CI (@ryysud)
-- [#2751](https://github.com/request/request/pull/2751) Update of hawk and qs to latest version (#2751) (@Olivier-Moreau)
-- [#2658](https://github.com/request/request/pull/2658) Fixed some text in README.md (#2658) (@Marketionist)
-- [#2635](https://github.com/request/request/pull/2635) chore(package): update aws-sign2 to version 0.7.0 (#2635) (@greenkeeperio-bot)
-- [#2641](https://github.com/request/request/pull/2641) Update README to simplify & update convenience methods (#2641) (@FredKSchott)
-- [#2541](https://github.com/request/request/pull/2541) Add convenience method for HTTP OPTIONS (#2541) (@jamesseanwright)
-- [#2605](https://github.com/request/request/pull/2605) Add promise support section to README (#2605) (@FredKSchott)
-- [#2579](https://github.com/request/request/pull/2579) refactor(lint): replace eslint with standard (#2579) (@ahmadnassri)
-- [#2598](https://github.com/request/request/pull/2598) Update codecov to version 2.0.2 🚀 (@greenkeeperio-bot)
-- [#2590](https://github.com/request/request/pull/2590) Adds test-timing keepAlive test (@nicjansma)
-- [#2589](https://github.com/request/request/pull/2589) fix tabulation on request example README.MD (@odykyi)
-- [#2594](https://github.com/request/request/pull/2594) chore(dependencies): har-validator to 5.x [removes babel dep] (@ahmadnassri)
-
### v2.81.0 (2017/03/09)
- [#2584](https://github.com/request/request/pull/2584) Security issue: Upgrade qs to version 6.4.0 (@sergejmueller)
-- [#2578](https://github.com/request/request/pull/2578) safe-buffer doesn't zero-fill by default, its just a polyfill. (#2578) (@mikeal)
-- [#2566](https://github.com/request/request/pull/2566) Timings: Tracks 'lookup', adds 'wait' time, fixes connection re-use (#2566) (@nicjansma)
- [#2574](https://github.com/request/request/pull/2574) Migrating to safe-buffer for improved security. (@mikeal)
- [#2573](https://github.com/request/request/pull/2573) fixes #2572 (@ahmadnassri)
@@ -217,8 +186,7 @@
- [#1687](https://github.com/request/request/pull/1687) Fix caseless bug - content-type not being set for multipart/form-data (@simov, @garymathews)
### v2.59.0 (2015/07/20)
-- [#1671](https://github.com/request/request/pull/1671) Add tests and docs for using the agent, agentClass, agentOptions and forever options.
- Forever option defaults to using http(s).Agent in node 0.12+ (@simov)
+- [#1671](https://github.com/request/request/pull/1671) Add tests and docs for using the agent, agentClass, agentOptions and forever options. Forever option defaults to using http(s).Agent in node 0.12+ (@simov)
- [#1679](https://github.com/request/request/pull/1679) Fix - do not remove OAuth param when using OAuth realm (@simov, @jhalickman)
- [#1668](https://github.com/request/request/pull/1668) updated dependencies (@deamme)
- [#1656](https://github.com/request/request/pull/1656) Fix form method (@simov)
diff --git a/deps/npm/node_modules/request/README.md b/deps/npm/node_modules/request/README.md
index 81ffd95efd..2317391149 100644
--- a/deps/npm/node_modules/request/README.md
+++ b/deps/npm/node_modules/request/README.md
@@ -28,7 +28,6 @@ request('http://www.google.com', function (error, response, body) {
## Table of contents
- [Streaming](#streaming)
-- [Promises & Async/Await](#promises--asyncawait)
- [Forms](#forms)
- [HTTP Authentication](#http-authentication)
- [Custom HTTP Headers](#custom-http-headers)
@@ -143,22 +142,6 @@ You can still use intermediate proxies, the requests will still follow HTTP forw
---
-## Promises & Async/Await
-
-`request` supports both streaming and callback interfaces natively. If you'd like `request` to return a Promise instead, you can use an alternative interface wrapper for `request`. These wrappers can be useful if you prefer to work with Promises, or if you'd like to use `async`/`await` in ES2017.
-
-Several alternative interfaces are provided by the request team, including:
-- [`request-promise`](https://github.com/request/request-promise) (uses [Bluebird](https://github.com/petkaantonov/bluebird) Promises)
-- [`request-promise-native`](https://github.com/request/request-promise-native) (uses native Promises)
-- [`request-promise-any`](https://github.com/request/request-promise-any) (uses [any-promise](https://www.npmjs.com/package/any-promise) Promises)
-
-
-[back to top](#table-of-contents)
-
-
----
-
-
## Forms
`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API.
@@ -187,7 +170,7 @@ var formData = {
// Pass a simple key-value pair
my_field: 'my_value',
// Pass data via Buffers
- my_buffer: Buffer.from([1, 2, 3]),
+ my_buffer: new Buffer([1, 2, 3]),
// Pass data via Streams
my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),
// Pass multiple values /w an Array
@@ -221,7 +204,7 @@ For advanced cases, you can access the form-data object itself via `r.form()`. T
var r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})
var form = r.form();
form.append('my_field', 'my_value');
-form.append('my_buffer', Buffer.from([1, 2, 3]));
+form.append('my_buffer', new Buffer([1, 2, 3]));
form.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});
```
See the [form-data README](https://github.com/form-data/form-data) for more information & examples.
@@ -625,7 +608,7 @@ request.get(options);
### Using `options.agentOptions`
-In the example below, we call an API that requires client side SSL certificate
+In the example below, we call an API requires client side SSL certificate
(in PEM format) with passphrase protected private key (in PEM format) and disable the SSLv3 protocol:
```js
@@ -684,7 +667,7 @@ request.get({
The `options.har` property will override the values: `url`, `method`, `qs`, `headers`, `form`, `formData`, `body`, `json`, as well as construct multipart data and read files from disk when `request.postData.params[].fileName` is present without a matching `value`.
-A validation step will check if the HAR Request format matches the latest spec (v1.2) and will skip parsing if not matching.
+a validation step will check if the HAR Request format matches the latest spec (v1.2) and will skip parsing if not matching.
```js
var request = require('request')
@@ -743,7 +726,7 @@ The first argument can be either a `url` or an `options` object. The only requir
- `qs` - object containing querystring values to be appended to the `uri`
- `qsParseOptions` - object containing options to pass to the [qs.parse](https://github.com/hapijs/qs#parsing-objects) method. Alternatively pass options to the [querystring.parse](https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_parse_str_sep_eq_options) method using this format `{sep:';', eq:':', options:{}}`
- `qsStringifyOptions` - object containing options to pass to the [qs.stringify](https://github.com/hapijs/qs#stringifying) method. Alternatively pass options to the [querystring.stringify](https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_stringify_obj_sep_eq_options) method using this format `{sep:';', eq:':', options:{}}`. For example, to change the way arrays are converted to query strings using the `qs` module pass the `arrayFormat` option with one of `indices|brackets|repeat`
-- `useQuerystring` - if true, use `querystring` to stringify and parse
+- `useQuerystring` - If true, use `querystring` to stringify and parse
querystrings, otherwise use `qs` (default: `false`). Set this option to
`true` if you need arrays to be serialized as `foo=bar&foo=baz` instead of the
default `foo[0]=bar&foo[1]=baz`.
@@ -752,7 +735,7 @@ The first argument can be either a `url` or an `options` object. The only requir
- `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. 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
+- `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
@@ -769,11 +752,11 @@ The first argument can be either a `url` or an `options` object. The only requir
---
-- `auth` - a hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above.
-- `oauth` - options for OAuth HMAC-SHA1 signing. See documentation above.
-- `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).
+- `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above.
+- `oauth` - Options for OAuth HMAC-SHA1 signing. See documentation above.
+- `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`, and optionally `session` (note that this only works for services that require session as part of the canonical string). 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.
+- `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.
---
@@ -785,9 +768,9 @@ 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). (**Note:** if you expect binary data, you should set `encoding: null`.)
-- `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.
-- `jar` - if `true`, remember cookies for future use (or define your custom cookie jar; see examples section)
+- `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). (**Note:** if you expect binary data, you should set `encoding: null`.)
+- `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.
+- `jar` - If `true`, remember cookies for future use (or define your custom cookie jar; see examples section)
---
@@ -795,14 +778,14 @@ The first argument can be either a `url` or an `options` object. The only requir
- `agentClass` - alternatively specify your agent's class name
- `agentOptions` - and pass its options. **Note:** for HTTPS see [tls API doc for TLS/SSL options](http://nodejs.org/api/tls.html#tls_tls_connect_options_callback) and the [documentation above](#using-optionsagentoptions).
- `forever` - set to `true` to use the [forever-agent](https://github.com/request/forever-agent) **Note:** Defaults to `http(s).Agent({keepAlive:true})` in node 0.12+
-- `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). 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. **Note:** `pool` is used only when the `agent` option is not specified.
+- `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). 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. **Note:** `pool` is used only when the `agent` option is not specified.
- 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
+- `timeout` - Integer containing the number of milliseconds to wait for a
server to send response headers (and start the response body) before aborting
the request. Note that if the underlying TCP connection cannot be established,
the OS-wide TCP connection timeout will overrule the `timeout` option ([the
@@ -812,9 +795,9 @@ default in Linux can be anywhere from 20-120 seconds][linux-timeout]).
---
-- `localAddress` - local interface to bind for network connections.
-- `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`)
-- `strictSSL` - if `true`, requires SSL certificates be valid. **Note:** to use your own certificate authority, you need to specify an agent that was created with that CA as an option.
+- `localAddress` - Local interface to bind for network connections.
+- `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`)
+- `strictSSL` - If `true`, requires SSL certificates be valid. **Note:** to use your own certificate authority, you need to specify an agent that was created with that CA as an option.
- `tunnel` - controls the behavior of
[HTTP `CONNECT` tunneling](https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_tunneling)
as follows:
@@ -822,14 +805,14 @@ default in Linux can be anywhere from 20-120 seconds][linux-timeout]).
- `true` - always tunnel to the destination by making a `CONNECT` request to
the proxy
- `false` - request the destination as a `GET` request.
-- `proxyHeaderWhiteList` - a whitelist of headers to send to a
+- `proxyHeaderWhiteList` - A whitelist of headers to send to a
tunneling proxy.
-- `proxyHeaderExclusiveList` - a whitelist of headers to send
+- `proxyHeaderExclusiveList` - A whitelist of headers to send
exclusively to a tunneling proxy and not to destination.
---
-- `time` - if `true`, the request-response cycle (including all redirects) is timed at millisecond resolution. When set, the following properties are added to the response object:
+- `time` - If `true`, the request-response cycle (including all redirects) is timed at millisecond resolution. When set, the following properties are added to the response object:
- `elapsedTime` Duration of the entire request/response in milliseconds (*deprecated*).
- `responseStartTime` Timestamp when the response began (in Unix Epoch milliseconds) (*deprecated*).
- `timingStart` Timestamp of the start of the request (in Unix Epoch milliseconds).
@@ -847,7 +830,7 @@ default in Linux can be anywhere from 20-120 seconds][linux-timeout]).
- `download`: Duration of HTTP download (`timings.end` - `timings.response`)
- `total`: Duration entire HTTP round-trip (`timings.end`)
-- `har` - a [HAR 1.2 Request Object](http://www.softwareishard.com/blog/har-12-spec/#request), will be processed from HAR format into options overwriting matching values *(see the [HAR 1.2 section](#support-for-har-1.2) for details)*
+- `har` - A [HAR 1.2 Request Object](http://www.softwareishard.com/blog/har-12-spec/#request), will be processed from HAR format into options overwriting matching values *(see the [HAR 1.2 section](#support-for-har-1.2) for details)*
- `callback` - alternatively pass the request's callback in the options object
The callback argument gets 3 arguments:
@@ -891,19 +874,55 @@ var specialRequest = baseRequest.defaults({
})
```
-### request.METHOD()
+### request.put
-These HTTP method convenience functions act just like `request()` but with a default method already set for you:
+Same as `request()`, but defaults to `method: "PUT"`.
-- *request.get()*: Defaults to `method: "GET"`.
-- *request.post()*: Defaults to `method: "POST"`.
-- *request.put()*: Defaults to `method: "PUT"`.
-- *request.patch()*: Defaults to `method: "PATCH"`.
-- *request.del() / request.delete()*: Defaults to `method: "DELETE"`.
-- *request.head()*: Defaults to `method: "HEAD"`.
-- *request.options()*: Defaults to `method: "OPTIONS"`.
+```js
+request.put(url)
+```
+
+### request.patch
-### request.cookie()
+Same as `request()`, but defaults to `method: "PATCH"`.
+
+```js
+request.patch(url)
+```
+
+### request.post
+
+Same as `request()`, but defaults to `method: "POST"`.
+
+```js
+request.post(url)
+```
+
+### request.head
+
+Same as `request()`, but defaults to `method: "HEAD"`.
+
+```js
+request.head(url)
+```
+
+### request.del / request.delete
+
+Same as `request()`, but defaults to `method: "DELETE"`.
+
+```js
+request.del(url)
+request.delete(url)
+```
+
+### request.get
+
+Same as `request()` (for uniformity).
+
+```js
+request.get(url)
+```
+### request.cookie
Function that creates a new cookie.
@@ -1017,8 +1036,7 @@ the server sent a compressed response.
console.log('server encoded the data as: ' + (response.headers['content-encoding'] || 'identity'))
console.log('the decoded data is: ' + body)
}
- )
- .on('data', function(data) {
+ ).on('data', function(data) {
// decompressed data as it is received
console.log('decoded chunk: ' + data)
})
diff --git a/deps/npm/node_modules/request/index.js b/deps/npm/node_modules/request/index.js
index f9b480a1d0..9ec65ea268 100755
--- a/deps/npm/node_modules/request/index.js
+++ b/deps/npm/node_modules/request/index.js
@@ -14,14 +14,15 @@
'use strict'
-var extend = require('extend')
-var cookies = require('./lib/cookies')
-var helpers = require('./lib/helpers')
+var extend = require('extend')
+ , cookies = require('./lib/cookies')
+ , helpers = require('./lib/helpers')
var paramsHaveRequestBody = helpers.paramsHaveRequestBody
+
// organize params for patch, post, put, head, del
-function initParams (uri, options, callback) {
+function initParams(uri, options, callback) {
if (typeof options === 'function') {
callback = options
}
@@ -65,7 +66,6 @@ function verbFunc (verb) {
// define like this to please codeintel/intellisense IDEs
request.get = verbFunc('get')
request.head = verbFunc('head')
-request.options = verbFunc('options')
request.post = verbFunc('post')
request.put = verbFunc('put')
request.patch = verbFunc('patch')
@@ -81,6 +81,7 @@ request.cookie = function (str) {
}
function wrapRequestMethod (method, options, requester, verb) {
+
return function (uri, opts, callback) {
var params = initParams(uri, opts, callback)
@@ -111,15 +112,15 @@ request.defaults = function (options, requester) {
options = {}
}
- var defaults = wrapRequestMethod(self, options, requester)
+ var defaults = wrapRequestMethod(self, options, requester)
var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete']
- verbs.forEach(function (verb) {
- defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb)
+ verbs.forEach(function(verb) {
+ defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb)
})
- defaults.cookie = wrapRequestMethod(self.cookie, options, requester)
- defaults.jar = self.jar
+ defaults.cookie = wrapRequestMethod(self.cookie, options, requester)
+ defaults.jar = self.jar
defaults.defaults = self.defaults
return defaults
}
@@ -145,11 +146,11 @@ request.initParams = initParams
// Backwards compatibility for request.debug
Object.defineProperty(request, 'debug', {
- enumerable: true,
- get: function () {
+ enumerable : true,
+ get : function() {
return request.Request.debug
},
- set: function (debug) {
+ set : function(debug) {
request.Request.debug = debug
}
})
diff --git a/deps/npm/node_modules/request/lib/auth.js b/deps/npm/node_modules/request/lib/auth.js
index 42f9adaec7..559ca57be9 100644
--- a/deps/npm/node_modules/request/lib/auth.js
+++ b/deps/npm/node_modules/request/lib/auth.js
@@ -1,11 +1,12 @@
'use strict'
var caseless = require('caseless')
-var uuid = require('uuid')
-var helpers = require('./helpers')
+ , uuid = require('uuid')
+ , helpers = require('./helpers')
var md5 = helpers.md5
-var toBase64 = helpers.toBase64
+ , toBase64 = helpers.toBase64
+
function Auth (request) {
// define all public properties here
@@ -125,7 +126,7 @@ Auth.prototype.digest = function (method, path, authHeader) {
Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) {
var self = this
- var request = self.request
+ , request = self.request
var authHeader
if (bearer === undefined && user === undefined) {
@@ -142,7 +143,7 @@ Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) {
Auth.prototype.onResponse = function (response) {
var self = this
- var request = self.request
+ , request = self.request
if (!self.hasAuth || self.sentAuth) { return null }
diff --git a/deps/npm/node_modules/request/lib/cookies.js b/deps/npm/node_modules/request/lib/cookies.js
index bd5d46bead..412c07d63b 100644
--- a/deps/npm/node_modules/request/lib/cookies.js
+++ b/deps/npm/node_modules/request/lib/cookies.js
@@ -3,9 +3,10 @@
var tough = require('tough-cookie')
var Cookie = tough.Cookie
-var CookieJar = tough.CookieJar
+ , CookieJar = tough.CookieJar
-exports.parse = function (str) {
+
+exports.parse = function(str) {
if (str && str.uri) {
str = str.uri
}
@@ -16,23 +17,23 @@ exports.parse = function (str) {
}
// Adapt the sometimes-Async api of tough.CookieJar to our requirements
-function RequestJar (store) {
+function RequestJar(store) {
var self = this
self._jar = new CookieJar(store, {looseMode: true})
}
-RequestJar.prototype.setCookie = function (cookieOrStr, uri, options) {
+RequestJar.prototype.setCookie = function(cookieOrStr, uri, options) {
var self = this
return self._jar.setCookieSync(cookieOrStr, uri, options || {})
}
-RequestJar.prototype.getCookieString = function (uri) {
+RequestJar.prototype.getCookieString = function(uri) {
var self = this
return self._jar.getCookieStringSync(uri)
}
-RequestJar.prototype.getCookies = function (uri) {
+RequestJar.prototype.getCookies = function(uri) {
var self = this
return self._jar.getCookiesSync(uri)
}
-exports.jar = function (store) {
+exports.jar = function(store) {
return new RequestJar(store)
}
diff --git a/deps/npm/node_modules/request/lib/getProxyFromURI.js b/deps/npm/node_modules/request/lib/getProxyFromURI.js
index 4633ba5f63..c2013a6e12 100644
--- a/deps/npm/node_modules/request/lib/getProxyFromURI.js
+++ b/deps/npm/node_modules/request/lib/getProxyFromURI.js
@@ -1,33 +1,33 @@
'use strict'
-function formatHostname (hostname) {
+function formatHostname(hostname) {
// canonicalize the hostname, so that 'oogle.com' won't match 'google.com'
return hostname.replace(/^\.*/, '.').toLowerCase()
}
-function parseNoProxyZone (zone) {
+function parseNoProxyZone(zone) {
zone = zone.trim().toLowerCase()
var zoneParts = zone.split(':', 2)
- var zoneHost = formatHostname(zoneParts[0])
- var zonePort = zoneParts[1]
- var hasPort = zone.indexOf(':') > -1
+ , zoneHost = formatHostname(zoneParts[0])
+ , zonePort = zoneParts[1]
+ , hasPort = zone.indexOf(':') > -1
return {hostname: zoneHost, port: zonePort, hasPort: hasPort}
}
-function uriInNoProxy (uri, noProxy) {
+function uriInNoProxy(uri, noProxy) {
var port = uri.port || (uri.protocol === 'https:' ? '443' : '80')
- var hostname = formatHostname(uri.hostname)
- var noProxyList = noProxy.split(',')
+ , hostname = formatHostname(uri.hostname)
+ , noProxyList = noProxy.split(',')
// iterate through the noProxyList until it finds a match.
- return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) {
+ return noProxyList.map(parseNoProxyZone).some(function(noProxyZone) {
var isMatchedAt = hostname.indexOf(noProxyZone.hostname)
- var hostnameMatched = (
- isMatchedAt > -1 &&
- (isMatchedAt === hostname.length - noProxyZone.hostname.length)
- )
+ , hostnameMatched = (
+ isMatchedAt > -1 &&
+ (isMatchedAt === hostname.length - noProxyZone.hostname.length)
+ )
if (noProxyZone.hasPort) {
return (port === noProxyZone.port) && hostnameMatched
@@ -37,7 +37,7 @@ function uriInNoProxy (uri, noProxy) {
})
}
-function getProxyFromURI (uri) {
+function getProxyFromURI(uri) {
// Decide the proper request proxy to use based on the request URI object and the
// environmental variables (NO_PROXY, HTTP_PROXY, etc.)
// respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html)
@@ -60,14 +60,14 @@ function getProxyFromURI (uri) {
if (uri.protocol === 'http:') {
return process.env.HTTP_PROXY ||
- process.env.http_proxy || null
+ process.env.http_proxy || null
}
if (uri.protocol === 'https:') {
return process.env.HTTPS_PROXY ||
- process.env.https_proxy ||
- process.env.HTTP_PROXY ||
- process.env.http_proxy || null
+ process.env.https_proxy ||
+ process.env.HTTP_PROXY ||
+ process.env.http_proxy || null
}
// if none of that works, return null
diff --git a/deps/npm/node_modules/request/lib/har.js b/deps/npm/node_modules/request/lib/har.js
index 2f660309d8..3059574878 100644
--- a/deps/npm/node_modules/request/lib/har.js
+++ b/deps/npm/node_modules/request/lib/har.js
@@ -71,10 +71,14 @@ Har.prototype.prep = function (data) {
'multipart/related',
'multipart/form-data',
'multipart/alternative'])) {
+
// reset values
data.postData.mimeType = 'multipart/form-data'
- } else if (some([
+ }
+
+ else if (some([
'application/x-www-form-urlencoded'])) {
+
if (!data.postData.params) {
data.postData.text = ''
} else {
@@ -83,11 +87,14 @@ Har.prototype.prep = function (data) {
// always overwrite
data.postData.text = qs.stringify(data.postData.paramsObj)
}
- } else if (some([
+ }
+
+ else if (some([
'text/json',
'text/x-json',
'application/json',
'application/x-json'])) {
+
data.postData.mimeType = 'application/json'
if (data.postData.text) {
@@ -161,12 +168,14 @@ Har.prototype.options = function (options) {
}
if (test('application/x-www-form-urlencoded')) {
options.form = req.postData.paramsObj
- } else if (test('application/json')) {
+ }
+ else if (test('application/json')) {
if (req.postData.jsonObj) {
options.body = req.postData.jsonObj
options.json = true
}
- } else if (test('multipart/form-data')) {
+ }
+ else if (test('multipart/form-data')) {
options.formData = {}
req.postData.params.forEach(function (param) {
@@ -193,7 +202,8 @@ Har.prototype.options = function (options) {
options.formData[param.name] = attachment
})
- } else {
+ }
+ else {
if (req.postData.text) {
options.body = req.postData.text
}
diff --git a/deps/npm/node_modules/request/lib/helpers.js b/deps/npm/node_modules/request/lib/helpers.js
index 8b2a7e6ebf..05c77a0bdd 100644
--- a/deps/npm/node_modules/request/lib/helpers.js
+++ b/deps/npm/node_modules/request/lib/helpers.js
@@ -1,14 +1,14 @@
'use strict'
var jsonSafeStringify = require('json-stringify-safe')
-var crypto = require('crypto')
-var Buffer = require('safe-buffer').Buffer
+ , crypto = require('crypto')
+ , Buffer = require('safe-buffer').Buffer
var defer = typeof setImmediate === 'undefined'
? process.nextTick
: setImmediate
-function paramsHaveRequestBody (params) {
+function paramsHaveRequestBody(params) {
return (
params.body ||
params.requestBodyStream ||
@@ -57,10 +57,10 @@ function version () {
}
exports.paramsHaveRequestBody = paramsHaveRequestBody
-exports.safeStringify = safeStringify
-exports.md5 = md5
-exports.isReadStream = isReadStream
-exports.toBase64 = toBase64
-exports.copy = copy
-exports.version = version
-exports.defer = defer
+exports.safeStringify = safeStringify
+exports.md5 = md5
+exports.isReadStream = isReadStream
+exports.toBase64 = toBase64
+exports.copy = copy
+exports.version = version
+exports.defer = defer
diff --git a/deps/npm/node_modules/request/lib/multipart.js b/deps/npm/node_modules/request/lib/multipart.js
index d6b9812777..fc7b50276e 100644
--- a/deps/npm/node_modules/request/lib/multipart.js
+++ b/deps/npm/node_modules/request/lib/multipart.js
@@ -1,9 +1,10 @@
'use strict'
var uuid = require('uuid')
-var CombinedStream = require('combined-stream')
-var isstream = require('isstream')
-var Buffer = require('safe-buffer').Buffer
+ , CombinedStream = require('combined-stream')
+ , isstream = require('isstream')
+ , Buffer = require('safe-buffer').Buffer
+
function Multipart (request) {
this.request = request
@@ -14,8 +15,8 @@ function Multipart (request) {
Multipart.prototype.isChunked = function (options) {
var self = this
- var chunked = false
- var parts = options.data || options
+ , chunked = false
+ , parts = options.data || options
if (!parts.forEach) {
self.request.emit('error', new Error('Argument error, options.multipart.'))
@@ -102,7 +103,7 @@ Multipart.prototype.onRequest = function (options) {
var self = this
var chunked = self.isChunked(options)
- var parts = options.data || options
+ , parts = options.data || options
self.setHeaders(chunked)
self.chunked = chunked
diff --git a/deps/npm/node_modules/request/lib/oauth.js b/deps/npm/node_modules/request/lib/oauth.js
index 01c6262827..13b693773e 100644
--- a/deps/npm/node_modules/request/lib/oauth.js
+++ b/deps/npm/node_modules/request/lib/oauth.js
@@ -1,12 +1,13 @@
'use strict'
var url = require('url')
-var qs = require('qs')
-var caseless = require('caseless')
-var uuid = require('uuid')
-var oauth = require('oauth-sign')
-var crypto = require('crypto')
-var Buffer = require('safe-buffer').Buffer
+ , qs = require('qs')
+ , caseless = require('caseless')
+ , uuid = require('uuid')
+ , oauth = require('oauth-sign')
+ , crypto = require('crypto')
+ , Buffer = require('safe-buffer').Buffer
+
function OAuth (request) {
this.request = request
@@ -22,7 +23,7 @@ OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib)
oa.oauth_version = '1.0'
}
if (!oa.oauth_timestamp) {
- oa.oauth_timestamp = Math.floor(Date.now() / 1000).toString()
+ oa.oauth_timestamp = Math.floor( Date.now() / 1000 ).toString()
}
if (!oa.oauth_nonce) {
oa.oauth_nonce = uuid().replace(/-/g, '')
@@ -31,11 +32,11 @@ OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib)
oa.oauth_signature_method = 'HMAC-SHA1'
}
- var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key // eslint-disable-line camelcase
+ 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 // eslint-disable-line camelcase
+ var token_secret = oa.oauth_token_secret
delete oa.oauth_token_secret
var realm = oa.oauth_realm
@@ -50,9 +51,8 @@ OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib)
method,
baseurl,
params,
- consumer_secret_or_private_key, // eslint-disable-line camelcase
- token_secret // eslint-disable-line camelcase
- )
+ consumer_secret_or_private_key,
+ token_secret)
if (realm) {
oa.realm = realm
@@ -61,7 +61,7 @@ OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib)
return oa
}
-OAuth.prototype.buildBodyHash = function (_oauth, body) {
+OAuth.prototype.buildBodyHash = function(_oauth, body) {
if (['HMAC-SHA1', 'RSA-SHA1'].indexOf(_oauth.signature_method || 'HMAC-SHA1') < 0) {
this.request.emit('error', new Error('oauth: ' + _oauth.signature_method +
' signature_method not supported with body_hash signing.'))
@@ -71,7 +71,7 @@ OAuth.prototype.buildBodyHash = function (_oauth, body) {
shasum.update(body || '')
var sha1 = shasum.digest('hex')
- return Buffer.from(sha1, 'hex').toString('base64')
+ return Buffer.from(sha1).toString('base64')
}
OAuth.prototype.concatParams = function (oa, sep, wrap) {
@@ -96,16 +96,16 @@ OAuth.prototype.onRequest = function (_oauth) {
self.params = _oauth
var uri = self.request.uri || {}
- var method = self.request.method || ''
- var headers = caseless(self.request.headers)
- var body = self.request.body || ''
- var qsLib = self.request.qsLib || qs
+ , method = self.request.method || ''
+ , headers = caseless(self.request.headers)
+ , body = self.request.body || ''
+ , qsLib = self.request.qsLib || qs
var form
- var query
- var contentType = headers.get('content-type') || ''
- var formContentType = 'application/x-www-form-urlencoded'
- var transport = _oauth.transport_method || 'header'
+ , query
+ , contentType = headers.get('content-type') || ''
+ , formContentType = 'application/x-www-form-urlencoded'
+ , transport = _oauth.transport_method || 'header'
if (contentType.slice(0, formContentType.length) === formContentType) {
contentType = formContentType
diff --git a/deps/npm/node_modules/request/lib/querystring.js b/deps/npm/node_modules/request/lib/querystring.js
index 4a32cd1491..baf5e8021f 100644
--- a/deps/npm/node_modules/request/lib/querystring.js
+++ b/deps/npm/node_modules/request/lib/querystring.js
@@ -1,7 +1,8 @@
'use strict'
var qs = require('qs')
-var querystring = require('querystring')
+ , querystring = require('querystring')
+
function Querystring (request) {
this.request = request
@@ -12,7 +13,7 @@ function Querystring (request) {
}
Querystring.prototype.init = function (options) {
- if (this.lib) { return }
+ if (this.lib) {return}
this.useQuerystring = options.useQuerystring
this.lib = (this.useQuerystring ? querystring : qs)
diff --git a/deps/npm/node_modules/request/lib/redirect.js b/deps/npm/node_modules/request/lib/redirect.js
index b9150e77c7..f8604491f3 100644
--- a/deps/npm/node_modules/request/lib/redirect.js
+++ b/deps/npm/node_modules/request/lib/redirect.js
@@ -9,7 +9,7 @@ function Redirect (request) {
this.followRedirects = true
this.followAllRedirects = false
this.followOriginalHttpMethod = false
- this.allowRedirect = function () { return true }
+ this.allowRedirect = function () {return true}
this.maxRedirects = 10
this.redirects = []
this.redirectsFollowed = 0
@@ -44,7 +44,7 @@ Redirect.prototype.onRequest = function (options) {
Redirect.prototype.redirectTo = function (response) {
var self = this
- var request = self.request
+ , request = self.request
var redirectTo = null
if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) {
@@ -78,7 +78,7 @@ Redirect.prototype.redirectTo = function (response) {
Redirect.prototype.onResponse = function (response) {
var self = this
- var request = self.request
+ , request = self.request
var redirectTo = self.redirectTo(response)
if (!redirectTo || !self.allowRedirect.call(request, response)) {
@@ -112,10 +112,13 @@ Redirect.prototype.onResponse = function (response) {
delete request.agent
}
- self.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo })
-
- if (self.followAllRedirects && request.method !== 'HEAD' &&
- response.statusCode !== 401 && response.statusCode !== 307) {
+ self.redirects.push(
+ { statusCode : response.statusCode
+ , redirectUri: redirectTo
+ }
+ )
+ if (self.followAllRedirects && request.method !== 'HEAD'
+ && response.statusCode !== 401 && response.statusCode !== 307) {
request.method = self.followOriginalHttpMethod ? request.method : 'GET'
}
// request.method = 'GET' // Force all redirects to use GET || commented out fixes #215
diff --git a/deps/npm/node_modules/request/lib/tunnel.js b/deps/npm/node_modules/request/lib/tunnel.js
index 4479003f69..bf96a8fec5 100644
--- a/deps/npm/node_modules/request/lib/tunnel.js
+++ b/deps/npm/node_modules/request/lib/tunnel.js
@@ -1,7 +1,7 @@
'use strict'
var url = require('url')
-var tunnel = require('tunnel-agent')
+ , tunnel = require('tunnel-agent')
var defaultProxyHeaderWhiteList = [
'accept',
@@ -31,10 +31,10 @@ var defaultProxyHeaderExclusiveList = [
'proxy-authorization'
]
-function constructProxyHost (uriObject) {
+function constructProxyHost(uriObject) {
var port = uriObject.port
- var protocol = uriObject.protocol
- var proxyHost = uriObject.hostname + ':'
+ , protocol = uriObject.protocol
+ , proxyHost = uriObject.hostname + ':'
if (port) {
proxyHost += port
@@ -47,7 +47,7 @@ function constructProxyHost (uriObject) {
return proxyHost
}
-function constructProxyHeaderWhiteList (headers, proxyHeaderWhiteList) {
+function constructProxyHeaderWhiteList(headers, proxyHeaderWhiteList) {
var whiteList = proxyHeaderWhiteList
.reduce(function (set, header) {
set[header.toLowerCase()] = true
@@ -68,40 +68,41 @@ function constructTunnelOptions (request, proxyHeaders) {
var proxy = request.proxy
var tunnelOptions = {
- proxy: {
- host: proxy.hostname,
- port: +proxy.port,
- proxyAuth: proxy.auth,
- headers: proxyHeaders
+ proxy : {
+ host : proxy.hostname,
+ port : +proxy.port,
+ proxyAuth : proxy.auth,
+ headers : proxyHeaders
},
- headers: request.headers,
- ca: request.ca,
- cert: request.cert,
- key: request.key,
- passphrase: request.passphrase,
- pfx: request.pfx,
- ciphers: request.ciphers,
- rejectUnauthorized: request.rejectUnauthorized,
- secureOptions: request.secureOptions,
- secureProtocol: request.secureProtocol
+ headers : request.headers,
+ ca : request.ca,
+ cert : request.cert,
+ key : request.key,
+ passphrase : request.passphrase,
+ pfx : request.pfx,
+ ciphers : request.ciphers,
+ rejectUnauthorized : request.rejectUnauthorized,
+ secureOptions : request.secureOptions,
+ secureProtocol : request.secureProtocol
}
return tunnelOptions
}
-function constructTunnelFnName (uri, proxy) {
+function constructTunnelFnName(uri, proxy) {
var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http')
var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http')
return [uriProtocol, proxyProtocol].join('Over')
}
-function getTunnelFn (request) {
+function getTunnelFn(request) {
var uri = request.uri
var proxy = request.proxy
var tunnelFnName = constructTunnelFnName(uri, proxy)
return tunnel[tunnelFnName]
}
+
function Tunnel (request) {
this.request = request
this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList
@@ -113,8 +114,8 @@ function Tunnel (request) {
Tunnel.prototype.isEnabled = function () {
var self = this
- var request = self.request
- // Tunnel HTTPS by default. Allow the user to override this setting.
+ , request = self.request
+ // Tunnel HTTPS by default. Allow the user to override this setting.
// If self.tunnelOverride is set (the user specified a value), use it.
if (typeof self.tunnelOverride !== 'undefined') {
@@ -132,7 +133,7 @@ Tunnel.prototype.isEnabled = function () {
Tunnel.prototype.setup = function (options) {
var self = this
- var request = self.request
+ , request = self.request
options = options || {}
diff --git a/deps/npm/node_modules/request/package.json b/deps/npm/node_modules/request/package.json
index 5ab26dd307..8f492a21e7 100644
--- a/deps/npm/node_modules/request/package.json
+++ b/deps/npm/node_modules/request/package.json
@@ -1,38 +1,32 @@
{
- "_args": [
- [
- "request@2.86.0",
- "/Users/rebecca/code/npm"
- ]
- ],
- "_from": "request@2.86.0",
- "_id": "request@2.86.0",
+ "_from": "request@2.81.0",
+ "_id": "request@2.81.0",
"_inBundle": false,
- "_integrity": "sha512-BQZih67o9r+Ys94tcIW4S7Uu8pthjrQVxhsZ/weOwHbDfACxvIyvnAbzFQxjy1jMtvFSzv5zf4my6cZsJBbVzw==",
+ "_integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=",
"_location": "/request",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
- "raw": "request@2.86.0",
+ "raw": "request@2.81.0",
"name": "request",
"escapedName": "request",
- "rawSpec": "2.86.0",
+ "rawSpec": "2.81.0",
"saveSpec": null,
- "fetchSpec": "2.86.0"
+ "fetchSpec": "2.81.0"
},
"_requiredBy": [
+ "#USER",
"/",
- "/cloudant-follow",
"/couchapp",
"/coveralls",
- "/nano",
"/node-gyp",
"/npm-registry-client"
],
- "_resolved": "https://registry.npmjs.org/request/-/request-2.86.0.tgz",
- "_spec": "2.86.0",
- "_where": "/Users/rebecca/code/npm",
+ "_resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz",
+ "_shasum": "c6928946a0e06c5f8d6f8a9333469ffda46298a0",
+ "_spec": "request@2.81.0",
+ "_where": "/Users/zkat/Documents/code/work/npm",
"author": {
"name": "Mikeal Rogers",
"email": "mikeal.rogers@gmail.com"
@@ -40,37 +34,41 @@
"bugs": {
"url": "http://github.com/request/request/issues"
},
+ "bundleDependencies": false,
"dependencies": {
- "aws-sign2": "~0.7.0",
- "aws4": "^1.6.0",
+ "aws-sign2": "~0.6.0",
+ "aws4": "^1.2.1",
"caseless": "~0.12.0",
"combined-stream": "~1.0.5",
- "extend": "~3.0.1",
+ "extend": "~3.0.0",
"forever-agent": "~0.6.1",
- "form-data": "~2.3.1",
- "har-validator": "~5.0.3",
- "hawk": "~6.0.2",
- "http-signature": "~1.2.0",
+ "form-data": "~2.1.1",
+ "har-validator": "~4.2.1",
+ "hawk": "~3.1.3",
+ "http-signature": "~1.1.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
- "mime-types": "~2.1.17",
- "oauth-sign": "~0.8.2",
- "performance-now": "^2.1.0",
- "qs": "~6.5.1",
- "safe-buffer": "^5.1.1",
- "tough-cookie": "~2.3.3",
+ "mime-types": "~2.1.7",
+ "oauth-sign": "~0.8.1",
+ "performance-now": "^0.2.0",
+ "qs": "~6.4.0",
+ "safe-buffer": "^5.0.1",
+ "stringstream": "~0.0.4",
+ "tough-cookie": "~2.3.0",
"tunnel-agent": "^0.6.0",
- "uuid": "^3.1.0"
+ "uuid": "^3.0.0"
},
+ "deprecated": false,
"description": "Simplified HTTP request client.",
"devDependencies": {
"bluebird": "^3.2.1",
"browserify": "^13.0.1",
"browserify-istanbul": "^2.0.0",
"buffer-equal": "^1.0.0",
- "codecov": "^2.0.2",
+ "codecov": "^1.0.1",
"coveralls": "^2.11.4",
+ "eslint": "^2.5.3",
"function-bind": "^1.0.2",
"istanbul": "^0.4.0",
"karma": "^1.1.1",
@@ -82,7 +80,6 @@
"phantomjs-prebuilt": "^2.1.3",
"rimraf": "^2.2.8",
"server-destroy": "^1.0.1",
- "standard": "^9.0.0",
"tape": "^4.6.0",
"taper": "^0.5.0"
},
@@ -96,6 +93,7 @@
],
"greenkeeper": {
"ignore": [
+ "eslint",
"hawk",
"har-validator"
]
@@ -115,11 +113,11 @@
"url": "git+https://github.com/request/request.git"
},
"scripts": {
- "lint": "standard",
+ "lint": "eslint lib/ *.js tests/ && echo Lint passed.",
"test": "npm run lint && npm run test-ci && npm run test-browser",
"test-browser": "node tests/browser/start.js",
"test-ci": "taper tests/test-*.js",
"test-cov": "istanbul cover tape tests/test-*.js"
},
- "version": "2.86.0"
+ "version": "2.81.0"
}
diff --git a/deps/npm/node_modules/request/request.js b/deps/npm/node_modules/request/request.js
index c93258b3b2..467524ba4e 100644
--- a/deps/npm/node_modules/request/request.js
+++ b/deps/npm/node_modules/request/request.js
@@ -1,46 +1,48 @@
'use strict'
var http = require('http')
-var https = require('https')
-var url = require('url')
-var util = require('util')
-var stream = require('stream')
-var zlib = require('zlib')
-var hawk = require('hawk')
-var aws2 = require('aws-sign2')
-var aws4 = require('aws4')
-var httpSignature = require('http-signature')
-var mime = require('mime-types')
-var caseless = require('caseless')
-var ForeverAgent = require('forever-agent')
-var FormData = require('form-data')
-var extend = require('extend')
-var isstream = require('isstream')
-var isTypedArray = require('is-typedarray').strict
-var helpers = require('./lib/helpers')
-var cookies = require('./lib/cookies')
-var getProxyFromURI = require('./lib/getProxyFromURI')
-var Querystring = require('./lib/querystring').Querystring
-var Har = require('./lib/har').Har
-var Auth = require('./lib/auth').Auth
-var OAuth = require('./lib/oauth').OAuth
-var Multipart = require('./lib/multipart').Multipart
-var Redirect = require('./lib/redirect').Redirect
-var Tunnel = require('./lib/tunnel').Tunnel
-var now = require('performance-now')
-var Buffer = require('safe-buffer').Buffer
+ , https = require('https')
+ , url = require('url')
+ , util = require('util')
+ , stream = require('stream')
+ , zlib = require('zlib')
+ , hawk = require('hawk')
+ , aws2 = require('aws-sign2')
+ , aws4 = require('aws4')
+ , httpSignature = require('http-signature')
+ , mime = require('mime-types')
+ , stringstream = require('stringstream')
+ , caseless = require('caseless')
+ , ForeverAgent = require('forever-agent')
+ , FormData = require('form-data')
+ , extend = require('extend')
+ , isstream = require('isstream')
+ , isTypedArray = require('is-typedarray').strict
+ , helpers = require('./lib/helpers')
+ , cookies = require('./lib/cookies')
+ , getProxyFromURI = require('./lib/getProxyFromURI')
+ , Querystring = require('./lib/querystring').Querystring
+ , Har = require('./lib/har').Har
+ , Auth = require('./lib/auth').Auth
+ , OAuth = require('./lib/oauth').OAuth
+ , Multipart = require('./lib/multipart').Multipart
+ , Redirect = require('./lib/redirect').Redirect
+ , Tunnel = require('./lib/tunnel').Tunnel
+ , now = require('performance-now')
+ , Buffer = require('safe-buffer').Buffer
var safeStringify = helpers.safeStringify
-var isReadStream = helpers.isReadStream
-var toBase64 = helpers.toBase64
-var defer = helpers.defer
-var copy = helpers.copy
-var version = helpers.version
-var globalCookieJar = cookies.jar()
+ , isReadStream = helpers.isReadStream
+ , toBase64 = helpers.toBase64
+ , defer = helpers.defer
+ , copy = helpers.copy
+ , version = helpers.version
+ , globalCookieJar = cookies.jar()
+
var globalPool = {}
-function filterForNonReserved (reserved, options) {
+function filterForNonReserved(reserved, options) {
// Filter out properties that are not reserved.
// Reserved values are passed in at call site.
@@ -54,7 +56,7 @@ function filterForNonReserved (reserved, options) {
return object
}
-function filterOutReservedFunctions (reserved, options) {
+function filterOutReservedFunctions(reserved, options) {
// Filter out properties that are functions and are reserved.
// Reserved values are passed in at call site.
@@ -67,10 +69,11 @@ function filterOutReservedFunctions (reserved, options) {
}
}
return object
+
}
// Return a simpler request object to allow serialization
-function requestToJSON () {
+function requestToJSON() {
var self = this
return {
uri: self.uri,
@@ -80,7 +83,7 @@ function requestToJSON () {
}
// Return a simpler response object to allow serialization
-function responseToJSON () {
+function responseToJSON() {
var self = this
return {
statusCode: self.statusCode,
@@ -131,7 +134,7 @@ util.inherits(Request, stream.Stream)
// Debugging
Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG)
-function debug () {
+function debug() {
if (Request.debug) {
console.error('REQUEST %s', util.format.apply(util, arguments))
}
@@ -255,7 +258,7 @@ Request.prototype.init = function (options) {
self.rejectUnauthorized = false
}
- if (!self.uri.pathname) { self.uri.pathname = '/' }
+ if (!self.uri.pathname) {self.uri.pathname = '/'}
if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) {
// Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar
@@ -297,7 +300,8 @@ Request.prototype.init = function (options) {
self.jar(self._jar || options.jar)
if (!self.uri.port) {
- if (self.uri.protocol === 'http:') { self.uri.port = 80 } else if (self.uri.protocol === 'https:') { self.uri.port = 443 }
+ if (self.uri.protocol === 'http:') {self.uri.port = 80}
+ else if (self.uri.protocol === 'https:') {self.uri.port = 443}
}
if (self.proxy && !self.tunnel) {
@@ -384,12 +388,12 @@ Request.prototype.init = function (options) {
}
if (self.uri.auth && !self.hasHeader('authorization')) {
- var uriAuthPieces = self.uri.auth.split(':').map(function (item) { return self._qs.unescape(item) })
+ var uriAuthPieces = self.uri.auth.split(':').map(function(item) {return self._qs.unescape(item)})
self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true)
}
if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) {
- var proxyAuthPieces = self.proxy.auth.split(':').map(function (item) { return self._qs.unescape(item) })
+ var proxyAuthPieces = self.proxy.auth.split(':').map(function(item) {return self._qs.unescape(item)})
var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':'))
self.setHeader('proxy-authorization', authHeader)
}
@@ -421,9 +425,11 @@ Request.prototype.init = function (options) {
var length
if (typeof self.body === 'string') {
length = Buffer.byteLength(self.body)
- } else if (Array.isArray(self.body)) {
- length = self.body.reduce(function (a, b) { return a + b.length }, 0)
- } else {
+ }
+ else if (Array.isArray(self.body)) {
+ length = self.body.reduce(function (a, b) {return a + b.length}, 0)
+ }
+ else {
length = self.body.length
}
@@ -445,8 +451,8 @@ Request.prototype.init = function (options) {
}
var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol
- var defaultModules = {'http:': http, 'https:': https}
- var httpModules = self.httpModules || {}
+ , defaultModules = {'http:':http, 'https:':https}
+ , httpModules = self.httpModules || {}
self.httpModule = httpModules[protocol] || defaultModules[protocol]
@@ -511,9 +517,9 @@ Request.prototype.init = function (options) {
}
}
- // self.on('pipe', function () {
- // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.')
- // })
+ // self.on('pipe', function () {
+ // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.')
+ // })
})
defer(function () {
@@ -525,7 +531,8 @@ Request.prototype.init = function (options) {
if (self._form) {
if (!self._auth.hasAuth) {
self._form.pipe(self)
- } else if (self._auth.hasAuth && self._auth.sentAuth) {
+ }
+ else if (self._auth.hasAuth && self._auth.sentAuth) {
self._form.pipe(self)
}
}
@@ -576,6 +583,7 @@ Request.prototype.init = function (options) {
self.ntick = true
})
+
}
Request.prototype.getNewAgent = function () {
@@ -770,22 +778,21 @@ Request.prototype.start = function () {
self.req.on('response', self.onRequestResponse.bind(self))
self.req.on('error', self.onRequestError.bind(self))
- self.req.on('drain', function () {
+ self.req.on('drain', function() {
self.emit('drain')
})
-
- self.req.on('socket', function (socket) {
+ self.req.on('socket', function(socket) {
// `._connecting` was the old property which was made public in node v6.1.0
var isConnecting = socket._connecting || socket.connecting
if (self.timing) {
self.timings.socket = now() - self.startTimeNow
if (isConnecting) {
- var onLookupTiming = function () {
+ var onLookupTiming = function() {
self.timings.lookup = now() - self.startTimeNow
}
- var onConnectTiming = function () {
+ var onConnectTiming = function() {
self.timings.connect = now() - self.startTimeNow
}
@@ -793,14 +800,14 @@ Request.prototype.start = function () {
socket.once('connect', onConnectTiming)
// clean up timing event listeners if needed on error
- self.req.once('error', function () {
+ self.req.once('error', function() {
socket.removeListener('lookup', onLookupTiming)
socket.removeListener('connect', onConnectTiming)
})
}
}
- var setReqTimeout = function () {
+ var setReqTimeout = function() {
// This timeout sets the amount of time to wait *between* bytes sent
// from the server once connected.
//
@@ -822,7 +829,7 @@ Request.prototype.start = function () {
// keep-alive connection) do not bother. This is important since we won't
// get a 'connect' event for an already connected socket.
if (isConnecting) {
- var onReqSockConnect = function () {
+ var onReqSockConnect = function() {
socket.removeListener('connect', onReqSockConnect)
clearTimeout(self.timeoutTimer)
self.timeoutTimer = null
@@ -831,7 +838,7 @@ Request.prototype.start = function () {
socket.on('connect', onReqSockConnect)
- self.req.on('error', function (err) { // eslint-disable-line handle-callback-err
+ self.req.on('error', function(err) {
socket.removeListener('connect', onReqSockConnect)
})
@@ -863,8 +870,8 @@ Request.prototype.onRequestError = function (error) {
if (self._aborted) {
return
}
- if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' &&
- self.agent.addRequestNoreuse) {
+ if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET'
+ && self.agent.addRequestNoreuse) {
self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) }
self.start()
self.req.end()
@@ -885,7 +892,7 @@ Request.prototype.onRequestResponse = function (response) {
}
debug('onRequestResponse', self.uri.href, response.statusCode, response.headers)
- response.on('end', function () {
+ response.on('end', function() {
if (self.timing) {
self.timings.end = now() - self.startTimeNow
response.timingStart = self.startTime
@@ -941,8 +948,8 @@ Request.prototype.onRequestResponse = function (response) {
// XXX This is different on 0.10, because SSL is strict by default
if (self.httpModule === https &&
- self.strictSSL && (!response.hasOwnProperty('socket') ||
- !response.socket.authorized)) {
+ self.strictSSL && (!response.hasOwnProperty('socket') ||
+ !response.socket.authorized)) {
debug('strict ssl error', self.uri.href)
var sslErr = response.hasOwnProperty('socket') ? response.socket.authorizationError : self.uri.href + ' does not support SSL'
self.emit('error', new Error('SSL Error: ' + sslErr))
@@ -967,7 +974,7 @@ Request.prototype.onRequestResponse = function (response) {
var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar
var addCookie = function (cookie) {
- // set the cookie if it's domain in the href's domain.
+ //set the cookie if it's domain in the href's domain.
try {
targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true})
} catch (e) {
@@ -1003,13 +1010,13 @@ Request.prototype.onRequestResponse = function (response) {
var noBody = function (code) {
return (
- self.method === 'HEAD' ||
+ self.method === 'HEAD'
// Informational
- (code >= 100 && code < 200) ||
+ || (code >= 100 && code < 200)
// No Content
- code === 204 ||
+ || code === 204
// Not Modified
- code === 304
+ || code === 304
)
}
@@ -1023,8 +1030,8 @@ Request.prototype.onRequestResponse = function (response) {
// by common browsers.
// Always using Z_SYNC_FLUSH is what cURL does.
var zlibOptions = {
- flush: zlib.Z_SYNC_FLUSH,
- finishFlush: zlib.Z_SYNC_FLUSH
+ flush: zlib.Z_SYNC_FLUSH
+ , finishFlush: zlib.Z_SYNC_FLUSH
}
if (contentEncoding === 'gzip') {
@@ -1048,8 +1055,13 @@ Request.prototype.onRequestResponse = function (response) {
if (self.encoding) {
if (self.dests.length !== 0) {
console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.')
- } else {
+ } else if (responseContent.setEncoding) {
responseContent.setEncoding(self.encoding)
+ } else {
+ // Should only occur on node pre-v0.9.4 (joyent/node@9b5abe5) with
+ // zlib streams.
+ // If/When support for 0.9.4 is dropped, this should be unnecessary.
+ responseContent = responseContent.pipe(stringstream(self.encoding))
}
}
@@ -1081,11 +1093,13 @@ Request.prototype.onRequestResponse = function (response) {
responseContent.on('error', function (error) {
self.emit('error', error)
})
- responseContent.on('close', function () { self.emit('close') })
+ responseContent.on('close', function () {self.emit('close')})
if (self.callback) {
self.readResponseBody(response)
- } else { // if no callback
+ }
+ //if no callback
+ else {
self.on('end', function () {
if (self._aborted) {
debug('aborted', self.uri.href)
@@ -1100,10 +1114,10 @@ Request.prototype.onRequestResponse = function (response) {
Request.prototype.readResponseBody = function (response) {
var self = this
- debug("reading response's body")
+ debug('reading response\'s body')
var buffers = []
- var bufferLength = 0
- var strings = []
+ , bufferLength = 0
+ , strings = []
self.on('data', function (chunk) {
if (!Buffer.isBuffer(chunk)) {
@@ -1164,7 +1178,8 @@ Request.prototype.abort = function () {
if (self.req) {
self.req.abort()
- } else if (self.response) {
+ }
+ else if (self.response) {
self.response.destroy()
}
@@ -1180,7 +1195,8 @@ Request.prototype.pipeDest = function (dest) {
var ctname = response.caseless.has('content-type')
if (dest.setHeader) {
dest.setHeader(ctname, response.headers[ctname])
- } else {
+ }
+ else {
dest.headers[ctname] = response.headers[ctname]
}
}
@@ -1251,7 +1267,7 @@ Request.prototype.form = function (form) {
}
// create form-data object
self._form = new FormData()
- self._form.on('error', function (err) {
+ self._form.on('error', function(err) {
err.message = 'form-data: ' + err.message
self.emit('error', err)
self.abort()
@@ -1326,8 +1342,8 @@ Request.prototype.getHeader = function (name, headers) {
Request.prototype.enableUnixSocket = function () {
// Get the socket & request paths from the URL
var unixParts = this.uri.path.split(':')
- var host = unixParts[0]
- var path = unixParts[1]
+ , host = unixParts[0]
+ , path = unixParts[1]
// Apply unix properties to request
this.socketPath = host
this.uri.pathname = path
@@ -1337,6 +1353,7 @@ Request.prototype.enableUnixSocket = function () {
this.uri.isUnix = true
}
+
Request.prototype.auth = function (user, pass, sendImmediately, bearer) {
var self = this
@@ -1352,7 +1369,7 @@ Request.prototype.aws = function (opts, now) {
return self
}
- if (opts.sign_version === 4 || opts.sign_version === '4') {
+ if (opts.sign_version == 4 || opts.sign_version == '4') {
// use aws4
var options = {
host: self.uri.host,
@@ -1373,19 +1390,20 @@ Request.prototype.aws = function (opts, now) {
if (signRes.headers['X-Amz-Security-Token']) {
self.setHeader('x-amz-security-token', signRes.headers['X-Amz-Security-Token'])
}
- } else {
+ }
+ 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 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
@@ -1405,10 +1423,10 @@ Request.prototype.aws = function (opts, now) {
Request.prototype.httpSignature = function (opts) {
var self = this
httpSignature.signRequest({
- getHeader: function (header) {
+ getHeader: function(header) {
return self.getHeader(header, self.headers)
},
- setHeader: function (header, value) {
+ setHeader: function(header, value) {
self.setHeader(header, value)
},
method: self.method,
@@ -1445,13 +1463,13 @@ Request.prototype.jar = function (jar) {
} else {
var targetCookieJar = (jar && jar.getCookieString) ? jar : globalCookieJar
var urihref = self.uri.href
- // fetch cookie in the Specified host
+ //fetch cookie in the Specified host
if (targetCookieJar) {
cookies = targetCookieJar.getCookieString(urihref)
}
}
- // if need cookie and cookie is not empty
+ //if need cookie and cookie is not empty
if (cookies && cookies.length) {
if (self.originalCookieHeader) {
// Don't overwrite existing Cookie header
@@ -1464,6 +1482,7 @@ Request.prototype.jar = function (jar) {
return self
}
+
// Stream API
Request.prototype.pipe = function (dest, opts) {
var self = this
@@ -1486,7 +1505,7 @@ Request.prototype.pipe = function (dest, opts) {
}
Request.prototype.write = function () {
var self = this
- if (self._aborted) { return }
+ if (self._aborted) {return}
if (!self._started) {
self.start()
@@ -1497,7 +1516,7 @@ Request.prototype.write = function () {
}
Request.prototype.end = function (chunk) {
var self = this
- if (self._aborted) { return }
+ if (self._aborted) {return}
if (chunk) {
self.write(chunk)