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>2015-10-15 08:17:03 +0300
committerRebecca Turner <me@re-becca.org>2015-10-16 01:25:33 +0300
commit25a234b4595ee3f1a2c09e2a39e3c238aa642557 (patch)
treedef772e3c15c7bd3d0b05eeeb6069898617cbf23 /node_modules/request
parent4cd74b0cdc639081fcf292eb9a03dbd93451c7c0 (diff)
src: install npm@3 with npm@2
Restore the ability to do one-shot upgrades from the versions of npm bundled with Node 0.8 to npm@3, which simplifies using Travis with old Node and new npm, for compatibility testing purposes. Older versions of npm repack packages on install, which works poorly with the way npm@3 handles bundledDependencies with flat trees. Fixes: #9668 PR-URL: https://github.com/npm/npm/pull/9981
Diffstat (limited to 'node_modules/request')
-rw-r--r--node_modules/request/CHANGELOG.md15
-rw-r--r--node_modules/request/lib/auth.js23
-rw-r--r--node_modules/request/lib/cookies.js4
l---------node_modules/request/node_modules/.bin/har-validator1
l---------node_modules/request/node_modules/.bin/uuid1
-rw-r--r--node_modules/request/node_modules/aws-sign2/LICENSE55
-rw-r--r--node_modules/request/node_modules/aws-sign2/README.md4
-rw-r--r--node_modules/request/node_modules/aws-sign2/index.js212
-rw-r--r--node_modules/request/node_modules/aws-sign2/package.json49
-rw-r--r--node_modules/request/node_modules/bl/.npmignore1
-rw-r--r--node_modules/request/node_modules/bl/.travis.yml14
-rw-r--r--node_modules/request/node_modules/bl/LICENSE.md13
-rw-r--r--node_modules/request/node_modules/bl/README.md200
-rw-r--r--node_modules/request/node_modules/bl/bl.js216
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore5
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml39
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml1
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE18
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/README.md36
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown1651
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md60
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js1
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js82
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js27
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js959
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js197
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js520
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md3
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch604
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js107
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json37
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js106
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md54
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js209
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json19
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js3
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json38
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml7
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js13
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md19
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json28
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md18
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js24
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore2
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE20
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md7
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js221
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json34
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md16
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE24
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md53
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js67
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js6
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json54
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/package.json46
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js1
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js12
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js1
-rw-r--r--node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js1
-rw-r--r--node_modules/request/node_modules/bl/package.json62
-rw-r--r--node_modules/request/node_modules/bl/test/basic-test.js541
-rw-r--r--node_modules/request/node_modules/bl/test/sauce.js38
-rw-r--r--node_modules/request/node_modules/bl/test/test.js9
-rw-r--r--node_modules/request/node_modules/caseless/LICENSE28
-rw-r--r--node_modules/request/node_modules/caseless/README.md45
-rw-r--r--node_modules/request/node_modules/caseless/index.js66
-rw-r--r--node_modules/request/node_modules/caseless/package.json62
-rw-r--r--node_modules/request/node_modules/caseless/test.js40
-rw-r--r--node_modules/request/node_modules/combined-stream/License19
-rw-r--r--node_modules/request/node_modules/combined-stream/Readme.md138
-rw-r--r--node_modules/request/node_modules/combined-stream/lib/combined_stream.js188
-rw-r--r--node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore1
-rw-r--r--node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License19
-rw-r--r--node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile7
-rw-r--r--node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md141
-rw-r--r--node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js107
-rw-r--r--node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json64
-rw-r--r--node_modules/request/node_modules/combined-stream/package.json67
-rw-r--r--node_modules/request/node_modules/extend/.jscs.json104
-rw-r--r--node_modules/request/node_modules/extend/.npmignore1
-rw-r--r--node_modules/request/node_modules/extend/.travis.yml44
-rw-r--r--node_modules/request/node_modules/extend/CHANGELOG.md69
-rw-r--r--node_modules/request/node_modules/extend/LICENSE23
-rw-r--r--node_modules/request/node_modules/extend/README.md62
-rw-r--r--node_modules/request/node_modules/extend/component.json32
-rw-r--r--node_modules/request/node_modules/extend/index.js86
-rw-r--r--node_modules/request/node_modules/extend/package.json73
-rw-r--r--node_modules/request/node_modules/forever-agent/LICENSE55
-rw-r--r--node_modules/request/node_modules/forever-agent/README.md4
-rw-r--r--node_modules/request/node_modules/forever-agent/index.js138
-rw-r--r--node_modules/request/node_modules/forever-agent/package.json31
-rw-r--r--node_modules/request/node_modules/form-data/License19
-rw-r--r--node_modules/request/node_modules/form-data/Readme.md210
-rw-r--r--node_modules/request/node_modules/form-data/lib/browser.js1
-rw-r--r--node_modules/request/node_modules/form-data/lib/form_data.js374
-rw-r--r--node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md104
-rw-r--r--node_modules/request/node_modules/form-data/node_modules/async/LICENSE19
-rw-r--r--node_modules/request/node_modules/form-data/node_modules/async/lib/async.js1222
-rw-r--r--node_modules/request/node_modules/form-data/node_modules/async/package.json90
-rw-r--r--node_modules/request/node_modules/form-data/package.json85
-rw-r--r--node_modules/request/node_modules/har-validator/LICENSE13
-rw-r--r--node_modules/request/node_modules/har-validator/README.md386
-rwxr-xr-xnode_modules/request/node_modules/har-validator/bin/har-validator56
-rw-r--r--node_modules/request/node_modules/har-validator/lib/async.js14
-rw-r--r--node_modules/request/node_modules/har-validator/lib/error.js10
-rw-r--r--node_modules/request/node_modules/har-validator/lib/index.js22
-rw-r--r--node_modules/request/node_modules/har-validator/lib/runner.js29
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/cache.json13
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/cacheEntry.json31
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/content.json27
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/cookie.json34
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/creator.json18
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/entry.json51
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/har.json11
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/index.js49
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/log.json34
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/page.json30
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/pageTimings.json16
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/postData.json41
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/record.json18
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/request.json55
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/response.json52
-rw-r--r--node_modules/request/node_modules/har-validator/lib/schemas/timings.json40
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/index.js116
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/license21
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/index.js65
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/license21
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json71
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/readme.md86
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js11
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/license21
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json61
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md27
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/index.js4
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/license21
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json76
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/readme.md36
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/index.js50
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/license21
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json70
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/readme.md36
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/package.json95
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md213
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/commander/History.md261
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/commander/LICENSE22
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md351
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/commander/index.js1110
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.npmignore3
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.travis.yml5
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE22
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/README.md17
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js12
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json31
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/commander/package.json71
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.npmignore2
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.travis.yml3
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/LICENSE21
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md173
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js18
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/formats.js14
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js573
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore1
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml3
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/README.md72
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/example.js27
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/index.js61
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json37
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/test.js33
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore1
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml3
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE21
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md19
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js12
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore17
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE22
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md28
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js5
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json44
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json34
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js12
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml10
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md32
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js76
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json64
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js98
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/.npmignore1
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/LICENCE19
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/Makefile4
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/README.md32
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/immutable.js17
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/mutable.js15
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/package.json72
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/test.js63
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json42
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/require.js12
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/fixtures/cosmic.js84
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json82
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json88
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json112
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json68
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json107
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/default.json49
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json32
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json113
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json72
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/format.json143
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/items.json46
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json28
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json28
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json28
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json42
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json28
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json28
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json28
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json42
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json60
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json96
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json18
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndObject.json18
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json68
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json23
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json110
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json92
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json128
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json74
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/required.json39
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/type.json330
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json79
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema.js23
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js429
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/index.js3
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/license21
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js276
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/license21
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json43
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md75
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/package.json46
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/readme.md26
-rw-r--r--node_modules/request/node_modules/har-validator/package.json88
-rw-r--r--node_modules/request/node_modules/hawk/.npmignore20
-rwxr-xr-xnode_modules/request/node_modules/hawk/.travis.yml5
-rwxr-xr-xnode_modules/request/node_modules/hawk/LICENSE28
-rwxr-xr-xnode_modules/request/node_modules/hawk/README.md634
-rw-r--r--node_modules/request/node_modules/hawk/bower.json24
-rw-r--r--node_modules/request/node_modules/hawk/component.json19
-rwxr-xr-xnode_modules/request/node_modules/hawk/example/usage.js78
-rwxr-xr-xnode_modules/request/node_modules/hawk/images/hawk.pngbin0 -> 6945 bytes
-rwxr-xr-xnode_modules/request/node_modules/hawk/images/logo.pngbin0 -> 71732 bytes
-rwxr-xr-xnode_modules/request/node_modules/hawk/lib/browser.js643
-rwxr-xr-xnode_modules/request/node_modules/hawk/lib/client.js369
-rwxr-xr-xnode_modules/request/node_modules/hawk/lib/crypto.js126
-rwxr-xr-xnode_modules/request/node_modules/hawk/lib/index.js15
-rwxr-xr-xnode_modules/request/node_modules/hawk/lib/server.js540
-rwxr-xr-xnode_modules/request/node_modules/hawk/lib/utils.js164
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/boom/.npmignore18
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/boom/.travis.yml8
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/boom/CONTRIBUTING.md1
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/boom/LICENSE28
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/boom/README.md597
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/boom/images/boom.pngbin0 -> 29479 bytes
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/boom/lib/index.js312
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/boom/package.json64
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/boom/test/index.js616
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore18
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml8
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE28
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md16
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js68
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json61
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js102
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore18
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml7
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/hoek/CONTRIBUTING.md1
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE31
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/hoek/README.md584
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.pngbin0 -> 37939 bytes
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js132
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js993
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/hoek/package.json36
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js88
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js2513
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/ignore.txt0
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js1
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js1
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js1
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore18
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml5
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/sntp/LICENSE28
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/sntp/Makefile9
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/sntp/README.md68
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js16
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js25
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/sntp/index.js1
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js412
-rw-r--r--node_modules/request/node_modules/hawk/node_modules/sntp/package.json49
-rwxr-xr-xnode_modules/request/node_modules/hawk/node_modules/sntp/test/index.js435
-rw-r--r--node_modules/request/node_modules/hawk/package.json68
-rwxr-xr-xnode_modules/request/node_modules/hawk/test/browser.js1459
-rwxr-xr-xnode_modules/request/node_modules/hawk/test/client.js440
-rwxr-xr-xnode_modules/request/node_modules/hawk/test/crypto.js70
-rwxr-xr-xnode_modules/request/node_modules/hawk/test/index.js378
-rwxr-xr-xnode_modules/request/node_modules/hawk/test/readme.js95
-rwxr-xr-xnode_modules/request/node_modules/hawk/test/server.js1314
-rwxr-xr-xnode_modules/request/node_modules/hawk/test/uri.js849
-rwxr-xr-xnode_modules/request/node_modules/hawk/test/utils.js121
-rw-r--r--node_modules/request/node_modules/http-signature/.dir-locals.el6
-rw-r--r--node_modules/request/node_modules/http-signature/.npmignore7
-rw-r--r--node_modules/request/node_modules/http-signature/LICENSE18
-rw-r--r--node_modules/request/node_modules/http-signature/README.md79
-rw-r--r--node_modules/request/node_modules/http-signature/http_signing.md296
-rw-r--r--node_modules/request/node_modules/http-signature/lib/index.js27
-rw-r--r--node_modules/request/node_modules/http-signature/lib/parser.js304
-rw-r--r--node_modules/request/node_modules/http-signature/lib/signer.js178
-rw-r--r--node_modules/request/node_modules/http-signature/lib/util.js306
-rw-r--r--node_modules/request/node_modules/http-signature/lib/verify.js56
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore2
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE19
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/asn1/README.md50
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js13
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js27
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js267
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js36
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js317
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js20
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/asn1/package.json45
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js172
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js296
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md126
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js245
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json30
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore1
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG78
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE24
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/ctype/README82
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/ctype/README.old298
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js245
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js1485
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js944
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype241
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/ctype/package.json42
-rwxr-xr-xnode_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf129
-rwxr-xr-xnode_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle839
-rw-r--r--node_modules/request/node_modules/http-signature/package.json77
-rw-r--r--node_modules/request/node_modules/isstream/.npmignore1
-rw-r--r--node_modules/request/node_modules/isstream/.travis.yml12
-rw-r--r--node_modules/request/node_modules/isstream/LICENSE.md11
-rw-r--r--node_modules/request/node_modules/isstream/README.md66
-rw-r--r--node_modules/request/node_modules/isstream/isstream.js27
-rw-r--r--node_modules/request/node_modules/isstream/package.json42
-rw-r--r--node_modules/request/node_modules/isstream/test.js168
-rw-r--r--node_modules/request/node_modules/json-stringify-safe/.npmignore1
-rw-r--r--node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md14
-rw-r--r--node_modules/request/node_modules/json-stringify-safe/LICENSE15
-rw-r--r--node_modules/request/node_modules/json-stringify-safe/Makefile35
-rw-r--r--node_modules/request/node_modules/json-stringify-safe/README.md52
-rw-r--r--node_modules/request/node_modules/json-stringify-safe/package.json47
-rw-r--r--node_modules/request/node_modules/json-stringify-safe/stringify.js27
-rw-r--r--node_modules/request/node_modules/json-stringify-safe/test/mocha.opts2
-rw-r--r--node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js246
-rw-r--r--node_modules/request/node_modules/mime-types/HISTORY.md171
-rw-r--r--node_modules/request/node_modules/mime-types/LICENSE23
-rw-r--r--node_modules/request/node_modules/mime-types/README.md103
-rw-r--r--node_modules/request/node_modules/mime-types/index.js188
-rw-r--r--node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md274
-rw-r--r--node_modules/request/node_modules/mime-types/node_modules/mime-db/LICENSE22
-rw-r--r--node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md82
-rw-r--r--node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json6474
-rw-r--r--node_modules/request/node_modules/mime-types/node_modules/mime-db/index.js11
-rw-r--r--node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json74
-rw-r--r--node_modules/request/node_modules/mime-types/package.json60
-rw-r--r--node_modules/request/node_modules/node-uuid/.npmignore2
-rw-r--r--node_modules/request/node_modules/node-uuid/LICENSE.md21
-rw-r--r--node_modules/request/node_modules/node-uuid/README.md243
-rw-r--r--node_modules/request/node_modules/node-uuid/benchmark/README.md53
-rw-r--r--node_modules/request/node_modules/node-uuid/benchmark/bench.gnu174
-rwxr-xr-xnode_modules/request/node_modules/node-uuid/benchmark/bench.sh34
-rw-r--r--node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c34
-rw-r--r--node_modules/request/node_modules/node-uuid/benchmark/benchmark.js84
-rwxr-xr-xnode_modules/request/node_modules/node-uuid/bin/uuid26
-rw-r--r--node_modules/request/node_modules/node-uuid/bower.json23
-rw-r--r--node_modules/request/node_modules/node-uuid/component.json18
-rw-r--r--node_modules/request/node_modules/node-uuid/package.json49
-rw-r--r--node_modules/request/node_modules/node-uuid/test/compare_v1.js63
-rw-r--r--node_modules/request/node_modules/node-uuid/test/test.html17
-rw-r--r--node_modules/request/node_modules/node-uuid/test/test.js228
-rw-r--r--node_modules/request/node_modules/node-uuid/uuid.js247
-rw-r--r--node_modules/request/node_modules/oauth-sign/LICENSE55
-rw-r--r--node_modules/request/node_modules/oauth-sign/README.md4
-rw-r--r--node_modules/request/node_modules/oauth-sign/index.js134
-rw-r--r--node_modules/request/node_modules/oauth-sign/package.json59
-rw-r--r--node_modules/request/node_modules/oauth-sign/test.js89
-rw-r--r--node_modules/request/node_modules/qs/.eslintignore1
-rw-r--r--node_modules/request/node_modules/qs/.npmignore18
-rw-r--r--node_modules/request/node_modules/qs/.travis.yml8
-rw-r--r--node_modules/request/node_modules/qs/CHANGELOG.md99
-rw-r--r--node_modules/request/node_modules/qs/CONTRIBUTING.md1
-rw-r--r--node_modules/request/node_modules/qs/LICENSE28
-rw-r--r--node_modules/request/node_modules/qs/README.md331
-rw-r--r--node_modules/request/node_modules/qs/bower.json22
-rw-r--r--node_modules/request/node_modules/qs/component.json15
-rw-r--r--node_modules/request/node_modules/qs/dist/qs.js544
-rw-r--r--node_modules/request/node_modules/qs/lib/index.js15
-rw-r--r--node_modules/request/node_modules/qs/lib/parse.js187
-rw-r--r--node_modules/request/node_modules/qs/lib/stringify.js154
-rw-r--r--node_modules/request/node_modules/qs/lib/utils.js190
-rw-r--r--node_modules/request/node_modules/qs/package.json59
-rw-r--r--node_modules/request/node_modules/qs/test/parse.js478
-rw-r--r--node_modules/request/node_modules/qs/test/stringify.js293
-rw-r--r--node_modules/request/node_modules/qs/test/utils.js28
-rw-r--r--node_modules/request/node_modules/stringstream/.npmignore15
-rw-r--r--node_modules/request/node_modules/stringstream/.travis.yml4
-rw-r--r--node_modules/request/node_modules/stringstream/LICENSE.txt4
-rw-r--r--node_modules/request/node_modules/stringstream/README.md38
-rw-r--r--node_modules/request/node_modules/stringstream/example.js27
-rw-r--r--node_modules/request/node_modules/stringstream/package.json32
-rw-r--r--node_modules/request/node_modules/stringstream/stringstream.js102
-rw-r--r--node_modules/request/node_modules/tough-cookie/LICENSE27
-rw-r--r--node_modules/request/node_modules/tough-cookie/README.md492
-rw-r--r--node_modules/request/node_modules/tough-cookie/lib/cookie.js1342
-rw-r--r--node_modules/request/node_modules/tough-cookie/lib/memstore.js170
-rw-r--r--node_modules/request/node_modules/tough-cookie/lib/pathMatch.js61
-rw-r--r--node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js56
-rw-r--r--node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js98
-rw-r--r--node_modules/request/node_modules/tough-cookie/lib/store.js71
-rw-r--r--node_modules/request/node_modules/tough-cookie/package.json90
-rw-r--r--node_modules/request/node_modules/tunnel-agent/LICENSE55
-rw-r--r--node_modules/request/node_modules/tunnel-agent/README.md4
-rw-r--r--node_modules/request/node_modules/tunnel-agent/index.js241
-rw-r--r--node_modules/request/node_modules/tunnel-agent/package.json30
-rw-r--r--node_modules/request/package.json173
-rw-r--r--node_modules/request/request.js108
431 files changed, 57832 insertions, 157 deletions
diff --git a/node_modules/request/CHANGELOG.md b/node_modules/request/CHANGELOG.md
index a5da7d968..a43c6726a 100644
--- a/node_modules/request/CHANGELOG.md
+++ b/node_modules/request/CHANGELOG.md
@@ -1,5 +1,20 @@
## Change Log
+### v2.65.0 (2015/10/11)
+- [#1833](https://github.com/request/request/pull/1833) Update aws-sign2 to version 0.6.0 🚀 (@greenkeeperio-bot)
+- [#1811](https://github.com/request/request/pull/1811) Enable loose cookie parsing in tough-cookie (@Sebmaster)
+- [#1830](https://github.com/request/request/pull/1830) Bring back tilde ranges for all dependencies (@simov)
+- [#1821](https://github.com/request/request/pull/1821) Implement support for RFC 2617 MD5-sess algorithm. (@BigDSK)
+- [#1828](https://github.com/request/request/pull/1828) Updated qs dependency to 5.2.0 (@acroca)
+- [#1818](https://github.com/request/request/pull/1818) Extract `readResponseBody` method out of `onRequestResponse` (@pvoisin)
+- [#1819](https://github.com/request/request/pull/1819) Run stringify once (@mgenereu)
+- [#1814](https://github.com/request/request/pull/1814) Updated har-validator to version 2.0.2 (@greenkeeperio-bot)
+- [#1807](https://github.com/request/request/pull/1807) Updated tough-cookie to version 2.1.0 (@greenkeeperio-bot)
+- [#1800](https://github.com/request/request/pull/1800) Add caret ranges for devDependencies, except eslint (@simov)
+- [#1799](https://github.com/request/request/pull/1799) Updated karma-browserify to version 4.4.0 (@greenkeeperio-bot)
+- [#1797](https://github.com/request/request/pull/1797) Updated tape to version 4.2.0 (@greenkeeperio-bot)
+- [#1788](https://github.com/request/request/pull/1788) Pinned all dependencies (@greenkeeperio-bot)
+
### v2.64.0 (2015/09/25)
- [#1787](https://github.com/request/request/pull/1787) npm ignore examples, release.sh and disabled.appveyor.yml (@thisconnect)
- [#1775](https://github.com/request/request/pull/1775) Fix typo in README.md (@djchie)
diff --git a/node_modules/request/lib/auth.js b/node_modules/request/lib/auth.js
index 1be1f4258..1cb695216 100644
--- a/node_modules/request/lib/auth.js
+++ b/node_modules/request/lib/auth.js
@@ -50,8 +50,6 @@ Auth.prototype.bearer = function (bearer, sendImmediately) {
Auth.prototype.digest = function (method, path, authHeader) {
// TODO: More complete implementation of RFC 2617.
- // - check challenge.algorithm
- // - support algorithm="MD5-sess"
// - handle challenge.domain
// - support qop="auth-int" only
// - handle Authentication-Info (not necessarily?)
@@ -73,11 +71,28 @@ Auth.prototype.digest = function (method, path, authHeader) {
challenge[match[1]] = match[2] || match[3]
}
- var ha1 = md5(self.user + ':' + challenge.realm + ':' + self.pass)
- var ha2 = md5(method + ':' + path)
+ /**
+ * RFC 2617: handle both MD5 and MD5-sess algorithms.
+ *
+ * If the algorithm directive's value is "MD5" or unspecified, then HA1 is
+ * HA1=MD5(username:realm:password)
+ * If the algorithm directive's value is "MD5-sess", then HA1 is
+ * HA1=MD5(MD5(username:realm:password):nonce:cnonce)
+ */
+ var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) {
+ var ha1 = md5(user + ':' + realm + ':' + pass)
+ if (algorithm && algorithm.toLowerCase() === 'md5-sess') {
+ return md5(ha1 + ':' + nonce + ':' + cnonce)
+ } else {
+ return ha1
+ }
+ }
+
var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth'
var nc = qop && '00000001'
var cnonce = qop && uuid().replace(/-/g, '')
+ var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce)
+ var ha2 = md5(method + ':' + path)
var digestResponse = qop
? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2)
: md5(ha1 + ':' + challenge.nonce + ':' + ha2)
diff --git a/node_modules/request/lib/cookies.js b/node_modules/request/lib/cookies.js
index adde7c601..412c07d63 100644
--- a/node_modules/request/lib/cookies.js
+++ b/node_modules/request/lib/cookies.js
@@ -13,13 +13,13 @@ exports.parse = function(str) {
if (typeof str !== 'string') {
throw new Error('The cookie function only accepts STRING as param')
}
- return Cookie.parse(str)
+ return Cookie.parse(str, {loose: true})
}
// Adapt the sometimes-Async api of tough.CookieJar to our requirements
function RequestJar(store) {
var self = this
- self._jar = new CookieJar(store)
+ self._jar = new CookieJar(store, {looseMode: true})
}
RequestJar.prototype.setCookie = function(cookieOrStr, uri, options) {
var self = this
diff --git a/node_modules/request/node_modules/.bin/har-validator b/node_modules/request/node_modules/.bin/har-validator
new file mode 120000
index 000000000..c6ec16346
--- /dev/null
+++ b/node_modules/request/node_modules/.bin/har-validator
@@ -0,0 +1 @@
+../har-validator/bin/har-validator \ No newline at end of file
diff --git a/node_modules/request/node_modules/.bin/uuid b/node_modules/request/node_modules/.bin/uuid
new file mode 120000
index 000000000..80eb14aa1
--- /dev/null
+++ b/node_modules/request/node_modules/.bin/uuid
@@ -0,0 +1 @@
+../node-uuid/bin/uuid \ No newline at end of file
diff --git a/node_modules/request/node_modules/aws-sign2/LICENSE b/node_modules/request/node_modules/aws-sign2/LICENSE
new file mode 100644
index 000000000..a4a9aee0c
--- /dev/null
+++ b/node_modules/request/node_modules/aws-sign2/LICENSE
@@ -0,0 +1,55 @@
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS \ No newline at end of file
diff --git a/node_modules/request/node_modules/aws-sign2/README.md b/node_modules/request/node_modules/aws-sign2/README.md
new file mode 100644
index 000000000..763564e0a
--- /dev/null
+++ b/node_modules/request/node_modules/aws-sign2/README.md
@@ -0,0 +1,4 @@
+aws-sign
+========
+
+AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.
diff --git a/node_modules/request/node_modules/aws-sign2/index.js b/node_modules/request/node_modules/aws-sign2/index.js
new file mode 100644
index 000000000..ac7209308
--- /dev/null
+++ b/node_modules/request/node_modules/aws-sign2/index.js
@@ -0,0 +1,212 @@
+
+/*!
+ * Copyright 2010 LearnBoost <dev@learnboost.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var crypto = require('crypto')
+ , parse = require('url').parse
+ ;
+
+/**
+ * Valid keys.
+ */
+
+var keys =
+ [ 'acl'
+ , 'location'
+ , 'logging'
+ , 'notification'
+ , 'partNumber'
+ , 'policy'
+ , 'requestPayment'
+ , 'torrent'
+ , 'uploadId'
+ , 'uploads'
+ , 'versionId'
+ , 'versioning'
+ , 'versions'
+ , 'website'
+ ]
+
+/**
+ * Return an "Authorization" header value with the given `options`
+ * in the form of "AWS <key>:<signature>"
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function authorization (options) {
+ return 'AWS ' + options.key + ':' + sign(options)
+}
+
+module.exports = authorization
+module.exports.authorization = authorization
+
+/**
+ * Simple HMAC-SHA1 Wrapper
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function hmacSha1 (options) {
+ return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64')
+}
+
+module.exports.hmacSha1 = hmacSha1
+
+/**
+ * Create a base64 sha1 HMAC for `options`.
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function sign (options) {
+ options.message = stringToSign(options)
+ return hmacSha1(options)
+}
+module.exports.sign = sign
+
+/**
+ * Create a base64 sha1 HMAC for `options`.
+ *
+ * Specifically to be used with S3 presigned URLs
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function signQuery (options) {
+ options.message = queryStringToSign(options)
+ return hmacSha1(options)
+}
+module.exports.signQuery= signQuery
+
+/**
+ * Return a string for sign() with the given `options`.
+ *
+ * Spec:
+ *
+ * <verb>\n
+ * <md5>\n
+ * <content-type>\n
+ * <date>\n
+ * [headers\n]
+ * <resource>
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function stringToSign (options) {
+ var headers = options.amazonHeaders || ''
+ if (headers) headers += '\n'
+ var r =
+ [ options.verb
+ , options.md5
+ , options.contentType
+ , options.date ? options.date.toUTCString() : ''
+ , headers + options.resource
+ ]
+ return r.join('\n')
+}
+module.exports.queryStringToSign = stringToSign
+
+/**
+ * Return a string for sign() with the given `options`, but is meant exclusively
+ * for S3 presigned URLs
+ *
+ * Spec:
+ *
+ * <date>\n
+ * <resource>
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function queryStringToSign (options){
+ return 'GET\n\n\n' + options.date + '\n' + options.resource
+}
+module.exports.queryStringToSign = queryStringToSign
+
+/**
+ * Perform the following:
+ *
+ * - ignore non-amazon headers
+ * - lowercase fields
+ * - sort lexicographically
+ * - trim whitespace between ":"
+ * - join with newline
+ *
+ * @param {Object} headers
+ * @return {String}
+ * @api private
+ */
+
+function canonicalizeHeaders (headers) {
+ var buf = []
+ , fields = Object.keys(headers)
+ ;
+ for (var i = 0, len = fields.length; i < len; ++i) {
+ var field = fields[i]
+ , val = headers[field]
+ , field = field.toLowerCase()
+ ;
+ if (0 !== field.indexOf('x-amz')) continue
+ buf.push(field + ':' + val)
+ }
+ return buf.sort().join('\n')
+}
+module.exports.canonicalizeHeaders = canonicalizeHeaders
+
+/**
+ * Perform the following:
+ *
+ * - ignore non sub-resources
+ * - sort lexicographically
+ *
+ * @param {String} resource
+ * @return {String}
+ * @api private
+ */
+
+function canonicalizeResource (resource) {
+ var url = parse(resource, true)
+ , path = url.pathname
+ , buf = []
+ ;
+
+ Object.keys(url.query).forEach(function(key){
+ if (!~keys.indexOf(key)) return
+ var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key])
+ buf.push(key + val)
+ })
+
+ return path + (buf.length ? '?' + buf.sort().join('&') : '')
+}
+module.exports.canonicalizeResource = canonicalizeResource
diff --git a/node_modules/request/node_modules/aws-sign2/package.json b/node_modules/request/node_modules/aws-sign2/package.json
new file mode 100644
index 000000000..0fe40d0b6
--- /dev/null
+++ b/node_modules/request/node_modules/aws-sign2/package.json
@@ -0,0 +1,49 @@
+{
+ "author": {
+ "name": "Mikeal Rogers",
+ "email": "mikeal.rogers@gmail.com",
+ "url": "http://www.futurealoof.com"
+ },
+ "name": "aws-sign2",
+ "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.",
+ "version": "0.6.0",
+ "repository": {
+ "url": "git+https://github.com/mikeal/aws-sign.git"
+ },
+ "license": "Apache-2.0",
+ "main": "index.js",
+ "dependencies": {},
+ "devDependencies": {},
+ "optionalDependencies": {},
+ "engines": {
+ "node": "*"
+ },
+ "gitHead": "8554bdb41268fa295eb1ee300f4adaa9f7f07fec",
+ "bugs": {
+ "url": "https://github.com/mikeal/aws-sign/issues"
+ },
+ "homepage": "https://github.com/mikeal/aws-sign#readme",
+ "_id": "aws-sign2@0.6.0",
+ "scripts": {},
+ "_shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f",
+ "_from": "aws-sign2@>=0.6.0 <0.7.0",
+ "_npmVersion": "2.14.4",
+ "_nodeVersion": "4.1.2",
+ "_npmUser": {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f",
+ "tarball": "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/bl/.npmignore b/node_modules/request/node_modules/bl/.npmignore
new file mode 100644
index 000000000..40b878db5
--- /dev/null
+++ b/node_modules/request/node_modules/bl/.npmignore
@@ -0,0 +1 @@
+node_modules/ \ No newline at end of file
diff --git a/node_modules/request/node_modules/bl/.travis.yml b/node_modules/request/node_modules/bl/.travis.yml
new file mode 100644
index 000000000..81c081418
--- /dev/null
+++ b/node_modules/request/node_modules/bl/.travis.yml
@@ -0,0 +1,14 @@
+language: node_js
+before_install:
+ - curl --location http://git.io/1OcIZA | bash -s
+node_js:
+ - 0.8
+ - 0.10
+ - 0.11
+branches:
+ only:
+ - master
+notifications:
+ email:
+ - rod@vagg.org
+script: npm test
diff --git a/node_modules/request/node_modules/bl/LICENSE.md b/node_modules/request/node_modules/bl/LICENSE.md
new file mode 100644
index 000000000..ccb24797c
--- /dev/null
+++ b/node_modules/request/node_modules/bl/LICENSE.md
@@ -0,0 +1,13 @@
+The MIT License (MIT)
+=====================
+
+Copyright (c) 2014 bl contributors
+----------------------------------
+
+*bl contributors listed at <https://github.com/rvagg/bl#contributors>*
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/request/node_modules/bl/README.md b/node_modules/request/node_modules/bl/README.md
new file mode 100644
index 000000000..4d87866aa
--- /dev/null
+++ b/node_modules/request/node_modules/bl/README.md
@@ -0,0 +1,200 @@
+# bl *(BufferList)*
+
+[![Build Status](https://travis-ci.org/rvagg/bl.svg?branch=master)](https://travis-ci.org/rvagg/bl)
+
+**A Node.js Buffer list collector, reader and streamer thingy.**
+
+[![NPM](https://nodei.co/npm/bl.png?downloads=true&downloadRank=true)](https://nodei.co/npm/bl/)
+[![NPM](https://nodei.co/npm-dl/bl.png?months=6&height=3)](https://nodei.co/npm/bl/)
+
+**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them!
+
+The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently.
+
+```js
+const BufferList = require('bl')
+
+var bl = new BufferList()
+bl.append(new Buffer('abcd'))
+bl.append(new Buffer('efg'))
+bl.append('hi') // bl will also accept & convert Strings
+bl.append(new Buffer('j'))
+bl.append(new Buffer([ 0x3, 0x4 ]))
+
+console.log(bl.length) // 12
+
+console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij'
+console.log(bl.slice(3, 10).toString('ascii')) // 'defghij'
+console.log(bl.slice(3, 6).toString('ascii')) // 'def'
+console.log(bl.slice(3, 8).toString('ascii')) // 'defgh'
+console.log(bl.slice(5, 10).toString('ascii')) // 'fghij'
+
+// or just use toString!
+console.log(bl.toString()) // 'abcdefghij\u0003\u0004'
+console.log(bl.toString('ascii', 3, 8)) // 'defgh'
+console.log(bl.toString('ascii', 5, 10)) // 'fghij'
+
+// other standard Buffer readables
+console.log(bl.readUInt16BE(10)) // 0x0304
+console.log(bl.readUInt16LE(10)) // 0x0403
+```
+
+Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**:
+
+```js
+const bl = require('bl')
+ , fs = require('fs')
+
+fs.createReadStream('README.md')
+ .pipe(bl(function (err, data) { // note 'new' isn't strictly required
+ // `data` is a complete Buffer object containing the full data
+ console.log(data.toString())
+ }))
+```
+
+Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream.
+
+Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!):
+```js
+const hyperquest = require('hyperquest')
+ , bl = require('bl')
+ , url = 'https://raw.github.com/rvagg/bl/master/README.md'
+
+hyperquest(url).pipe(bl(function (err, data) {
+ console.log(data.toString())
+}))
+```
+
+Or, use it as a readable stream to recompose a list of Buffers to an output source:
+
+```js
+const BufferList = require('bl')
+ , fs = require('fs')
+
+var bl = new BufferList()
+bl.append(new Buffer('abcd'))
+bl.append(new Buffer('efg'))
+bl.append(new Buffer('hi'))
+bl.append(new Buffer('j'))
+
+bl.pipe(fs.createWriteStream('gibberish.txt'))
+```
+
+## API
+
+ * <a href="#ctor"><code><b>new BufferList([ callback ])</b></code></a>
+ * <a href="#length"><code>bl.<b>length</b></code></a>
+ * <a href="#append"><code>bl.<b>append(buffer)</b></code></a>
+ * <a href="#get"><code>bl.<b>get(index)</b></code></a>
+ * <a href="#slice"><code>bl.<b>slice([ start[, end ] ])</b></code></a>
+ * <a href="#copy"><code>bl.<b>copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])</b></code></a>
+ * <a href="#duplicate"><code>bl.<b>duplicate()</b></code></a>
+ * <a href="#consume"><code>bl.<b>consume(bytes)</b></code></a>
+ * <a href="#toString"><code>bl.<b>toString([encoding, [ start, [ end ]]])</b></code></a>
+ * <a href="#readXX"><code>bl.<b>readDoubleBE()</b></code>, <code>bl.<b>readDoubleLE()</b></code>, <code>bl.<b>readFloatBE()</b></code>, <code>bl.<b>readFloatLE()</b></code>, <code>bl.<b>readInt32BE()</b></code>, <code>bl.<b>readInt32LE()</b></code>, <code>bl.<b>readUInt32BE()</b></code>, <code>bl.<b>readUInt32LE()</b></code>, <code>bl.<b>readInt16BE()</b></code>, <code>bl.<b>readInt16LE()</b></code>, <code>bl.<b>readUInt16BE()</b></code>, <code>bl.<b>readUInt16LE()</b></code>, <code>bl.<b>readInt8()</b></code>, <code>bl.<b>readUInt8()</b></code></a>
+ * <a href="#streams">Streams</a>
+
+--------------------------------------------------------
+<a name="ctor"></a>
+### new BufferList([ callback | buffer | buffer array ])
+The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream.
+
+Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object.
+
+`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:
+
+```js
+var bl = require('bl')
+var myinstance = bl()
+
+// equivilant to:
+
+var BufferList = require('bl')
+var myinstance = new BufferList()
+```
+
+--------------------------------------------------------
+<a name="length"></a>
+### bl.length
+Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list.
+
+--------------------------------------------------------
+<a name="append"></a>
+### bl.append(buffer)
+`append(buffer)` adds an additional buffer or BufferList to the internal list.
+
+--------------------------------------------------------
+<a name="get"></a>
+### bl.get(index)
+`get()` will return the byte at the specified index.
+
+--------------------------------------------------------
+<a name="slice"></a>
+### bl.slice([ start, [ end ] ])
+`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
+
+If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer.
+
+--------------------------------------------------------
+<a name="copy"></a>
+### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])
+`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively.
+
+--------------------------------------------------------
+<a name="duplicate"></a>
+### bl.duplicate()
+`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example:
+
+```js
+var bl = new BufferList()
+
+bl.append('hello')
+bl.append(' world')
+bl.append('\n')
+
+bl.duplicate().pipe(process.stdout, { end: false })
+
+console.log(bl.toString())
+```
+
+--------------------------------------------------------
+<a name="consume"></a>
+### bl.consume(bytes)
+`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers&mdash;initial offsets will be calculated accordingly in order to give you a consistent view of the data.
+
+--------------------------------------------------------
+<a name="toString"></a>
+### bl.toString([encoding, [ start, [ end ]]])
+`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information.
+
+--------------------------------------------------------
+<a name="readXX"></a>
+### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8()
+
+All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently.
+
+See the <b><code>[Buffer](http://nodejs.org/docs/latest/api/buffer.html)</code></b> documentation for how these work.
+
+--------------------------------------------------------
+<a name="streams"></a>
+### Streams
+**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance.
+
+--------------------------------------------------------
+
+## Contributors
+
+**bl** is brought to you by the following hackers:
+
+ * [Rod Vagg](https://github.com/rvagg)
+ * [Matteo Collina](https://github.com/mcollina)
+ * [Jarett Cruger](https://github.com/jcrugzz)
+
+=======
+
+<a name="license"></a>
+## License &amp; copyright
+
+Copyright (c) 2013-2014 bl contributors (listed above).
+
+bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.
diff --git a/node_modules/request/node_modules/bl/bl.js b/node_modules/request/node_modules/bl/bl.js
new file mode 100644
index 000000000..7a2f99788
--- /dev/null
+++ b/node_modules/request/node_modules/bl/bl.js
@@ -0,0 +1,216 @@
+var DuplexStream = require('readable-stream/duplex')
+ , util = require('util')
+
+function BufferList (callback) {
+ if (!(this instanceof BufferList))
+ return new BufferList(callback)
+
+ this._bufs = []
+ this.length = 0
+
+ if (typeof callback == 'function') {
+ this._callback = callback
+
+ var piper = function (err) {
+ if (this._callback) {
+ this._callback(err)
+ this._callback = null
+ }
+ }.bind(this)
+
+ this.on('pipe', function (src) {
+ src.on('error', piper)
+ })
+ this.on('unpipe', function (src) {
+ src.removeListener('error', piper)
+ })
+ }
+ else if (Buffer.isBuffer(callback))
+ this.append(callback)
+ else if (Array.isArray(callback)) {
+ callback.forEach(function (b) {
+ Buffer.isBuffer(b) && this.append(b)
+ }.bind(this))
+ }
+
+ DuplexStream.call(this)
+}
+
+util.inherits(BufferList, DuplexStream)
+
+BufferList.prototype._offset = function (offset) {
+ var tot = 0, i = 0, _t
+ for (; i < this._bufs.length; i++) {
+ _t = tot + this._bufs[i].length
+ if (offset < _t)
+ return [ i, offset - tot ]
+ tot = _t
+ }
+}
+
+BufferList.prototype.append = function (buf) {
+ var isBuffer = Buffer.isBuffer(buf) ||
+ buf instanceof BufferList
+
+ this._bufs.push(isBuffer ? buf : new Buffer(buf))
+ this.length += buf.length
+ return this
+}
+
+BufferList.prototype._write = function (buf, encoding, callback) {
+ this.append(buf)
+ if (callback)
+ callback()
+}
+
+BufferList.prototype._read = function (size) {
+ if (!this.length)
+ return this.push(null)
+ size = Math.min(size, this.length)
+ this.push(this.slice(0, size))
+ this.consume(size)
+}
+
+BufferList.prototype.end = function (chunk) {
+ DuplexStream.prototype.end.call(this, chunk)
+
+ if (this._callback) {
+ this._callback(null, this.slice())
+ this._callback = null
+ }
+}
+
+BufferList.prototype.get = function (index) {
+ return this.slice(index, index + 1)[0]
+}
+
+BufferList.prototype.slice = function (start, end) {
+ return this.copy(null, 0, start, end)
+}
+
+BufferList.prototype.copy = function (dst, dstStart, srcStart, srcEnd) {
+ if (typeof srcStart != 'number' || srcStart < 0)
+ srcStart = 0
+ if (typeof srcEnd != 'number' || srcEnd > this.length)
+ srcEnd = this.length
+ if (srcStart >= this.length)
+ return dst || new Buffer(0)
+ if (srcEnd <= 0)
+ return dst || new Buffer(0)
+
+ var copy = !!dst
+ , off = this._offset(srcStart)
+ , len = srcEnd - srcStart
+ , bytes = len
+ , bufoff = (copy && dstStart) || 0
+ , start = off[1]
+ , l
+ , i
+
+ // copy/slice everything
+ if (srcStart === 0 && srcEnd == this.length) {
+ if (!copy) // slice, just return a full concat
+ return Buffer.concat(this._bufs)
+
+ // copy, need to copy individual buffers
+ for (i = 0; i < this._bufs.length; i++) {
+ this._bufs[i].copy(dst, bufoff)
+ bufoff += this._bufs[i].length
+ }
+
+ return dst
+ }
+
+ // easy, cheap case where it's a subset of one of the buffers
+ if (bytes <= this._bufs[off[0]].length - start) {
+ return copy
+ ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes)
+ : this._bufs[off[0]].slice(start, start + bytes)
+ }
+
+ if (!copy) // a slice, we need something to copy in to
+ dst = new Buffer(len)
+
+ for (i = off[0]; i < this._bufs.length; i++) {
+ l = this._bufs[i].length - start
+
+ if (bytes > l) {
+ this._bufs[i].copy(dst, bufoff, start)
+ } else {
+ this._bufs[i].copy(dst, bufoff, start, start + bytes)
+ break
+ }
+
+ bufoff += l
+ bytes -= l
+
+ if (start)
+ start = 0
+ }
+
+ return dst
+}
+
+BufferList.prototype.toString = function (encoding, start, end) {
+ return this.slice(start, end).toString(encoding)
+}
+
+BufferList.prototype.consume = function (bytes) {
+ while (this._bufs.length) {
+ if (bytes > this._bufs[0].length) {
+ bytes -= this._bufs[0].length
+ this.length -= this._bufs[0].length
+ this._bufs.shift()
+ } else {
+ this._bufs[0] = this._bufs[0].slice(bytes)
+ this.length -= bytes
+ break
+ }
+ }
+ return this
+}
+
+BufferList.prototype.duplicate = function () {
+ var i = 0
+ , copy = new BufferList()
+
+ for (; i < this._bufs.length; i++)
+ copy.append(this._bufs[i])
+
+ return copy
+}
+
+BufferList.prototype.destroy = function () {
+ this._bufs.length = 0;
+ this.length = 0;
+ this.push(null);
+}
+
+;(function () {
+ var methods = {
+ 'readDoubleBE' : 8
+ , 'readDoubleLE' : 8
+ , 'readFloatBE' : 4
+ , 'readFloatLE' : 4
+ , 'readInt32BE' : 4
+ , 'readInt32LE' : 4
+ , 'readUInt32BE' : 4
+ , 'readUInt32LE' : 4
+ , 'readInt16BE' : 2
+ , 'readInt16LE' : 2
+ , 'readUInt16BE' : 2
+ , 'readUInt16LE' : 2
+ , 'readInt8' : 1
+ , 'readUInt8' : 1
+ }
+
+ for (var m in methods) {
+ (function (m) {
+ BufferList.prototype[m] = function (offset) {
+ return this.slice(offset, offset + methods[m])[m](0)
+ }
+ }(m))
+ }
+}())
+
+module.exports = BufferList
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore b/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore
new file mode 100644
index 000000000..38344f87a
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore
@@ -0,0 +1,5 @@
+build/
+test/
+examples/
+fs.js
+zlib.js \ No newline at end of file
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml b/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml
new file mode 100644
index 000000000..a2870dfb1
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml
@@ -0,0 +1,39 @@
+sudo: false
+language: node_js
+before_install:
+ - npm install -g npm
+notifications:
+ email: false
+matrix:
+ include:
+ - node_js: '0.8'
+ env: TASK=test
+ - node_js: '0.10'
+ env: TASK=test
+ - node_js: '0.11'
+ env: TASK=test
+ - node_js: '0.12'
+ env: TASK=test
+ - node_js: 'iojs'
+ env: TASK=test
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest"
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest"
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="39..beta"
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="34..beta"
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest"
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest"
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest"
+ - node_js: 'iojs'
+ env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest"
+script: "npm run $TASK"
+env:
+ global:
+ - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc=
+ - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI=
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml b/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml
new file mode 100644
index 000000000..96d9cfbd3
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml
@@ -0,0 +1 @@
+ui: tape
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE b/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE
new file mode 100644
index 000000000..e3d4e695a
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE
@@ -0,0 +1,18 @@
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md b/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md
new file mode 100644
index 000000000..f9fb52059
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md
@@ -0,0 +1,36 @@
+# readable-stream
+
+***Node-core streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)
+
+
+[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)
+[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)
+
+
+[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)
+
+```bash
+npm install --save readable-stream
+```
+
+***Node-core streams for userland***
+
+This package is a mirror of the Streams2 and Streams3 implementations in
+Node-core, including [documentation](doc/stream.markdown).
+
+If you want to guarantee a stable streams base, regardless of what version of
+Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).
+
+As of version 2.0.0 **readable-stream** uses semantic versioning.
+
+# Streams WG Team Members
+
+* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) &lt;christopher.s.dickinson@gmail.com&gt;
+ - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B
+* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) &lt;calvin.metcalf@gmail.com&gt;
+ - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242
+* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) &lt;rod@vagg.org&gt;
+ - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D
+* **Sam Newman** ([@sonewman](https://github.com/sonewman)) &lt;newmansam@outlook.com&gt;
+* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) &lt;mathiasbuus@gmail.com&gt;
+* **Domenic Denicola** ([@domenic](https://github.com/domenic)) &lt;d@domenic.me&gt;
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown b/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown
new file mode 100644
index 000000000..e34dac429
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown
@@ -0,0 +1,1651 @@
+# Stream
+
+ Stability: 2 - Stable
+
+A stream is an abstract interface implemented by various objects in
+io.js. For example a [request to an HTTP
+server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) is a stream, as is
+[stdout][]. Streams are readable, writable, or both. All streams are
+instances of [EventEmitter][]
+
+You can load the Stream base classes by doing `require('stream')`.
+There are base classes provided for [Readable][] streams, [Writable][]
+streams, [Duplex][] streams, and [Transform][] streams.
+
+This document is split up into 3 sections. The first explains the
+parts of the API that you need to be aware of to use streams in your
+programs. If you never implement a streaming API yourself, you can
+stop there.
+
+The second section explains the parts of the API that you need to use
+if you implement your own custom streams yourself. The API is
+designed to make this easy for you to do.
+
+The third section goes into more depth about how streams work,
+including some of the internal mechanisms and functions that you
+should probably not modify unless you definitely know what you are
+doing.
+
+
+## API for Stream Consumers
+
+<!--type=misc-->
+
+Streams can be either [Readable][], [Writable][], or both ([Duplex][]).
+
+All streams are EventEmitters, but they also have other custom methods
+and properties depending on whether they are Readable, Writable, or
+Duplex.
+
+If a stream is both Readable and Writable, then it implements all of
+the methods and events below. So, a [Duplex][] or [Transform][] stream is
+fully described by this API, though their implementation may be
+somewhat different.
+
+It is not necessary to implement Stream interfaces in order to consume
+streams in your programs. If you **are** implementing streaming
+interfaces in your own program, please also refer to
+[API for Stream Implementors][] below.
+
+Almost all io.js programs, no matter how simple, use Streams in some
+way. Here is an example of using Streams in an io.js program:
+
+```javascript
+var http = require('http');
+
+var server = http.createServer(function (req, res) {
+ // req is an http.IncomingMessage, which is a Readable Stream
+ // res is an http.ServerResponse, which is a Writable Stream
+
+ var body = '';
+ // we want to get the data as utf8 strings
+ // If you don't set an encoding, then you'll get Buffer objects
+ req.setEncoding('utf8');
+
+ // Readable streams emit 'data' events once a listener is added
+ req.on('data', function (chunk) {
+ body += chunk;
+ });
+
+ // the end event tells you that you have entire body
+ req.on('end', function () {
+ try {
+ var data = JSON.parse(body);
+ } catch (er) {
+ // uh oh! bad json!
+ res.statusCode = 400;
+ return res.end('error: ' + er.message);
+ }
+
+ // write back something interesting to the user:
+ res.write(typeof data);
+ res.end();
+ });
+});
+
+server.listen(1337);
+
+// $ curl localhost:1337 -d '{}'
+// object
+// $ curl localhost:1337 -d '"foo"'
+// string
+// $ curl localhost:1337 -d 'not json'
+// error: Unexpected token o
+```
+
+### Class: stream.Readable
+
+<!--type=class-->
+
+The Readable stream interface is the abstraction for a *source* of
+data that you are reading from. In other words, data comes *out* of a
+Readable stream.
+
+A Readable stream will not start emitting data until you indicate that
+you are ready to receive it.
+
+Readable streams have two "modes": a **flowing mode** and a **paused
+mode**. When in flowing mode, data is read from the underlying system
+and provided to your program as fast as possible. In paused mode, you
+must explicitly call `stream.read()` to get chunks of data out.
+Streams start out in paused mode.
+
+**Note**: If no data event handlers are attached, and there are no
+[`pipe()`][] destinations, and the stream is switched into flowing
+mode, then data will be lost.
+
+You can switch to flowing mode by doing any of the following:
+
+* Adding a [`'data'` event][] handler to listen for data.
+* Calling the [`resume()`][] method to explicitly open the flow.
+* Calling the [`pipe()`][] method to send the data to a [Writable][].
+
+You can switch back to paused mode by doing either of the following:
+
+* If there are no pipe destinations, by calling the [`pause()`][]
+ method.
+* If there are pipe destinations, by removing any [`'data'` event][]
+ handlers, and removing all pipe destinations by calling the
+ [`unpipe()`][] method.
+
+Note that, for backwards compatibility reasons, removing `'data'`
+event handlers will **not** automatically pause the stream. Also, if
+there are piped destinations, then calling `pause()` will not
+guarantee that the stream will *remain* paused once those
+destinations drain and ask for more data.
+
+Examples of readable streams include:
+
+* [http responses, on the client](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage)
+* [http requests, on the server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage)
+* [fs read streams](https://iojs.org/dist/v2.3.0/doc/api/fs.html#fs_class_fs_readstream)
+* [zlib streams][]
+* [crypto streams][]
+* [tcp sockets][]
+* [child process stdout and stderr][]
+* [process.stdin][]
+
+#### Event: 'readable'
+
+When a chunk of data can be read from the stream, it will emit a
+`'readable'` event.
+
+In some cases, listening for a `'readable'` event will cause some data
+to be read into the internal buffer from the underlying system, if it
+hadn't already.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.on('readable', function() {
+ // there is some data to read now
+});
+```
+
+Once the internal buffer is drained, a `readable` event will fire
+again when more data is available.
+
+#### Event: 'data'
+
+* `chunk` {Buffer | String} The chunk of data.
+
+Attaching a `data` event listener to a stream that has not been
+explicitly paused will switch the stream into flowing mode. Data will
+then be passed as soon as it is available.
+
+If you just want to get all the data out of the stream as fast as
+possible, this is the best way to do so.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.on('data', function(chunk) {
+ console.log('got %d bytes of data', chunk.length);
+});
+```
+
+#### Event: 'end'
+
+This event fires when there will be no more data to read.
+
+Note that the `end` event **will not fire** unless the data is
+completely consumed. This can be done by switching into flowing mode,
+or by calling `read()` repeatedly until you get to the end.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.on('data', function(chunk) {
+ console.log('got %d bytes of data', chunk.length);
+});
+readable.on('end', function() {
+ console.log('there will be no more data.');
+});
+```
+
+#### Event: 'close'
+
+Emitted when the underlying resource (for example, the backing file
+descriptor) has been closed. Not all streams will emit this.
+
+#### Event: 'error'
+
+* {Error Object}
+
+Emitted if there was an error receiving data.
+
+#### readable.read([size])
+
+* `size` {Number} Optional argument to specify how much data to read.
+* Return {String | Buffer | null}
+
+The `read()` method pulls some data out of the internal buffer and
+returns it. If there is no data available, then it will return
+`null`.
+
+If you pass in a `size` argument, then it will return that many
+bytes. If `size` bytes are not available, then it will return `null`.
+
+If you do not specify a `size` argument, then it will return all the
+data in the internal buffer.
+
+This method should only be called in paused mode. In flowing mode,
+this method is called automatically until the internal buffer is
+drained.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.on('readable', function() {
+ var chunk;
+ while (null !== (chunk = readable.read())) {
+ console.log('got %d bytes of data', chunk.length);
+ }
+});
+```
+
+If this method returns a data chunk, then it will also trigger the
+emission of a [`'data'` event][].
+
+#### readable.setEncoding(encoding)
+
+* `encoding` {String} The encoding to use.
+* Return: `this`
+
+Call this function to cause the stream to return strings of the
+specified encoding instead of Buffer objects. For example, if you do
+`readable.setEncoding('utf8')`, then the output data will be
+interpreted as UTF-8 data, and returned as strings. If you do
+`readable.setEncoding('hex')`, then the data will be encoded in
+hexadecimal string format.
+
+This properly handles multi-byte characters that would otherwise be
+potentially mangled if you simply pulled the Buffers directly and
+called `buf.toString(encoding)` on them. If you want to read the data
+as strings, always use this method.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.setEncoding('utf8');
+readable.on('data', function(chunk) {
+ assert.equal(typeof chunk, 'string');
+ console.log('got %d characters of string data', chunk.length);
+});
+```
+
+#### readable.resume()
+
+* Return: `this`
+
+This method will cause the readable stream to resume emitting `data`
+events.
+
+This method will switch the stream into flowing mode. If you do *not*
+want to consume the data from a stream, but you *do* want to get to
+its `end` event, you can call [`readable.resume()`][] to open the flow of
+data.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.resume();
+readable.on('end', function() {
+ console.log('got to the end, but did not read anything');
+});
+```
+
+#### readable.pause()
+
+* Return: `this`
+
+This method will cause a stream in flowing mode to stop emitting
+`data` events, switching out of flowing mode. Any data that becomes
+available will remain in the internal buffer.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.on('data', function(chunk) {
+ console.log('got %d bytes of data', chunk.length);
+ readable.pause();
+ console.log('there will be no more data for 1 second');
+ setTimeout(function() {
+ console.log('now data will start flowing again');
+ readable.resume();
+ }, 1000);
+});
+```
+
+#### readable.isPaused()
+
+* Return: `Boolean`
+
+This method returns whether or not the `readable` has been **explicitly**
+paused by client code (using `readable.pause()` without a corresponding
+`readable.resume()`).
+
+```javascript
+var readable = new stream.Readable
+
+readable.isPaused() // === false
+readable.pause()
+readable.isPaused() // === true
+readable.resume()
+readable.isPaused() // === false
+```
+
+#### readable.pipe(destination[, options])
+
+* `destination` {[Writable][] Stream} The destination for writing data
+* `options` {Object} Pipe options
+ * `end` {Boolean} End the writer when the reader ends. Default = `true`
+
+This method pulls all the data out of a readable stream, and writes it
+to the supplied destination, automatically managing the flow so that
+the destination is not overwhelmed by a fast readable stream.
+
+Multiple destinations can be piped to safely.
+
+```javascript
+var readable = getReadableStreamSomehow();
+var writable = fs.createWriteStream('file.txt');
+// All the data from readable goes into 'file.txt'
+readable.pipe(writable);
+```
+
+This function returns the destination stream, so you can set up pipe
+chains like so:
+
+```javascript
+var r = fs.createReadStream('file.txt');
+var z = zlib.createGzip();
+var w = fs.createWriteStream('file.txt.gz');
+r.pipe(z).pipe(w);
+```
+
+For example, emulating the Unix `cat` command:
+
+```javascript
+process.stdin.pipe(process.stdout);
+```
+
+By default [`end()`][] is called on the destination when the source stream
+emits `end`, so that `destination` is no longer writable. Pass `{ end:
+false }` as `options` to keep the destination stream open.
+
+This keeps `writer` open so that "Goodbye" can be written at the
+end.
+
+```javascript
+reader.pipe(writer, { end: false });
+reader.on('end', function() {
+ writer.end('Goodbye\n');
+});
+```
+
+Note that `process.stderr` and `process.stdout` are never closed until
+the process exits, regardless of the specified options.
+
+#### readable.unpipe([destination])
+
+* `destination` {[Writable][] Stream} Optional specific stream to unpipe
+
+This method will remove the hooks set up for a previous `pipe()` call.
+
+If the destination is not specified, then all pipes are removed.
+
+If the destination is specified, but no pipe is set up for it, then
+this is a no-op.
+
+```javascript
+var readable = getReadableStreamSomehow();
+var writable = fs.createWriteStream('file.txt');
+// All the data from readable goes into 'file.txt',
+// but only for the first second
+readable.pipe(writable);
+setTimeout(function() {
+ console.log('stop writing to file.txt');
+ readable.unpipe(writable);
+ console.log('manually close the file stream');
+ writable.end();
+}, 1000);
+```
+
+#### readable.unshift(chunk)
+
+* `chunk` {Buffer | String} Chunk of data to unshift onto the read queue
+
+This is useful in certain cases where a stream is being consumed by a
+parser, which needs to "un-consume" some data that it has
+optimistically pulled out of the source, so that the stream can be
+passed on to some other party.
+
+If you find that you must often call `stream.unshift(chunk)` in your
+programs, consider implementing a [Transform][] stream instead. (See API
+for Stream Implementors, below.)
+
+```javascript
+// Pull off a header delimited by \n\n
+// use unshift() if we get too much
+// Call the callback with (error, header, stream)
+var StringDecoder = require('string_decoder').StringDecoder;
+function parseHeader(stream, callback) {
+ stream.on('error', callback);
+ stream.on('readable', onReadable);
+ var decoder = new StringDecoder('utf8');
+ var header = '';
+ function onReadable() {
+ var chunk;
+ while (null !== (chunk = stream.read())) {
+ var str = decoder.write(chunk);
+ if (str.match(/\n\n/)) {
+ // found the header boundary
+ var split = str.split(/\n\n/);
+ header += split.shift();
+ var remaining = split.join('\n\n');
+ var buf = new Buffer(remaining, 'utf8');
+ if (buf.length)
+ stream.unshift(buf);
+ stream.removeListener('error', callback);
+ stream.removeListener('readable', onReadable);
+ // now the body of the message can be read from the stream.
+ callback(null, header, stream);
+ } else {
+ // still reading the header.
+ header += str;
+ }
+ }
+ }
+}
+```
+
+#### readable.wrap(stream)
+
+* `stream` {Stream} An "old style" readable stream
+
+Versions of Node.js prior to v0.10 had streams that did not implement the
+entire Streams API as it is today. (See "Compatibility" below for
+more information.)
+
+If you are using an older io.js library that emits `'data'` events and
+has a [`pause()`][] method that is advisory only, then you can use the
+`wrap()` method to create a [Readable][] stream that uses the old stream
+as its data source.
+
+You will very rarely ever need to call this function, but it exists
+as a convenience for interacting with old io.js programs and libraries.
+
+For example:
+
+```javascript
+var OldReader = require('./old-api-module.js').OldReader;
+var oreader = new OldReader;
+var Readable = require('stream').Readable;
+var myReader = new Readable().wrap(oreader);
+
+myReader.on('readable', function() {
+ myReader.read(); // etc.
+});
+```
+
+
+### Class: stream.Writable
+
+<!--type=class-->
+
+The Writable stream interface is an abstraction for a *destination*
+that you are writing data *to*.
+
+Examples of writable streams include:
+
+* [http requests, on the client](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_class_http_clientrequest)
+* [http responses, on the server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_class_http_serverresponse)
+* [fs write streams](https://iojs.org/dist/v2.3.0/doc/api/fs.html#fs_class_fs_writestream)
+* [zlib streams][]
+* [crypto streams][]
+* [tcp sockets][]
+* [child process stdin](https://iojs.org/dist/v2.3.0/doc/api/child_process.html#child_process_child_stdin)
+* [process.stdout][], [process.stderr][]
+
+#### writable.write(chunk[, encoding][, callback])
+
+* `chunk` {String | Buffer} The data to write
+* `encoding` {String} The encoding, if `chunk` is a String
+* `callback` {Function} Callback for when this chunk of data is flushed
+* Returns: {Boolean} True if the data was handled completely.
+
+This method writes some data to the underlying system, and calls the
+supplied callback once the data has been fully handled.
+
+The return value indicates if you should continue writing right now.
+If the data had to be buffered internally, then it will return
+`false`. Otherwise, it will return `true`.
+
+This return value is strictly advisory. You MAY continue to write,
+even if it returns `false`. However, writes will be buffered in
+memory, so it is best not to do this excessively. Instead, wait for
+the `drain` event before writing more data.
+
+#### Event: 'drain'
+
+If a [`writable.write(chunk)`][] call returns false, then the `drain`
+event will indicate when it is appropriate to begin writing more data
+to the stream.
+
+```javascript
+// Write the data to the supplied writable stream 1MM times.
+// Be attentive to back-pressure.
+function writeOneMillionTimes(writer, data, encoding, callback) {
+ var i = 1000000;
+ write();
+ function write() {
+ var ok = true;
+ do {
+ i -= 1;
+ if (i === 0) {
+ // last time!
+ writer.write(data, encoding, callback);
+ } else {
+ // see if we should continue, or wait
+ // don't pass the callback, because we're not done yet.
+ ok = writer.write(data, encoding);
+ }
+ } while (i > 0 && ok);
+ if (i > 0) {
+ // had to stop early!
+ // write some more once it drains
+ writer.once('drain', write);
+ }
+ }
+}
+```
+
+#### writable.cork()
+
+Forces buffering of all writes.
+
+Buffered data will be flushed either at `.uncork()` or at `.end()` call.
+
+#### writable.uncork()
+
+Flush all data, buffered since `.cork()` call.
+
+#### writable.setDefaultEncoding(encoding)
+
+* `encoding` {String} The new default encoding
+
+Sets the default encoding for a writable stream.
+
+#### writable.end([chunk][, encoding][, callback])
+
+* `chunk` {String | Buffer} Optional data to write
+* `encoding` {String} The encoding, if `chunk` is a String
+* `callback` {Function} Optional callback for when the stream is finished
+
+Call this method when no more data will be written to the stream. If
+supplied, the callback is attached as a listener on the `finish` event.
+
+Calling [`write()`][] after calling [`end()`][] will raise an error.
+
+```javascript
+// write 'hello, ' and then end with 'world!'
+var file = fs.createWriteStream('example.txt');
+file.write('hello, ');
+file.end('world!');
+// writing more now is not allowed!
+```
+
+#### Event: 'finish'
+
+When the [`end()`][] method has been called, and all data has been flushed
+to the underlying system, this event is emitted.
+
+```javascript
+var writer = getWritableStreamSomehow();
+for (var i = 0; i < 100; i ++) {
+ writer.write('hello, #' + i + '!\n');
+}
+writer.end('this is the end\n');
+writer.on('finish', function() {
+ console.error('all writes are now complete.');
+});
+```
+
+#### Event: 'pipe'
+
+* `src` {[Readable][] Stream} source stream that is piping to this writable
+
+This is emitted whenever the `pipe()` method is called on a readable
+stream, adding this writable to its set of destinations.
+
+```javascript
+var writer = getWritableStreamSomehow();
+var reader = getReadableStreamSomehow();
+writer.on('pipe', function(src) {
+ console.error('something is piping into the writer');
+ assert.equal(src, reader);
+});
+reader.pipe(writer);
+```
+
+#### Event: 'unpipe'
+
+* `src` {[Readable][] Stream} The source stream that [unpiped][] this writable
+
+This is emitted whenever the [`unpipe()`][] method is called on a
+readable stream, removing this writable from its set of destinations.
+
+```javascript
+var writer = getWritableStreamSomehow();
+var reader = getReadableStreamSomehow();
+writer.on('unpipe', function(src) {
+ console.error('something has stopped piping into the writer');
+ assert.equal(src, reader);
+});
+reader.pipe(writer);
+reader.unpipe(writer);
+```
+
+#### Event: 'error'
+
+* {Error object}
+
+Emitted if there was an error when writing or piping data.
+
+### Class: stream.Duplex
+
+Duplex streams are streams that implement both the [Readable][] and
+[Writable][] interfaces. See above for usage.
+
+Examples of Duplex streams include:
+
+* [tcp sockets][]
+* [zlib streams][]
+* [crypto streams][]
+
+
+### Class: stream.Transform
+
+Transform streams are [Duplex][] streams where the output is in some way
+computed from the input. They implement both the [Readable][] and
+[Writable][] interfaces. See above for usage.
+
+Examples of Transform streams include:
+
+* [zlib streams][]
+* [crypto streams][]
+
+
+## API for Stream Implementors
+
+<!--type=misc-->
+
+To implement any sort of stream, the pattern is the same:
+
+1. Extend the appropriate parent class in your own subclass. (The
+ [`util.inherits`][] method is particularly helpful for this.)
+2. Call the appropriate parent class constructor in your constructor,
+ to be sure that the internal mechanisms are set up properly.
+2. Implement one or more specific methods, as detailed below.
+
+The class to extend and the method(s) to implement depend on the sort
+of stream class you are writing:
+
+<table>
+ <thead>
+ <tr>
+ <th>
+ <p>Use-case</p>
+ </th>
+ <th>
+ <p>Class</p>
+ </th>
+ <th>
+ <p>Method(s) to implement</p>
+ </th>
+ </tr>
+ </thead>
+ <tr>
+ <td>
+ <p>Reading only</p>
+ </td>
+ <td>
+ <p>[Readable](#stream_class_stream_readable_1)</p>
+ </td>
+ <td>
+ <p><code>[_read][]</code></p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>Writing only</p>
+ </td>
+ <td>
+ <p>[Writable](#stream_class_stream_writable_1)</p>
+ </td>
+ <td>
+ <p><code>[_write][]</code>, <code>_writev</code></p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>Reading and writing</p>
+ </td>
+ <td>
+ <p>[Duplex](#stream_class_stream_duplex_1)</p>
+ </td>
+ <td>
+ <p><code>[_read][]</code>, <code>[_write][]</code>, <code>_writev</code></p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>Operate on written data, then read the result</p>
+ </td>
+ <td>
+ <p>[Transform](#stream_class_stream_transform_1)</p>
+ </td>
+ <td>
+ <p><code>_transform</code>, <code>_flush</code></p>
+ </td>
+ </tr>
+</table>
+
+In your implementation code, it is very important to never call the
+methods described in [API for Stream Consumers][] above. Otherwise, you
+can potentially cause adverse side effects in programs that consume
+your streaming interfaces.
+
+### Class: stream.Readable
+
+<!--type=class-->
+
+`stream.Readable` is an abstract class designed to be extended with an
+underlying implementation of the [`_read(size)`][] method.
+
+Please see above under [API for Stream Consumers][] for how to consume
+streams in your programs. What follows is an explanation of how to
+implement Readable streams in your programs.
+
+#### Example: A Counting Stream
+
+<!--type=example-->
+
+This is a basic example of a Readable stream. It emits the numerals
+from 1 to 1,000,000 in ascending order, and then ends.
+
+```javascript
+var Readable = require('stream').Readable;
+var util = require('util');
+util.inherits(Counter, Readable);
+
+function Counter(opt) {
+ Readable.call(this, opt);
+ this._max = 1000000;
+ this._index = 1;
+}
+
+Counter.prototype._read = function() {
+ var i = this._index++;
+ if (i > this._max)
+ this.push(null);
+ else {
+ var str = '' + i;
+ var buf = new Buffer(str, 'ascii');
+ this.push(buf);
+ }
+};
+```
+
+#### Example: SimpleProtocol v1 (Sub-optimal)
+
+This is similar to the `parseHeader` function described above, but
+implemented as a custom stream. Also, note that this implementation
+does not convert the incoming data to a string.
+
+However, this would be better implemented as a [Transform][] stream. See
+below for a better implementation.
+
+```javascript
+// A parser for a simple data protocol.
+// The "header" is a JSON object, followed by 2 \n characters, and
+// then a message body.
+//
+// NOTE: This can be done more simply as a Transform stream!
+// Using Readable directly for this is sub-optimal. See the
+// alternative example below under the Transform section.
+
+var Readable = require('stream').Readable;
+var util = require('util');
+
+util.inherits(SimpleProtocol, Readable);
+
+function SimpleProtocol(source, options) {
+ if (!(this instanceof SimpleProtocol))
+ return new SimpleProtocol(source, options);
+
+ Readable.call(this, options);
+ this._inBody = false;
+ this._sawFirstCr = false;
+
+ // source is a readable stream, such as a socket or file
+ this._source = source;
+
+ var self = this;
+ source.on('end', function() {
+ self.push(null);
+ });
+
+ // give it a kick whenever the source is readable
+ // read(0) will not consume any bytes
+ source.on('readable', function() {
+ self.read(0);
+ });
+
+ this._rawHeader = [];
+ this.header = null;
+}
+
+SimpleProtocol.prototype._read = function(n) {
+ if (!this._inBody) {
+ var chunk = this._source.read();
+
+ // if the source doesn't have data, we don't have data yet.
+ if (chunk === null)
+ return this.push('');
+
+ // check if the chunk has a \n\n
+ var split = -1;
+ for (var i = 0; i < chunk.length; i++) {
+ if (chunk[i] === 10) { // '\n'
+ if (this._sawFirstCr) {
+ split = i;
+ break;
+ } else {
+ this._sawFirstCr = true;
+ }
+ } else {
+ this._sawFirstCr = false;
+ }
+ }
+
+ if (split === -1) {
+ // still waiting for the \n\n
+ // stash the chunk, and try again.
+ this._rawHeader.push(chunk);
+ this.push('');
+ } else {
+ this._inBody = true;
+ var h = chunk.slice(0, split);
+ this._rawHeader.push(h);
+ var header = Buffer.concat(this._rawHeader).toString();
+ try {
+ this.header = JSON.parse(header);
+ } catch (er) {
+ this.emit('error', new Error('invalid simple protocol data'));
+ return;
+ }
+ // now, because we got some extra data, unshift the rest
+ // back into the read queue so that our consumer will see it.
+ var b = chunk.slice(split);
+ this.unshift(b);
+
+ // and let them know that we are done parsing the header.
+ this.emit('header', this.header);
+ }
+ } else {
+ // from there on, just provide the data to our consumer.
+ // careful not to push(null), since that would indicate EOF.
+ var chunk = this._source.read();
+ if (chunk) this.push(chunk);
+ }
+};
+
+// Usage:
+// var parser = new SimpleProtocol(source);
+// Now parser is a readable stream that will emit 'header'
+// with the parsed header data.
+```
+
+
+#### new stream.Readable([options])
+
+* `options` {Object}
+ * `highWaterMark` {Number} The maximum number of bytes to store in
+ the internal buffer before ceasing to read from the underlying
+ resource. Default=16kb, or 16 for `objectMode` streams
+ * `encoding` {String} If specified, then buffers will be decoded to
+ strings using the specified encoding. Default=null
+ * `objectMode` {Boolean} Whether this stream should behave
+ as a stream of objects. Meaning that stream.read(n) returns
+ a single value instead of a Buffer of size n. Default=false
+
+In classes that extend the Readable class, make sure to call the
+Readable constructor so that the buffering settings can be properly
+initialized.
+
+#### readable.\_read(size)
+
+* `size` {Number} Number of bytes to read asynchronously
+
+Note: **Implement this function, but do NOT call it directly.**
+
+This function should NOT be called directly. It should be implemented
+by child classes, and only called by the internal Readable class
+methods.
+
+All Readable stream implementations must provide a `_read` method to
+fetch data from the underlying resource.
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs. However, you **are** expected to override this method in
+your own extension classes.
+
+When data is available, put it into the read queue by calling
+`readable.push(chunk)`. If `push` returns false, then you should stop
+reading. When `_read` is called again, you should start pushing more
+data.
+
+The `size` argument is advisory. Implementations where a "read" is a
+single call that returns data can use this to know how much data to
+fetch. Implementations where that is not relevant, such as TCP or
+TLS, may ignore this argument, and simply provide data whenever it
+becomes available. There is no need, for example to "wait" until
+`size` bytes are available before calling [`stream.push(chunk)`][].
+
+#### readable.push(chunk[, encoding])
+
+* `chunk` {Buffer | null | String} Chunk of data to push into the read queue
+* `encoding` {String} Encoding of String chunks. Must be a valid
+ Buffer encoding, such as `'utf8'` or `'ascii'`
+* return {Boolean} Whether or not more pushes should be performed
+
+Note: **This function should be called by Readable implementors, NOT
+by consumers of Readable streams.**
+
+The `_read()` function will not be called again until at least one
+`push(chunk)` call is made.
+
+The `Readable` class works by putting data into a read queue to be
+pulled out later by calling the `read()` method when the `'readable'`
+event fires.
+
+The `push()` method will explicitly insert some data into the read
+queue. If it is called with `null` then it will signal the end of the
+data (EOF).
+
+This API is designed to be as flexible as possible. For example,
+you may be wrapping a lower-level source which has some sort of
+pause/resume mechanism, and a data callback. In those cases, you
+could wrap the low-level source object by doing something like this:
+
+```javascript
+// source is an object with readStop() and readStart() methods,
+// and an `ondata` member that gets called when it has data, and
+// an `onend` member that gets called when the data is over.
+
+util.inherits(SourceWrapper, Readable);
+
+function SourceWrapper(options) {
+ Readable.call(this, options);
+
+ this._source = getLowlevelSourceObject();
+ var self = this;
+
+ // Every time there's data, we push it into the internal buffer.
+ this._source.ondata = function(chunk) {
+ // if push() returns false, then we need to stop reading from source
+ if (!self.push(chunk))
+ self._source.readStop();
+ };
+
+ // When the source ends, we push the EOF-signaling `null` chunk
+ this._source.onend = function() {
+ self.push(null);
+ };
+}
+
+// _read will be called when the stream wants to pull more data in
+// the advisory size argument is ignored in this case.
+SourceWrapper.prototype._read = function(size) {
+ this._source.readStart();
+};
+```
+
+
+### Class: stream.Writable
+
+<!--type=class-->
+
+`stream.Writable` is an abstract class designed to be extended with an
+underlying implementation of the [`_write(chunk, encoding, callback)`][] method.
+
+Please see above under [API for Stream Consumers][] for how to consume
+writable streams in your programs. What follows is an explanation of
+how to implement Writable streams in your programs.
+
+#### new stream.Writable([options])
+
+* `options` {Object}
+ * `highWaterMark` {Number} Buffer level when [`write()`][] starts
+ returning false. Default=16kb, or 16 for `objectMode` streams
+ * `decodeStrings` {Boolean} Whether or not to decode strings into
+ Buffers before passing them to [`_write()`][]. Default=true
+ * `objectMode` {Boolean} Whether or not the `write(anyObj)` is
+ a valid operation. If set you can write arbitrary data instead
+ of only `Buffer` / `String` data. Default=false
+
+In classes that extend the Writable class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+#### writable.\_write(chunk, encoding, callback)
+
+* `chunk` {Buffer | String} The chunk to be written. Will **always**
+ be a buffer unless the `decodeStrings` option was set to `false`.
+* `encoding` {String} If the chunk is a string, then this is the
+ encoding type. If chunk is a buffer, then this is the special
+ value - 'buffer', ignore it in this case.
+* `callback` {Function} Call this function (optionally with an error
+ argument) when you are done processing the supplied chunk.
+
+All Writable stream implementations must provide a [`_write()`][]
+method to send data to the underlying resource.
+
+Note: **This function MUST NOT be called directly.** It should be
+implemented by child classes, and called by the internal Writable
+class methods only.
+
+Call the callback using the standard `callback(error)` pattern to
+signal that the write completed successfully or with an error.
+
+If the `decodeStrings` flag is set in the constructor options, then
+`chunk` may be a string rather than a Buffer, and `encoding` will
+indicate the sort of string that it is. This is to support
+implementations that have an optimized handling for certain string
+data encodings. If you do not explicitly set the `decodeStrings`
+option to `false`, then you can safely ignore the `encoding` argument,
+and assume that `chunk` will always be a Buffer.
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs. However, you **are** expected to override this method in
+your own extension classes.
+
+#### writable.\_writev(chunks, callback)
+
+* `chunks` {Array} The chunks to be written. Each chunk has following
+ format: `{ chunk: ..., encoding: ... }`.
+* `callback` {Function} Call this function (optionally with an error
+ argument) when you are done processing the supplied chunks.
+
+Note: **This function MUST NOT be called directly.** It may be
+implemented by child classes, and called by the internal Writable
+class methods only.
+
+This function is completely optional to implement. In most cases it is
+unnecessary. If implemented, it will be called with all the chunks
+that are buffered in the write queue.
+
+
+### Class: stream.Duplex
+
+<!--type=class-->
+
+A "duplex" stream is one that is both Readable and Writable, such as a
+TCP socket connection.
+
+Note that `stream.Duplex` is an abstract class designed to be extended
+with an underlying implementation of the `_read(size)` and
+[`_write(chunk, encoding, callback)`][] methods as you would with a
+Readable or Writable stream class.
+
+Since JavaScript doesn't have multiple prototypal inheritance, this
+class prototypally inherits from Readable, and then parasitically from
+Writable. It is thus up to the user to implement both the lowlevel
+`_read(n)` method as well as the lowlevel
+[`_write(chunk, encoding, callback)`][] method on extension duplex classes.
+
+#### new stream.Duplex(options)
+
+* `options` {Object} Passed to both Writable and Readable
+ constructors. Also has the following fields:
+ * `allowHalfOpen` {Boolean} Default=true. If set to `false`, then
+ the stream will automatically end the readable side when the
+ writable side ends and vice versa.
+ * `readableObjectMode` {Boolean} Default=false. Sets `objectMode`
+ for readable side of the stream. Has no effect if `objectMode`
+ is `true`.
+ * `writableObjectMode` {Boolean} Default=false. Sets `objectMode`
+ for writable side of the stream. Has no effect if `objectMode`
+ is `true`.
+
+In classes that extend the Duplex class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+
+### Class: stream.Transform
+
+A "transform" stream is a duplex stream where the output is causally
+connected in some way to the input, such as a [zlib][] stream or a
+[crypto][] stream.
+
+There is no requirement that the output be the same size as the input,
+the same number of chunks, or arrive at the same time. For example, a
+Hash stream will only ever have a single chunk of output which is
+provided when the input is ended. A zlib stream will produce output
+that is either much smaller or much larger than its input.
+
+Rather than implement the [`_read()`][] and [`_write()`][] methods, Transform
+classes must implement the `_transform()` method, and may optionally
+also implement the `_flush()` method. (See below.)
+
+#### new stream.Transform([options])
+
+* `options` {Object} Passed to both Writable and Readable
+ constructors.
+
+In classes that extend the Transform class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+#### transform.\_transform(chunk, encoding, callback)
+
+* `chunk` {Buffer | String} The chunk to be transformed. Will **always**
+ be a buffer unless the `decodeStrings` option was set to `false`.
+* `encoding` {String} If the chunk is a string, then this is the
+ encoding type. If chunk is a buffer, then this is the special
+ value - 'buffer', ignore it in this case.
+* `callback` {Function} Call this function (optionally with an error
+ argument and data) when you are done processing the supplied chunk.
+
+Note: **This function MUST NOT be called directly.** It should be
+implemented by child classes, and called by the internal Transform
+class methods only.
+
+All Transform stream implementations must provide a `_transform`
+method to accept input and produce output.
+
+`_transform` should do whatever has to be done in this specific
+Transform class, to handle the bytes being written, and pass them off
+to the readable portion of the interface. Do asynchronous I/O,
+process things, and so on.
+
+Call `transform.push(outputChunk)` 0 or more times to generate output
+from this input chunk, depending on how much data you want to output
+as a result of this chunk.
+
+Call the callback function only when the current chunk is completely
+consumed. Note that there may or may not be output as a result of any
+particular input chunk. If you supply output as the second argument to the
+callback, it will be passed to push method, in other words the following are
+equivalent:
+
+```javascript
+transform.prototype._transform = function (data, encoding, callback) {
+ this.push(data);
+ callback();
+}
+
+transform.prototype._transform = function (data, encoding, callback) {
+ callback(null, data);
+}
+```
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs. However, you **are** expected to override this method in
+your own extension classes.
+
+#### transform.\_flush(callback)
+
+* `callback` {Function} Call this function (optionally with an error
+ argument) when you are done flushing any remaining data.
+
+Note: **This function MUST NOT be called directly.** It MAY be implemented
+by child classes, and if so, will be called by the internal Transform
+class methods only.
+
+In some cases, your transform operation may need to emit a bit more
+data at the end of the stream. For example, a `Zlib` compression
+stream will store up some internal state so that it can optimally
+compress the output. At the end, however, it needs to do the best it
+can with what is left, so that the data will be complete.
+
+In those cases, you can implement a `_flush` method, which will be
+called at the very end, after all the written data is consumed, but
+before emitting `end` to signal the end of the readable side. Just
+like with `_transform`, call `transform.push(chunk)` zero or more
+times, as appropriate, and call `callback` when the flush operation is
+complete.
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs. However, you **are** expected to override this method in
+your own extension classes.
+
+#### Events: 'finish' and 'end'
+
+The [`finish`][] and [`end`][] events are from the parent Writable
+and Readable classes respectively. The `finish` event is fired after
+`.end()` is called and all chunks have been processed by `_transform`,
+`end` is fired after all data has been output which is after the callback
+in `_flush` has been called.
+
+#### Example: `SimpleProtocol` parser v2
+
+The example above of a simple protocol parser can be implemented
+simply by using the higher level [Transform][] stream class, similar to
+the `parseHeader` and `SimpleProtocol v1` examples above.
+
+In this example, rather than providing the input as an argument, it
+would be piped into the parser, which is a more idiomatic io.js stream
+approach.
+
+```javascript
+var util = require('util');
+var Transform = require('stream').Transform;
+util.inherits(SimpleProtocol, Transform);
+
+function SimpleProtocol(options) {
+ if (!(this instanceof SimpleProtocol))
+ return new SimpleProtocol(options);
+
+ Transform.call(this, options);
+ this._inBody = false;
+ this._sawFirstCr = false;
+ this._rawHeader = [];
+ this.header = null;
+}
+
+SimpleProtocol.prototype._transform = function(chunk, encoding, done) {
+ if (!this._inBody) {
+ // check if the chunk has a \n\n
+ var split = -1;
+ for (var i = 0; i < chunk.length; i++) {
+ if (chunk[i] === 10) { // '\n'
+ if (this._sawFirstCr) {
+ split = i;
+ break;
+ } else {
+ this._sawFirstCr = true;
+ }
+ } else {
+ this._sawFirstCr = false;
+ }
+ }
+
+ if (split === -1) {
+ // still waiting for the \n\n
+ // stash the chunk, and try again.
+ this._rawHeader.push(chunk);
+ } else {
+ this._inBody = true;
+ var h = chunk.slice(0, split);
+ this._rawHeader.push(h);
+ var header = Buffer.concat(this._rawHeader).toString();
+ try {
+ this.header = JSON.parse(header);
+ } catch (er) {
+ this.emit('error', new Error('invalid simple protocol data'));
+ return;
+ }
+ // and let them know that we are done parsing the header.
+ this.emit('header', this.header);
+
+ // now, because we got some extra data, emit this first.
+ this.push(chunk.slice(split));
+ }
+ } else {
+ // from there on, just provide the data to our consumer as-is.
+ this.push(chunk);
+ }
+ done();
+};
+
+// Usage:
+// var parser = new SimpleProtocol();
+// source.pipe(parser)
+// Now parser is a readable stream that will emit 'header'
+// with the parsed header data.
+```
+
+
+### Class: stream.PassThrough
+
+This is a trivial implementation of a [Transform][] stream that simply
+passes the input bytes across to the output. Its purpose is mainly
+for examples and testing, but there are occasionally use cases where
+it can come in handy as a building block for novel sorts of streams.
+
+
+## Simplified Constructor API
+
+<!--type=misc-->
+
+In simple cases there is now the added benefit of being able to construct a stream without inheritance.
+
+This can be done by passing the appropriate methods as constructor options:
+
+Examples:
+
+### Readable
+```javascript
+var readable = new stream.Readable({
+ read: function(n) {
+ // sets this._read under the hood
+ }
+});
+```
+
+### Writable
+```javascript
+var writable = new stream.Writable({
+ write: function(chunk, encoding, next) {
+ // sets this._write under the hood
+ }
+});
+
+// or
+
+var writable = new stream.Writable({
+ writev: function(chunks, next) {
+ // sets this._writev under the hood
+ }
+});
+```
+
+### Duplex
+```javascript
+var duplex = new stream.Duplex({
+ read: function(n) {
+ // sets this._read under the hood
+ },
+ write: function(chunk, encoding, next) {
+ // sets this._write under the hood
+ }
+});
+
+// or
+
+var duplex = new stream.Duplex({
+ read: function(n) {
+ // sets this._read under the hood
+ },
+ writev: function(chunks, next) {
+ // sets this._writev under the hood
+ }
+});
+```
+
+### Transform
+```javascript
+var transform = new stream.Transform({
+ transform: function(chunk, encoding, next) {
+ // sets this._transform under the hood
+ },
+ flush: function(done) {
+ // sets this._flush under the hood
+ }
+});
+```
+
+## Streams: Under the Hood
+
+<!--type=misc-->
+
+### Buffering
+
+<!--type=misc-->
+
+Both Writable and Readable streams will buffer data on an internal
+object called `_writableState.buffer` or `_readableState.buffer`,
+respectively.
+
+The amount of data that will potentially be buffered depends on the
+`highWaterMark` option which is passed into the constructor.
+
+Buffering in Readable streams happens when the implementation calls
+[`stream.push(chunk)`][]. If the consumer of the Stream does not call
+`stream.read()`, then the data will sit in the internal queue until it
+is consumed.
+
+Buffering in Writable streams happens when the user calls
+[`stream.write(chunk)`][] repeatedly, even when `write()` returns `false`.
+
+The purpose of streams, especially with the `pipe()` method, is to
+limit the buffering of data to acceptable levels, so that sources and
+destinations of varying speed will not overwhelm the available memory.
+
+### `stream.read(0)`
+
+There are some cases where you want to trigger a refresh of the
+underlying readable stream mechanisms, without actually consuming any
+data. In that case, you can call `stream.read(0)`, which will always
+return null.
+
+If the internal read buffer is below the `highWaterMark`, and the
+stream is not currently reading, then calling `read(0)` will trigger
+a low-level `_read` call.
+
+There is almost never a need to do this. However, you will see some
+cases in io.js's internals where this is done, particularly in the
+Readable stream class internals.
+
+### `stream.push('')`
+
+Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an
+interesting side effect. Because it *is* a call to
+[`stream.push()`][], it will end the `reading` process. However, it
+does *not* add any data to the readable buffer, so there's nothing for
+a user to consume.
+
+Very rarely, there are cases where you have no data to provide now,
+but the consumer of your stream (or, perhaps, another bit of your own
+code) will know when to check again, by calling `stream.read(0)`. In
+those cases, you *may* call `stream.push('')`.
+
+So far, the only use case for this functionality is in the
+[tls.CryptoStream][] class, which is deprecated in io.js v1.0. If you
+find that you have to use `stream.push('')`, please consider another
+approach, because it almost certainly indicates that something is
+horribly wrong.
+
+### Compatibility with Older Node.js Versions
+
+<!--type=misc-->
+
+In versions of Node.js prior to v0.10, the Readable stream interface was
+simpler, but also less powerful and less useful.
+
+* Rather than waiting for you to call the `read()` method, `'data'`
+ events would start emitting immediately. If you needed to do some
+ I/O to decide how to handle data, then you had to store the chunks
+ in some kind of buffer so that they would not be lost.
+* The [`pause()`][] method was advisory, rather than guaranteed. This
+ meant that you still had to be prepared to receive `'data'` events
+ even when the stream was in a paused state.
+
+In io.js v1.0 and Node.js v0.10, the Readable class described below was added.
+For backwards compatibility with older Node.js programs, Readable streams
+switch into "flowing mode" when a `'data'` event handler is added, or
+when the [`resume()`][] method is called. The effect is that, even if
+you are not using the new `read()` method and `'readable'` event, you
+no longer have to worry about losing `'data'` chunks.
+
+Most programs will continue to function normally. However, this
+introduces an edge case in the following conditions:
+
+* No [`'data'` event][] handler is added.
+* The [`resume()`][] method is never called.
+* The stream is not piped to any writable destination.
+
+For example, consider the following code:
+
+```javascript
+// WARNING! BROKEN!
+net.createServer(function(socket) {
+
+ // we add an 'end' method, but never consume the data
+ socket.on('end', function() {
+ // It will never get here.
+ socket.end('I got your message (but didnt read it)\n');
+ });
+
+}).listen(1337);
+```
+
+In versions of Node.js prior to v0.10, the incoming message data would be
+simply discarded. However, in io.js v1.0 and Node.js v0.10 and beyond,
+the socket will remain paused forever.
+
+The workaround in this situation is to call the `resume()` method to
+start the flow of data:
+
+```javascript
+// Workaround
+net.createServer(function(socket) {
+
+ socket.on('end', function() {
+ socket.end('I got your message (but didnt read it)\n');
+ });
+
+ // start the flow of data, discarding it.
+ socket.resume();
+
+}).listen(1337);
+```
+
+In addition to new Readable streams switching into flowing mode,
+pre-v0.10 style streams can be wrapped in a Readable class using the
+`wrap()` method.
+
+
+### Object Mode
+
+<!--type=misc-->
+
+Normally, Streams operate on Strings and Buffers exclusively.
+
+Streams that are in **object mode** can emit generic JavaScript values
+other than Buffers and Strings.
+
+A Readable stream in object mode will always return a single item from
+a call to `stream.read(size)`, regardless of what the size argument
+is.
+
+A Writable stream in object mode will always ignore the `encoding`
+argument to `stream.write(data, encoding)`.
+
+The special value `null` still retains its special value for object
+mode streams. That is, for object mode readable streams, `null` as a
+return value from `stream.read()` indicates that there is no more
+data, and [`stream.push(null)`][] will signal the end of stream data
+(`EOF`).
+
+No streams in io.js core are object mode streams. This pattern is only
+used by userland streaming libraries.
+
+You should set `objectMode` in your stream child class constructor on
+the options object. Setting `objectMode` mid-stream is not safe.
+
+For Duplex streams `objectMode` can be set exclusively for readable or
+writable side with `readableObjectMode` and `writableObjectMode`
+respectively. These options can be used to implement parsers and
+serializers with Transform streams.
+
+```javascript
+var util = require('util');
+var StringDecoder = require('string_decoder').StringDecoder;
+var Transform = require('stream').Transform;
+util.inherits(JSONParseStream, Transform);
+
+// Gets \n-delimited JSON string data, and emits the parsed objects
+function JSONParseStream() {
+ if (!(this instanceof JSONParseStream))
+ return new JSONParseStream();
+
+ Transform.call(this, { readableObjectMode : true });
+
+ this._buffer = '';
+ this._decoder = new StringDecoder('utf8');
+}
+
+JSONParseStream.prototype._transform = function(chunk, encoding, cb) {
+ this._buffer += this._decoder.write(chunk);
+ // split on newlines
+ var lines = this._buffer.split(/\r?\n/);
+ // keep the last partial line buffered
+ this._buffer = lines.pop();
+ for (var l = 0; l < lines.length; l++) {
+ var line = lines[l];
+ try {
+ var obj = JSON.parse(line);
+ } catch (er) {
+ this.emit('error', er);
+ return;
+ }
+ // push the parsed object out to the readable consumer
+ this.push(obj);
+ }
+ cb();
+};
+
+JSONParseStream.prototype._flush = function(cb) {
+ // Just handle any leftover
+ var rem = this._buffer.trim();
+ if (rem) {
+ try {
+ var obj = JSON.parse(rem);
+ } catch (er) {
+ this.emit('error', er);
+ return;
+ }
+ // push the parsed object out to the readable consumer
+ this.push(obj);
+ }
+ cb();
+};
+```
+
+
+[EventEmitter]: https://iojs.org/dist/v2.3.0/doc/api/events.html#events_class_events_eventemitter
+[Object mode]: #stream_object_mode
+[`stream.push(chunk)`]: #stream_readable_push_chunk_encoding
+[`stream.push(null)`]: #stream_readable_push_chunk_encoding
+[`stream.push()`]: #stream_readable_push_chunk_encoding
+[`unpipe()`]: #stream_readable_unpipe_destination
+[unpiped]: #stream_readable_unpipe_destination
+[tcp sockets]: https://iojs.org/dist/v2.3.0/doc/api/net.html#net_class_net_socket
+[zlib streams]: zlib.html
+[zlib]: zlib.html
+[crypto streams]: crypto.html
+[crypto]: crypto.html
+[tls.CryptoStream]: https://iojs.org/dist/v2.3.0/doc/api/tls.html#tls_class_cryptostream
+[process.stdin]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdin
+[stdout]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdout
+[process.stdout]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdout
+[process.stderr]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stderr
+[child process stdout and stderr]: https://iojs.org/dist/v2.3.0/doc/api/child_process.html#child_process_child_stdout
+[API for Stream Consumers]: #stream_api_for_stream_consumers
+[API for Stream Implementors]: #stream_api_for_stream_implementors
+[Readable]: #stream_class_stream_readable
+[Writable]: #stream_class_stream_writable
+[Duplex]: #stream_class_stream_duplex
+[Transform]: #stream_class_stream_transform
+[`end`]: #stream_event_end
+[`finish`]: #stream_event_finish
+[`_read(size)`]: #stream_readable_read_size_1
+[`_read()`]: #stream_readable_read_size_1
+[_read]: #stream_readable_read_size_1
+[`writable.write(chunk)`]: #stream_writable_write_chunk_encoding_callback
+[`write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback
+[`write()`]: #stream_writable_write_chunk_encoding_callback
+[`stream.write(chunk)`]: #stream_writable_write_chunk_encoding_callback
+[`_write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback_1
+[`_write()`]: #stream_writable_write_chunk_encoding_callback_1
+[_write]: #stream_writable_write_chunk_encoding_callback_1
+[`util.inherits`]: https://iojs.org/dist/v2.3.0/doc/api/util.html#util_util_inherits_constructor_superconstructor
+[`end()`]: #stream_writable_end_chunk_encoding_callback
+[`'data'` event]: #stream_event_data
+[`resume()`]: #stream_readable_resume
+[`readable.resume()`]: #stream_readable_resume
+[`pause()`]: #stream_readable_pause
+[`unpipe()`]: #stream_readable_unpipe_destination
+[`pipe()`]: #stream_readable_pipe_destination_options
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
new file mode 100644
index 000000000..83275f192
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
@@ -0,0 +1,60 @@
+# streams WG Meeting 2015-01-30
+
+## Links
+
+* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg
+* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106
+* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/
+
+## Agenda
+
+Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting.
+
+* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105)
+* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101)
+* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102)
+* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99)
+
+## Minutes
+
+### adopt a charter
+
+* group: +1's all around
+
+### What versioning scheme should be adopted?
+* group: +1’s 3.0.0
+* domenic+group: pulling in patches from other sources where appropriate
+* mikeal: version independently, suggesting versions for io.js
+* mikeal+domenic: work with TC to notify in advance of changes
+simpler stream creation
+
+### streamline creation of streams
+* sam: streamline creation of streams
+* domenic: nice simple solution posted
+ but, we lose the opportunity to change the model
+ may not be backwards incompatible (double check keys)
+
+ **action item:** domenic will check
+
+### remove implicit flowing of streams on(‘data’)
+* add isFlowing / isPaused
+* mikeal: worrying that we’re documenting polyfill methods – confuses users
+* domenic: more reflective API is probably good, with warning labels for users
+* new section for mad scientists (reflective stream access)
+* calvin: name the “third state”
+* mikeal: maybe borrow the name from whatwg?
+* domenic: we’re missing the “third state”
+* consensus: kind of difficult to name the third state
+* mikeal: figure out differences in states / compat
+* mathias: always flow on data – eliminates third state
+ * explore what it breaks
+
+**action items:**
+* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream)
+* ask rod/build for infrastructure
+* **chris**: explore the “flow on data” approach
+* add isPaused/isFlowing
+* add new docs section
+* move isPaused to that section
+
+
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js
new file mode 100644
index 000000000..ca807af87
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_duplex.js")
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js
new file mode 100644
index 000000000..69558af03
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js
@@ -0,0 +1,82 @@
+// a duplex stream is just a stream that is both readable and writable.
+// Since JS doesn't have multiple prototypal inheritance, this class
+// prototypally inherits from Readable, and then parasitically from
+// Writable.
+
+'use strict';
+
+/*<replacement>*/
+var objectKeys = Object.keys || function (obj) {
+ var keys = [];
+ for (var key in obj) keys.push(key);
+ return keys;
+}
+/*</replacement>*/
+
+
+module.exports = Duplex;
+
+/*<replacement>*/
+var processNextTick = require('process-nextick-args');
+/*</replacement>*/
+
+
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+var Readable = require('./_stream_readable');
+var Writable = require('./_stream_writable');
+
+util.inherits(Duplex, Readable);
+
+var keys = objectKeys(Writable.prototype);
+for (var v = 0; v < keys.length; v++) {
+ var method = keys[v];
+ if (!Duplex.prototype[method])
+ Duplex.prototype[method] = Writable.prototype[method];
+}
+
+function Duplex(options) {
+ if (!(this instanceof Duplex))
+ return new Duplex(options);
+
+ Readable.call(this, options);
+ Writable.call(this, options);
+
+ if (options && options.readable === false)
+ this.readable = false;
+
+ if (options && options.writable === false)
+ this.writable = false;
+
+ this.allowHalfOpen = true;
+ if (options && options.allowHalfOpen === false)
+ this.allowHalfOpen = false;
+
+ this.once('end', onend);
+}
+
+// the no-half-open enforcer
+function onend() {
+ // if we allow half-open state, or if the writable side ended,
+ // then we're ok.
+ if (this.allowHalfOpen || this._writableState.ended)
+ return;
+
+ // no more data can be written.
+ // But allow more writes to happen in this tick.
+ processNextTick(onEndNT, this);
+}
+
+function onEndNT(self) {
+ self.end();
+}
+
+function forEach (xs, f) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ f(xs[i], i);
+ }
+}
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js
new file mode 100644
index 000000000..bddfdd015
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js
@@ -0,0 +1,27 @@
+// a passthrough stream.
+// basically just the most minimal sort of Transform stream.
+// Every written chunk gets output as-is.
+
+'use strict';
+
+module.exports = PassThrough;
+
+var Transform = require('./_stream_transform');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+util.inherits(PassThrough, Transform);
+
+function PassThrough(options) {
+ if (!(this instanceof PassThrough))
+ return new PassThrough(options);
+
+ Transform.call(this, options);
+}
+
+PassThrough.prototype._transform = function(chunk, encoding, cb) {
+ cb(null, chunk);
+};
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
new file mode 100644
index 000000000..eef3d825d
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
@@ -0,0 +1,959 @@
+'use strict';
+
+module.exports = Readable;
+
+/*<replacement>*/
+var processNextTick = require('process-nextick-args');
+/*</replacement>*/
+
+
+/*<replacement>*/
+var isArray = require('isarray');
+/*</replacement>*/
+
+
+/*<replacement>*/
+var Buffer = require('buffer').Buffer;
+/*</replacement>*/
+
+Readable.ReadableState = ReadableState;
+
+var EE = require('events').EventEmitter;
+
+/*<replacement>*/
+if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
+ return emitter.listeners(type).length;
+};
+/*</replacement>*/
+
+
+
+/*<replacement>*/
+var Stream;
+(function (){try{
+ Stream = require('st' + 'ream');
+}catch(_){}finally{
+ if (!Stream)
+ Stream = require('events').EventEmitter;
+}}())
+/*</replacement>*/
+
+var Buffer = require('buffer').Buffer;
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+
+
+/*<replacement>*/
+var debug = require('util');
+if (debug && debug.debuglog) {
+ debug = debug.debuglog('stream');
+} else {
+ debug = function () {};
+}
+/*</replacement>*/
+
+var StringDecoder;
+
+util.inherits(Readable, Stream);
+
+function ReadableState(options, stream) {
+ var Duplex = require('./_stream_duplex');
+
+ options = options || {};
+
+ // object stream flag. Used to make read(n) ignore n and to
+ // make all the buffer merging and length checks go away
+ this.objectMode = !!options.objectMode;
+
+ if (stream instanceof Duplex)
+ this.objectMode = this.objectMode || !!options.readableObjectMode;
+
+ // the point at which it stops calling _read() to fill the buffer
+ // Note: 0 is a valid value, means "don't call _read preemptively ever"
+ var hwm = options.highWaterMark;
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+ this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
+
+ // cast to ints.
+ this.highWaterMark = ~~this.highWaterMark;
+
+ this.buffer = [];
+ this.length = 0;
+ this.pipes = null;
+ this.pipesCount = 0;
+ this.flowing = null;
+ this.ended = false;
+ this.endEmitted = false;
+ this.reading = false;
+
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, because any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
+ this.sync = true;
+
+ // whenever we return null, then we set a flag to say
+ // that we're awaiting a 'readable' event emission.
+ this.needReadable = false;
+ this.emittedReadable = false;
+ this.readableListening = false;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // when piping, we only care about 'readable' events that happen
+ // after read()ing all the bytes and not getting any pushback.
+ this.ranOut = false;
+
+ // the number of writers that are awaiting a drain event in .pipe()s
+ this.awaitDrain = 0;
+
+ // if true, a maybeReadMore has been scheduled
+ this.readingMore = false;
+
+ this.decoder = null;
+ this.encoding = null;
+ if (options.encoding) {
+ if (!StringDecoder)
+ StringDecoder = require('string_decoder/').StringDecoder;
+ this.decoder = new StringDecoder(options.encoding);
+ this.encoding = options.encoding;
+ }
+}
+
+function Readable(options) {
+ var Duplex = require('./_stream_duplex');
+
+ if (!(this instanceof Readable))
+ return new Readable(options);
+
+ this._readableState = new ReadableState(options, this);
+
+ // legacy
+ this.readable = true;
+
+ if (options && typeof options.read === 'function')
+ this._read = options.read;
+
+ Stream.call(this);
+}
+
+// Manually shove something into the read() buffer.
+// This returns true if the highWaterMark has not been hit yet,
+// similar to how Writable.write() returns true if you should
+// write() some more.
+Readable.prototype.push = function(chunk, encoding) {
+ var state = this._readableState;
+
+ if (!state.objectMode && typeof chunk === 'string') {
+ encoding = encoding || state.defaultEncoding;
+ if (encoding !== state.encoding) {
+ chunk = new Buffer(chunk, encoding);
+ encoding = '';
+ }
+ }
+
+ return readableAddChunk(this, state, chunk, encoding, false);
+};
+
+// Unshift should *always* be something directly out of read()
+Readable.prototype.unshift = function(chunk) {
+ var state = this._readableState;
+ return readableAddChunk(this, state, chunk, '', true);
+};
+
+Readable.prototype.isPaused = function() {
+ return this._readableState.flowing === false;
+};
+
+function readableAddChunk(stream, state, chunk, encoding, addToFront) {
+ var er = chunkInvalid(state, chunk);
+ if (er) {
+ stream.emit('error', er);
+ } else if (chunk === null) {
+ state.reading = false;
+ onEofChunk(stream, state);
+ } else if (state.objectMode || chunk && chunk.length > 0) {
+ if (state.ended && !addToFront) {
+ var e = new Error('stream.push() after EOF');
+ stream.emit('error', e);
+ } else if (state.endEmitted && addToFront) {
+ var e = new Error('stream.unshift() after end event');
+ stream.emit('error', e);
+ } else {
+ if (state.decoder && !addToFront && !encoding)
+ chunk = state.decoder.write(chunk);
+
+ if (!addToFront)
+ state.reading = false;
+
+ // if we want the data now, just emit it.
+ if (state.flowing && state.length === 0 && !state.sync) {
+ stream.emit('data', chunk);
+ stream.read(0);
+ } else {
+ // update the buffer info.
+ state.length += state.objectMode ? 1 : chunk.length;
+ if (addToFront)
+ state.buffer.unshift(chunk);
+ else
+ state.buffer.push(chunk);
+
+ if (state.needReadable)
+ emitReadable(stream);
+ }
+
+ maybeReadMore(stream, state);
+ }
+ } else if (!addToFront) {
+ state.reading = false;
+ }
+
+ return needMoreData(state);
+}
+
+
+
+// if it's past the high water mark, we can push in some more.
+// Also, if we have no data yet, we can stand some
+// more bytes. This is to work around cases where hwm=0,
+// such as the repl. Also, if the push() triggered a
+// readable event, and the user called read(largeNumber) such that
+// needReadable was set, then we ought to push more, so that another
+// 'readable' event will be triggered.
+function needMoreData(state) {
+ return !state.ended &&
+ (state.needReadable ||
+ state.length < state.highWaterMark ||
+ state.length === 0);
+}
+
+// backwards compatibility.
+Readable.prototype.setEncoding = function(enc) {
+ if (!StringDecoder)
+ StringDecoder = require('string_decoder/').StringDecoder;
+ this._readableState.decoder = new StringDecoder(enc);
+ this._readableState.encoding = enc;
+ return this;
+};
+
+// Don't raise the hwm > 128MB
+var MAX_HWM = 0x800000;
+function roundUpToNextPowerOf2(n) {
+ if (n >= MAX_HWM) {
+ n = MAX_HWM;
+ } else {
+ // Get the next highest power of 2
+ n--;
+ for (var p = 1; p < 32; p <<= 1) n |= n >> p;
+ n++;
+ }
+ return n;
+}
+
+function howMuchToRead(n, state) {
+ if (state.length === 0 && state.ended)
+ return 0;
+
+ if (state.objectMode)
+ return n === 0 ? 0 : 1;
+
+ if (n === null || isNaN(n)) {
+ // only flow one buffer at a time
+ if (state.flowing && state.buffer.length)
+ return state.buffer[0].length;
+ else
+ return state.length;
+ }
+
+ if (n <= 0)
+ return 0;
+
+ // If we're asking for more than the target buffer level,
+ // then raise the water mark. Bump up to the next highest
+ // power of 2, to prevent increasing it excessively in tiny
+ // amounts.
+ if (n > state.highWaterMark)
+ state.highWaterMark = roundUpToNextPowerOf2(n);
+
+ // don't have that much. return null, unless we've ended.
+ if (n > state.length) {
+ if (!state.ended) {
+ state.needReadable = true;
+ return 0;
+ } else {
+ return state.length;
+ }
+ }
+
+ return n;
+}
+
+// you can override either this method, or the async _read(n) below.
+Readable.prototype.read = function(n) {
+ debug('read', n);
+ var state = this._readableState;
+ var nOrig = n;
+
+ if (typeof n !== 'number' || n > 0)
+ state.emittedReadable = false;
+
+ // if we're doing read(0) to trigger a readable event, but we
+ // already have a bunch of data in the buffer, then just trigger
+ // the 'readable' event and move on.
+ if (n === 0 &&
+ state.needReadable &&
+ (state.length >= state.highWaterMark || state.ended)) {
+ debug('read: emitReadable', state.length, state.ended);
+ if (state.length === 0 && state.ended)
+ endReadable(this);
+ else
+ emitReadable(this);
+ return null;
+ }
+
+ n = howMuchToRead(n, state);
+
+ // if we've ended, and we're now clear, then finish it up.
+ if (n === 0 && state.ended) {
+ if (state.length === 0)
+ endReadable(this);
+ return null;
+ }
+
+ // All the actual chunk generation logic needs to be
+ // *below* the call to _read. The reason is that in certain
+ // synthetic stream cases, such as passthrough streams, _read
+ // may be a completely synchronous operation which may change
+ // the state of the read buffer, providing enough data when
+ // before there was *not* enough.
+ //
+ // So, the steps are:
+ // 1. Figure out what the state of things will be after we do
+ // a read from the buffer.
+ //
+ // 2. If that resulting state will trigger a _read, then call _read.
+ // Note that this may be asynchronous, or synchronous. Yes, it is
+ // deeply ugly to write APIs this way, but that still doesn't mean
+ // that the Readable class should behave improperly, as streams are
+ // designed to be sync/async agnostic.
+ // Take note if the _read call is sync or async (ie, if the read call
+ // has returned yet), so that we know whether or not it's safe to emit
+ // 'readable' etc.
+ //
+ // 3. Actually pull the requested chunks out of the buffer and return.
+
+ // if we need a readable event, then we need to do some reading.
+ var doRead = state.needReadable;
+ debug('need readable', doRead);
+
+ // if we currently have less than the highWaterMark, then also read some
+ if (state.length === 0 || state.length - n < state.highWaterMark) {
+ doRead = true;
+ debug('length less than watermark', doRead);
+ }
+
+ // however, if we've ended, then there's no point, and if we're already
+ // reading, then it's unnecessary.
+ if (state.ended || state.reading) {
+ doRead = false;
+ debug('reading or ended', doRead);
+ }
+
+ if (doRead) {
+ debug('do read');
+ state.reading = true;
+ state.sync = true;
+ // if the length is currently zero, then we *need* a readable event.
+ if (state.length === 0)
+ state.needReadable = true;
+ // call internal read method
+ this._read(state.highWaterMark);
+ state.sync = false;
+ }
+
+ // If _read pushed data synchronously, then `reading` will be false,
+ // and we need to re-evaluate how much data we can return to the user.
+ if (doRead && !state.reading)
+ n = howMuchToRead(nOrig, state);
+
+ var ret;
+ if (n > 0)
+ ret = fromList(n, state);
+ else
+ ret = null;
+
+ if (ret === null) {
+ state.needReadable = true;
+ n = 0;
+ }
+
+ state.length -= n;
+
+ // If we have nothing in the buffer, then we want to know
+ // as soon as we *do* get something into the buffer.
+ if (state.length === 0 && !state.ended)
+ state.needReadable = true;
+
+ // If we tried to read() past the EOF, then emit end on the next tick.
+ if (nOrig !== n && state.ended && state.length === 0)
+ endReadable(this);
+
+ if (ret !== null)
+ this.emit('data', ret);
+
+ return ret;
+};
+
+function chunkInvalid(state, chunk) {
+ var er = null;
+ if (!(Buffer.isBuffer(chunk)) &&
+ typeof chunk !== 'string' &&
+ chunk !== null &&
+ chunk !== undefined &&
+ !state.objectMode) {
+ er = new TypeError('Invalid non-string/buffer chunk');
+ }
+ return er;
+}
+
+
+function onEofChunk(stream, state) {
+ if (state.ended) return;
+ if (state.decoder) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length) {
+ state.buffer.push(chunk);
+ state.length += state.objectMode ? 1 : chunk.length;
+ }
+ }
+ state.ended = true;
+
+ // emit 'readable' now to make sure it gets picked up.
+ emitReadable(stream);
+}
+
+// Don't emit readable right away in sync mode, because this can trigger
+// another read() call => stack overflow. This way, it might trigger
+// a nextTick recursion warning, but that's not so bad.
+function emitReadable(stream) {
+ var state = stream._readableState;
+ state.needReadable = false;
+ if (!state.emittedReadable) {
+ debug('emitReadable', state.flowing);
+ state.emittedReadable = true;
+ if (state.sync)
+ processNextTick(emitReadable_, stream);
+ else
+ emitReadable_(stream);
+ }
+}
+
+function emitReadable_(stream) {
+ debug('emit readable');
+ stream.emit('readable');
+ flow(stream);
+}
+
+
+// at this point, the user has presumably seen the 'readable' event,
+// and called read() to consume some data. that may have triggered
+// in turn another _read(n) call, in which case reading = true if
+// it's in progress.
+// However, if we're not ended, or reading, and the length < hwm,
+// then go ahead and try to read some more preemptively.
+function maybeReadMore(stream, state) {
+ if (!state.readingMore) {
+ state.readingMore = true;
+ processNextTick(maybeReadMore_, stream, state);
+ }
+}
+
+function maybeReadMore_(stream, state) {
+ var len = state.length;
+ while (!state.reading && !state.flowing && !state.ended &&
+ state.length < state.highWaterMark) {
+ debug('maybeReadMore read 0');
+ stream.read(0);
+ if (len === state.length)
+ // didn't get any data, stop spinning.
+ break;
+ else
+ len = state.length;
+ }
+ state.readingMore = false;
+}
+
+// abstract method. to be overridden in specific implementation classes.
+// call cb(er, data) where data is <= n in length.
+// for virtual (non-string, non-buffer) streams, "length" is somewhat
+// arbitrary, and perhaps not very meaningful.
+Readable.prototype._read = function(n) {
+ this.emit('error', new Error('not implemented'));
+};
+
+Readable.prototype.pipe = function(dest, pipeOpts) {
+ var src = this;
+ var state = this._readableState;
+
+ switch (state.pipesCount) {
+ case 0:
+ state.pipes = dest;
+ break;
+ case 1:
+ state.pipes = [state.pipes, dest];
+ break;
+ default:
+ state.pipes.push(dest);
+ break;
+ }
+ state.pipesCount += 1;
+ debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
+
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) &&
+ dest !== process.stdout &&
+ dest !== process.stderr;
+
+ var endFn = doEnd ? onend : cleanup;
+ if (state.endEmitted)
+ processNextTick(endFn);
+ else
+ src.once('end', endFn);
+
+ dest.on('unpipe', onunpipe);
+ function onunpipe(readable) {
+ debug('onunpipe');
+ if (readable === src) {
+ cleanup();
+ }
+ }
+
+ function onend() {
+ debug('onend');
+ dest.end();
+ }
+
+ // when the dest drains, it reduces the awaitDrain counter
+ // on the source. This would be more elegant with a .once()
+ // handler in flow(), but adding and removing repeatedly is
+ // too slow.
+ var ondrain = pipeOnDrain(src);
+ dest.on('drain', ondrain);
+
+ function cleanup() {
+ debug('cleanup');
+ // cleanup event handlers once the pipe is broken
+ dest.removeListener('close', onclose);
+ dest.removeListener('finish', onfinish);
+ dest.removeListener('drain', ondrain);
+ dest.removeListener('error', onerror);
+ dest.removeListener('unpipe', onunpipe);
+ src.removeListener('end', onend);
+ src.removeListener('end', cleanup);
+ src.removeListener('data', ondata);
+
+ // if the reader is waiting for a drain event from this
+ // specific writer, then it would cause it to never start
+ // flowing again.
+ // So, if this is awaiting a drain, then we just call it now.
+ // If we don't know, then assume that we are waiting for one.
+ if (state.awaitDrain &&
+ (!dest._writableState || dest._writableState.needDrain))
+ ondrain();
+ }
+
+ src.on('data', ondata);
+ function ondata(chunk) {
+ debug('ondata');
+ var ret = dest.write(chunk);
+ if (false === ret) {
+ debug('false write response, pause',
+ src._readableState.awaitDrain);
+ src._readableState.awaitDrain++;
+ src.pause();
+ }
+ }
+
+ // if the dest has an error, then stop piping into it.
+ // however, don't suppress the throwing behavior for this.
+ function onerror(er) {
+ debug('onerror', er);
+ unpipe();
+ dest.removeListener('error', onerror);
+ if (EE.listenerCount(dest, 'error') === 0)
+ dest.emit('error', er);
+ }
+ // This is a brutally ugly hack to make sure that our error handler
+ // is attached before any userland ones. NEVER DO THIS.
+ if (!dest._events || !dest._events.error)
+ dest.on('error', onerror);
+ else if (isArray(dest._events.error))
+ dest._events.error.unshift(onerror);
+ else
+ dest._events.error = [onerror, dest._events.error];
+
+
+
+ // Both close and finish should trigger unpipe, but only once.
+ function onclose() {
+ dest.removeListener('finish', onfinish);
+ unpipe();
+ }
+ dest.once('close', onclose);
+ function onfinish() {
+ debug('onfinish');
+ dest.removeListener('close', onclose);
+ unpipe();
+ }
+ dest.once('finish', onfinish);
+
+ function unpipe() {
+ debug('unpipe');
+ src.unpipe(dest);
+ }
+
+ // tell the dest that it's being piped to
+ dest.emit('pipe', src);
+
+ // start the flow if it hasn't been started already.
+ if (!state.flowing) {
+ debug('pipe resume');
+ src.resume();
+ }
+
+ return dest;
+};
+
+function pipeOnDrain(src) {
+ return function() {
+ var state = src._readableState;
+ debug('pipeOnDrain', state.awaitDrain);
+ if (state.awaitDrain)
+ state.awaitDrain--;
+ if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) {
+ state.flowing = true;
+ flow(src);
+ }
+ };
+}
+
+
+Readable.prototype.unpipe = function(dest) {
+ var state = this._readableState;
+
+ // if we're not piping anywhere, then do nothing.
+ if (state.pipesCount === 0)
+ return this;
+
+ // just one destination. most common case.
+ if (state.pipesCount === 1) {
+ // passed in one, but it's not the right one.
+ if (dest && dest !== state.pipes)
+ return this;
+
+ if (!dest)
+ dest = state.pipes;
+
+ // got a match.
+ state.pipes = null;
+ state.pipesCount = 0;
+ state.flowing = false;
+ if (dest)
+ dest.emit('unpipe', this);
+ return this;
+ }
+
+ // slow case. multiple pipe destinations.
+
+ if (!dest) {
+ // remove all.
+ var dests = state.pipes;
+ var len = state.pipesCount;
+ state.pipes = null;
+ state.pipesCount = 0;
+ state.flowing = false;
+
+ for (var i = 0; i < len; i++)
+ dests[i].emit('unpipe', this);
+ return this;
+ }
+
+ // try to find the right one.
+ var i = indexOf(state.pipes, dest);
+ if (i === -1)
+ return this;
+
+ state.pipes.splice(i, 1);
+ state.pipesCount -= 1;
+ if (state.pipesCount === 1)
+ state.pipes = state.pipes[0];
+
+ dest.emit('unpipe', this);
+
+ return this;
+};
+
+// set up data events if they are asked for
+// Ensure readable listeners eventually get something
+Readable.prototype.on = function(ev, fn) {
+ var res = Stream.prototype.on.call(this, ev, fn);
+
+ // If listening to data, and it has not explicitly been paused,
+ // then call resume to start the flow of data on the next tick.
+ if (ev === 'data' && false !== this._readableState.flowing) {
+ this.resume();
+ }
+
+ if (ev === 'readable' && this.readable) {
+ var state = this._readableState;
+ if (!state.readableListening) {
+ state.readableListening = true;
+ state.emittedReadable = false;
+ state.needReadable = true;
+ if (!state.reading) {
+ processNextTick(nReadingNextTick, this);
+ } else if (state.length) {
+ emitReadable(this, state);
+ }
+ }
+ }
+
+ return res;
+};
+Readable.prototype.addListener = Readable.prototype.on;
+
+function nReadingNextTick(self) {
+ debug('readable nexttick read 0');
+ self.read(0);
+}
+
+// pause() and resume() are remnants of the legacy readable stream API
+// If the user uses them, then switch into old mode.
+Readable.prototype.resume = function() {
+ var state = this._readableState;
+ if (!state.flowing) {
+ debug('resume');
+ state.flowing = true;
+ resume(this, state);
+ }
+ return this;
+};
+
+function resume(stream, state) {
+ if (!state.resumeScheduled) {
+ state.resumeScheduled = true;
+ processNextTick(resume_, stream, state);
+ }
+}
+
+function resume_(stream, state) {
+ if (!state.reading) {
+ debug('resume read 0');
+ stream.read(0);
+ }
+
+ state.resumeScheduled = false;
+ stream.emit('resume');
+ flow(stream);
+ if (state.flowing && !state.reading)
+ stream.read(0);
+}
+
+Readable.prototype.pause = function() {
+ debug('call pause flowing=%j', this._readableState.flowing);
+ if (false !== this._readableState.flowing) {
+ debug('pause');
+ this._readableState.flowing = false;
+ this.emit('pause');
+ }
+ return this;
+};
+
+function flow(stream) {
+ var state = stream._readableState;
+ debug('flow', state.flowing);
+ if (state.flowing) {
+ do {
+ var chunk = stream.read();
+ } while (null !== chunk && state.flowing);
+ }
+}
+
+// wrap an old-style stream as the async data source.
+// This is *not* part of the readable stream interface.
+// It is an ugly unfortunate mess of history.
+Readable.prototype.wrap = function(stream) {
+ var state = this._readableState;
+ var paused = false;
+
+ var self = this;
+ stream.on('end', function() {
+ debug('wrapped end');
+ if (state.decoder && !state.ended) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length)
+ self.push(chunk);
+ }
+
+ self.push(null);
+ });
+
+ stream.on('data', function(chunk) {
+ debug('wrapped data');
+ if (state.decoder)
+ chunk = state.decoder.write(chunk);
+
+ // don't skip over falsy values in objectMode
+ if (state.objectMode && (chunk === null || chunk === undefined))
+ return;
+ else if (!state.objectMode && (!chunk || !chunk.length))
+ return;
+
+ var ret = self.push(chunk);
+ if (!ret) {
+ paused = true;
+ stream.pause();
+ }
+ });
+
+ // proxy all the other methods.
+ // important when wrapping filters and duplexes.
+ for (var i in stream) {
+ if (this[i] === undefined && typeof stream[i] === 'function') {
+ this[i] = function(method) { return function() {
+ return stream[method].apply(stream, arguments);
+ }; }(i);
+ }
+ }
+
+ // proxy certain important events.
+ var events = ['error', 'close', 'destroy', 'pause', 'resume'];
+ forEach(events, function(ev) {
+ stream.on(ev, self.emit.bind(self, ev));
+ });
+
+ // when we try to consume some more bytes, simply unpause the
+ // underlying stream.
+ self._read = function(n) {
+ debug('wrapped _read', n);
+ if (paused) {
+ paused = false;
+ stream.resume();
+ }
+ };
+
+ return self;
+};
+
+
+
+// exposed for testing purposes only.
+Readable._fromList = fromList;
+
+// Pluck off n bytes from an array of buffers.
+// Length is the combined lengths of all the buffers in the list.
+function fromList(n, state) {
+ var list = state.buffer;
+ var length = state.length;
+ var stringMode = !!state.decoder;
+ var objectMode = !!state.objectMode;
+ var ret;
+
+ // nothing in the list, definitely empty.
+ if (list.length === 0)
+ return null;
+
+ if (length === 0)
+ ret = null;
+ else if (objectMode)
+ ret = list.shift();
+ else if (!n || n >= length) {
+ // read it all, truncate the array.
+ if (stringMode)
+ ret = list.join('');
+ else
+ ret = Buffer.concat(list, length);
+ list.length = 0;
+ } else {
+ // read just some of it.
+ if (n < list[0].length) {
+ // just take a part of the first list item.
+ // slice is the same for buffers and strings.
+ var buf = list[0];
+ ret = buf.slice(0, n);
+ list[0] = buf.slice(n);
+ } else if (n === list[0].length) {
+ // first list is a perfect match
+ ret = list.shift();
+ } else {
+ // complex case.
+ // we have enough to cover it, but it spans past the first buffer.
+ if (stringMode)
+ ret = '';
+ else
+ ret = new Buffer(n);
+
+ var c = 0;
+ for (var i = 0, l = list.length; i < l && c < n; i++) {
+ var buf = list[0];
+ var cpy = Math.min(n - c, buf.length);
+
+ if (stringMode)
+ ret += buf.slice(0, cpy);
+ else
+ buf.copy(ret, c, 0, cpy);
+
+ if (cpy < buf.length)
+ list[0] = buf.slice(cpy);
+ else
+ list.shift();
+
+ c += cpy;
+ }
+ }
+ }
+
+ return ret;
+}
+
+function endReadable(stream) {
+ var state = stream._readableState;
+
+ // If we get here before consuming all the bytes, then that is a
+ // bug in node. Should never happen.
+ if (state.length > 0)
+ throw new Error('endReadable called on non-empty stream');
+
+ if (!state.endEmitted) {
+ state.ended = true;
+ processNextTick(endReadableNT, state, stream);
+ }
+}
+
+function endReadableNT(state, stream) {
+ // Check that we didn't get one last unshift.
+ if (!state.endEmitted && state.length === 0) {
+ state.endEmitted = true;
+ stream.readable = false;
+ stream.emit('end');
+ }
+}
+
+function forEach (xs, f) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ f(xs[i], i);
+ }
+}
+
+function indexOf (xs, x) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ if (xs[i] === x) return i;
+ }
+ return -1;
+}
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js
new file mode 100644
index 000000000..3675d18d9
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js
@@ -0,0 +1,197 @@
+// a transform stream is a readable/writable stream where you do
+// something with the data. Sometimes it's called a "filter",
+// but that's not a great name for it, since that implies a thing where
+// some bits pass through, and others are simply ignored. (That would
+// be a valid example of a transform, of course.)
+//
+// While the output is causally related to the input, it's not a
+// necessarily symmetric or synchronous transformation. For example,
+// a zlib stream might take multiple plain-text writes(), and then
+// emit a single compressed chunk some time in the future.
+//
+// Here's how this works:
+//
+// The Transform stream has all the aspects of the readable and writable
+// stream classes. When you write(chunk), that calls _write(chunk,cb)
+// internally, and returns false if there's a lot of pending writes
+// buffered up. When you call read(), that calls _read(n) until
+// there's enough pending readable data buffered up.
+//
+// In a transform stream, the written data is placed in a buffer. When
+// _read(n) is called, it transforms the queued up data, calling the
+// buffered _write cb's as it consumes chunks. If consuming a single
+// written chunk would result in multiple output chunks, then the first
+// outputted bit calls the readcb, and subsequent chunks just go into
+// the read buffer, and will cause it to emit 'readable' if necessary.
+//
+// This way, back-pressure is actually determined by the reading side,
+// since _read has to be called to start processing a new chunk. However,
+// a pathological inflate type of transform can cause excessive buffering
+// here. For example, imagine a stream where every byte of input is
+// interpreted as an integer from 0-255, and then results in that many
+// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
+// 1kb of data being output. In this case, you could write a very small
+// amount of input, and end up with a very large amount of output. In
+// such a pathological inflating mechanism, there'd be no way to tell
+// the system to stop doing the transform. A single 4MB write could
+// cause the system to run out of memory.
+//
+// However, even in such a pathological case, only a single written chunk
+// would be consumed, and then the rest would wait (un-transformed) until
+// the results of the previous transformed chunk were consumed.
+
+'use strict';
+
+module.exports = Transform;
+
+var Duplex = require('./_stream_duplex');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+util.inherits(Transform, Duplex);
+
+
+function TransformState(stream) {
+ this.afterTransform = function(er, data) {
+ return afterTransform(stream, er, data);
+ };
+
+ this.needTransform = false;
+ this.transforming = false;
+ this.writecb = null;
+ this.writechunk = null;
+}
+
+function afterTransform(stream, er, data) {
+ var ts = stream._transformState;
+ ts.transforming = false;
+
+ var cb = ts.writecb;
+
+ if (!cb)
+ return stream.emit('error', new Error('no writecb in Transform class'));
+
+ ts.writechunk = null;
+ ts.writecb = null;
+
+ if (data !== null && data !== undefined)
+ stream.push(data);
+
+ if (cb)
+ cb(er);
+
+ var rs = stream._readableState;
+ rs.reading = false;
+ if (rs.needReadable || rs.length < rs.highWaterMark) {
+ stream._read(rs.highWaterMark);
+ }
+}
+
+
+function Transform(options) {
+ if (!(this instanceof Transform))
+ return new Transform(options);
+
+ Duplex.call(this, options);
+
+ this._transformState = new TransformState(this);
+
+ // when the writable side finishes, then flush out anything remaining.
+ var stream = this;
+
+ // start out asking for a readable event once data is transformed.
+ this._readableState.needReadable = true;
+
+ // we have implemented the _read method, and done the other things
+ // that Readable wants before the first _read call, so unset the
+ // sync guard flag.
+ this._readableState.sync = false;
+
+ if (options) {
+ if (typeof options.transform === 'function')
+ this._transform = options.transform;
+
+ if (typeof options.flush === 'function')
+ this._flush = options.flush;
+ }
+
+ this.once('prefinish', function() {
+ if (typeof this._flush === 'function')
+ this._flush(function(er) {
+ done(stream, er);
+ });
+ else
+ done(stream);
+ });
+}
+
+Transform.prototype.push = function(chunk, encoding) {
+ this._transformState.needTransform = false;
+ return Duplex.prototype.push.call(this, chunk, encoding);
+};
+
+// This is the part where you do stuff!
+// override this function in implementation classes.
+// 'chunk' is an input chunk.
+//
+// Call `push(newChunk)` to pass along transformed output
+// to the readable side. You may call 'push' zero or more times.
+//
+// Call `cb(err)` when you are done with this chunk. If you pass
+// an error, then that'll put the hurt on the whole operation. If you
+// never call cb(), then you'll never get another chunk.
+Transform.prototype._transform = function(chunk, encoding, cb) {
+ throw new Error('not implemented');
+};
+
+Transform.prototype._write = function(chunk, encoding, cb) {
+ var ts = this._transformState;
+ ts.writecb = cb;
+ ts.writechunk = chunk;
+ ts.writeencoding = encoding;
+ if (!ts.transforming) {
+ var rs = this._readableState;
+ if (ts.needTransform ||
+ rs.needReadable ||
+ rs.length < rs.highWaterMark)
+ this._read(rs.highWaterMark);
+ }
+};
+
+// Doesn't matter what the args are here.
+// _transform does all the work.
+// That we got here means that the readable side wants more data.
+Transform.prototype._read = function(n) {
+ var ts = this._transformState;
+
+ if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
+ ts.transforming = true;
+ this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
+ } else {
+ // mark that we need a transform, so that any data that comes in
+ // will get processed, now that we've asked for it.
+ ts.needTransform = true;
+ }
+};
+
+
+function done(stream, er) {
+ if (er)
+ return stream.emit('error', er);
+
+ // if there's nothing in the write buffer, then that means
+ // that nothing more will ever be provided
+ var ws = stream._writableState;
+ var ts = stream._transformState;
+
+ if (ws.length)
+ throw new Error('calling transform done when ws.length != 0');
+
+ if (ts.transforming)
+ throw new Error('calling transform done when still transforming');
+
+ return stream.push(null);
+}
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
new file mode 100644
index 000000000..b23295201
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
@@ -0,0 +1,520 @@
+// A bit simpler than readable streams.
+// Implement an async ._write(chunk, cb), and it'll handle all
+// the drain event emission and buffering.
+
+'use strict';
+
+module.exports = Writable;
+
+/*<replacement>*/
+var processNextTick = require('process-nextick-args');
+/*</replacement>*/
+
+
+/*<replacement>*/
+var Buffer = require('buffer').Buffer;
+/*</replacement>*/
+
+Writable.WritableState = WritableState;
+
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+
+
+/*<replacement>*/
+var Stream;
+(function (){try{
+ Stream = require('st' + 'ream');
+}catch(_){}finally{
+ if (!Stream)
+ Stream = require('events').EventEmitter;
+}}())
+/*</replacement>*/
+
+var Buffer = require('buffer').Buffer;
+
+util.inherits(Writable, Stream);
+
+function nop() {}
+
+function WriteReq(chunk, encoding, cb) {
+ this.chunk = chunk;
+ this.encoding = encoding;
+ this.callback = cb;
+ this.next = null;
+}
+
+function WritableState(options, stream) {
+ var Duplex = require('./_stream_duplex');
+
+ options = options || {};
+
+ // object stream flag to indicate whether or not this stream
+ // contains buffers or objects.
+ this.objectMode = !!options.objectMode;
+
+ if (stream instanceof Duplex)
+ this.objectMode = this.objectMode || !!options.writableObjectMode;
+
+ // the point at which write() starts returning false
+ // Note: 0 is a valid value, means that we always return false if
+ // the entire buffer is not flushed immediately on write()
+ var hwm = options.highWaterMark;
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+ this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
+
+ // cast to ints.
+ this.highWaterMark = ~~this.highWaterMark;
+
+ this.needDrain = false;
+ // at the start of calling end()
+ this.ending = false;
+ // when end() has been called, and returned
+ this.ended = false;
+ // when 'finish' is emitted
+ this.finished = false;
+
+ // should we decode strings into buffers before passing to _write?
+ // this is here so that some node-core streams can optimize string
+ // handling at a lower level.
+ var noDecode = options.decodeStrings === false;
+ this.decodeStrings = !noDecode;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // not an actual buffer we keep track of, but a measurement
+ // of how much we're waiting to get pushed to some underlying
+ // socket or file.
+ this.length = 0;
+
+ // a flag to see when we're in the middle of a write.
+ this.writing = false;
+
+ // when true all writes will be buffered until .uncork() call
+ this.corked = 0;
+
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, because any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
+ this.sync = true;
+
+ // a flag to know if we're processing previously buffered items, which
+ // may call the _write() callback in the same tick, so that we don't
+ // end up in an overlapped onwrite situation.
+ this.bufferProcessing = false;
+
+ // the callback that's passed to _write(chunk,cb)
+ this.onwrite = function(er) {
+ onwrite(stream, er);
+ };
+
+ // the callback that the user supplies to write(chunk,encoding,cb)
+ this.writecb = null;
+
+ // the amount that is being written when _write is called.
+ this.writelen = 0;
+
+ this.bufferedRequest = null;
+ this.lastBufferedRequest = null;
+
+ // number of pending user-supplied write callbacks
+ // this must be 0 before 'finish' can be emitted
+ this.pendingcb = 0;
+
+ // emit prefinish if the only thing we're waiting for is _write cbs
+ // This is relevant for synchronous Transform streams
+ this.prefinished = false;
+
+ // True if the error was already emitted and should not be thrown again
+ this.errorEmitted = false;
+}
+
+WritableState.prototype.getBuffer = function writableStateGetBuffer() {
+ var current = this.bufferedRequest;
+ var out = [];
+ while (current) {
+ out.push(current);
+ current = current.next;
+ }
+ return out;
+};
+
+(function (){try {
+Object.defineProperty(WritableState.prototype, 'buffer', {
+ get: require('util-deprecate')(function() {
+ return this.getBuffer();
+ }, '_writableState.buffer is deprecated. Use ' +
+ '_writableState.getBuffer() instead.')
+});
+}catch(_){}}());
+
+
+function Writable(options) {
+ var Duplex = require('./_stream_duplex');
+
+ // Writable ctor is applied to Duplexes, though they're not
+ // instanceof Writable, they're instanceof Readable.
+ if (!(this instanceof Writable) && !(this instanceof Duplex))
+ return new Writable(options);
+
+ this._writableState = new WritableState(options, this);
+
+ // legacy.
+ this.writable = true;
+
+ if (options) {
+ if (typeof options.write === 'function')
+ this._write = options.write;
+
+ if (typeof options.writev === 'function')
+ this._writev = options.writev;
+ }
+
+ Stream.call(this);
+}
+
+// Otherwise people can pipe Writable streams, which is just wrong.
+Writable.prototype.pipe = function() {
+ this.emit('error', new Error('Cannot pipe. Not readable.'));
+};
+
+
+function writeAfterEnd(stream, cb) {
+ var er = new Error('write after end');
+ // TODO: defer error events consistently everywhere, not just the cb
+ stream.emit('error', er);
+ processNextTick(cb, er);
+}
+
+// If we get something that is not a buffer, string, null, or undefined,
+// and we're not in objectMode, then that's an error.
+// Otherwise stream chunks are all considered to be of length=1, and the
+// watermarks determine how many objects to keep in the buffer, rather than
+// how many bytes or characters.
+function validChunk(stream, state, chunk, cb) {
+ var valid = true;
+
+ if (!(Buffer.isBuffer(chunk)) &&
+ typeof chunk !== 'string' &&
+ chunk !== null &&
+ chunk !== undefined &&
+ !state.objectMode) {
+ var er = new TypeError('Invalid non-string/buffer chunk');
+ stream.emit('error', er);
+ processNextTick(cb, er);
+ valid = false;
+ }
+ return valid;
+}
+
+Writable.prototype.write = function(chunk, encoding, cb) {
+ var state = this._writableState;
+ var ret = false;
+
+ if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (Buffer.isBuffer(chunk))
+ encoding = 'buffer';
+ else if (!encoding)
+ encoding = state.defaultEncoding;
+
+ if (typeof cb !== 'function')
+ cb = nop;
+
+ if (state.ended)
+ writeAfterEnd(this, cb);
+ else if (validChunk(this, state, chunk, cb)) {
+ state.pendingcb++;
+ ret = writeOrBuffer(this, state, chunk, encoding, cb);
+ }
+
+ return ret;
+};
+
+Writable.prototype.cork = function() {
+ var state = this._writableState;
+
+ state.corked++;
+};
+
+Writable.prototype.uncork = function() {
+ var state = this._writableState;
+
+ if (state.corked) {
+ state.corked--;
+
+ if (!state.writing &&
+ !state.corked &&
+ !state.finished &&
+ !state.bufferProcessing &&
+ state.bufferedRequest)
+ clearBuffer(this, state);
+ }
+};
+
+Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
+ // node::ParseEncoding() requires lower case.
+ if (typeof encoding === 'string')
+ encoding = encoding.toLowerCase();
+ if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64',
+'ucs2', 'ucs-2','utf16le', 'utf-16le', 'raw']
+.indexOf((encoding + '').toLowerCase()) > -1))
+ throw new TypeError('Unknown encoding: ' + encoding);
+ this._writableState.defaultEncoding = encoding;
+};
+
+function decodeChunk(state, chunk, encoding) {
+ if (!state.objectMode &&
+ state.decodeStrings !== false &&
+ typeof chunk === 'string') {
+ chunk = new Buffer(chunk, encoding);
+ }
+ return chunk;
+}
+
+// if we're already writing something, then just put this
+// in the queue, and wait our turn. Otherwise, call _write
+// If we return false, then we need a drain event, so set that flag.
+function writeOrBuffer(stream, state, chunk, encoding, cb) {
+ chunk = decodeChunk(state, chunk, encoding);
+
+ if (Buffer.isBuffer(chunk))
+ encoding = 'buffer';
+ var len = state.objectMode ? 1 : chunk.length;
+
+ state.length += len;
+
+ var ret = state.length < state.highWaterMark;
+ // we must ensure that previous needDrain will not be reset to false.
+ if (!ret)
+ state.needDrain = true;
+
+ if (state.writing || state.corked) {
+ var last = state.lastBufferedRequest;
+ state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
+ if (last) {
+ last.next = state.lastBufferedRequest;
+ } else {
+ state.bufferedRequest = state.lastBufferedRequest;
+ }
+ } else {
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+ }
+
+ return ret;
+}
+
+function doWrite(stream, state, writev, len, chunk, encoding, cb) {
+ state.writelen = len;
+ state.writecb = cb;
+ state.writing = true;
+ state.sync = true;
+ if (writev)
+ stream._writev(chunk, state.onwrite);
+ else
+ stream._write(chunk, encoding, state.onwrite);
+ state.sync = false;
+}
+
+function onwriteError(stream, state, sync, er, cb) {
+ --state.pendingcb;
+ if (sync)
+ processNextTick(cb, er);
+ else
+ cb(er);
+
+ stream._writableState.errorEmitted = true;
+ stream.emit('error', er);
+}
+
+function onwriteStateUpdate(state) {
+ state.writing = false;
+ state.writecb = null;
+ state.length -= state.writelen;
+ state.writelen = 0;
+}
+
+function onwrite(stream, er) {
+ var state = stream._writableState;
+ var sync = state.sync;
+ var cb = state.writecb;
+
+ onwriteStateUpdate(state);
+
+ if (er)
+ onwriteError(stream, state, sync, er, cb);
+ else {
+ // Check if we're actually ready to finish, but don't emit yet
+ var finished = needFinish(state);
+
+ if (!finished &&
+ !state.corked &&
+ !state.bufferProcessing &&
+ state.bufferedRequest) {
+ clearBuffer(stream, state);
+ }
+
+ if (sync) {
+ processNextTick(afterWrite, stream, state, finished, cb);
+ } else {
+ afterWrite(stream, state, finished, cb);
+ }
+ }
+}
+
+function afterWrite(stream, state, finished, cb) {
+ if (!finished)
+ onwriteDrain(stream, state);
+ state.pendingcb--;
+ cb();
+ finishMaybe(stream, state);
+}
+
+// Must force callback to be called on nextTick, so that we don't
+// emit 'drain' before the write() consumer gets the 'false' return
+// value, and has a chance to attach a 'drain' listener.
+function onwriteDrain(stream, state) {
+ if (state.length === 0 && state.needDrain) {
+ state.needDrain = false;
+ stream.emit('drain');
+ }
+}
+
+
+// if there's something in the buffer waiting, then process it
+function clearBuffer(stream, state) {
+ state.bufferProcessing = true;
+ var entry = state.bufferedRequest;
+
+ if (stream._writev && entry && entry.next) {
+ // Fast case, write everything using _writev()
+ var buffer = [];
+ var cbs = [];
+ while (entry) {
+ cbs.push(entry.callback);
+ buffer.push(entry);
+ entry = entry.next;
+ }
+
+ // count the one we are adding, as well.
+ // TODO(isaacs) clean this up
+ state.pendingcb++;
+ state.lastBufferedRequest = null;
+ doWrite(stream, state, true, state.length, buffer, '', function(err) {
+ for (var i = 0; i < cbs.length; i++) {
+ state.pendingcb--;
+ cbs[i](err);
+ }
+ });
+
+ // Clear buffer
+ } else {
+ // Slow case, write chunks one-by-one
+ while (entry) {
+ var chunk = entry.chunk;
+ var encoding = entry.encoding;
+ var cb = entry.callback;
+ var len = state.objectMode ? 1 : chunk.length;
+
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+ entry = entry.next;
+ // if we didn't call the onwrite immediately, then
+ // it means that we need to wait until it does.
+ // also, that means that the chunk and cb are currently
+ // being processed, so move the buffer counter past them.
+ if (state.writing) {
+ break;
+ }
+ }
+
+ if (entry === null)
+ state.lastBufferedRequest = null;
+ }
+ state.bufferedRequest = entry;
+ state.bufferProcessing = false;
+}
+
+Writable.prototype._write = function(chunk, encoding, cb) {
+ cb(new Error('not implemented'));
+};
+
+Writable.prototype._writev = null;
+
+Writable.prototype.end = function(chunk, encoding, cb) {
+ var state = this._writableState;
+
+ if (typeof chunk === 'function') {
+ cb = chunk;
+ chunk = null;
+ encoding = null;
+ } else if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (chunk !== null && chunk !== undefined)
+ this.write(chunk, encoding);
+
+ // .end() fully uncorks
+ if (state.corked) {
+ state.corked = 1;
+ this.uncork();
+ }
+
+ // ignore unnecessary end() calls.
+ if (!state.ending && !state.finished)
+ endWritable(this, state, cb);
+};
+
+
+function needFinish(state) {
+ return (state.ending &&
+ state.length === 0 &&
+ state.bufferedRequest === null &&
+ !state.finished &&
+ !state.writing);
+}
+
+function prefinish(stream, state) {
+ if (!state.prefinished) {
+ state.prefinished = true;
+ stream.emit('prefinish');
+ }
+}
+
+function finishMaybe(stream, state) {
+ var need = needFinish(state);
+ if (need) {
+ if (state.pendingcb === 0) {
+ prefinish(stream, state);
+ state.finished = true;
+ stream.emit('finish');
+ } else {
+ prefinish(stream, state);
+ }
+ }
+ return need;
+}
+
+function endWritable(stream, state, cb) {
+ state.ending = true;
+ finishMaybe(stream, state);
+ if (cb) {
+ if (state.finished)
+ processNextTick(cb);
+ else
+ stream.once('finish', cb);
+ }
+ state.ended = true;
+}
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md
new file mode 100644
index 000000000..5a76b4149
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md
@@ -0,0 +1,3 @@
+# core-util-is
+
+The `util.is*` functions introduced in Node v0.12.
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch
new file mode 100644
index 000000000..a06d5c05f
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch
@@ -0,0 +1,604 @@
+diff --git a/lib/util.js b/lib/util.js
+index a03e874..9074e8e 100644
+--- a/lib/util.js
++++ b/lib/util.js
+@@ -19,430 +19,6 @@
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+-var formatRegExp = /%[sdj%]/g;
+-exports.format = function(f) {
+- if (!isString(f)) {
+- var objects = [];
+- for (var i = 0; i < arguments.length; i++) {
+- objects.push(inspect(arguments[i]));
+- }
+- return objects.join(' ');
+- }
+-
+- var i = 1;
+- var args = arguments;
+- var len = args.length;
+- var str = String(f).replace(formatRegExp, function(x) {
+- if (x === '%%') return '%';
+- if (i >= len) return x;
+- switch (x) {
+- case '%s': return String(args[i++]);
+- case '%d': return Number(args[i++]);
+- case '%j':
+- try {
+- return JSON.stringify(args[i++]);
+- } catch (_) {
+- return '[Circular]';
+- }
+- default:
+- return x;
+- }
+- });
+- for (var x = args[i]; i < len; x = args[++i]) {
+- if (isNull(x) || !isObject(x)) {
+- str += ' ' + x;
+- } else {
+- str += ' ' + inspect(x);
+- }
+- }
+- return str;
+-};
+-
+-
+-// Mark that a method should not be used.
+-// Returns a modified function which warns once by default.
+-// If --no-deprecation is set, then it is a no-op.
+-exports.deprecate = function(fn, msg) {
+- // Allow for deprecating things in the process of starting up.
+- if (isUndefined(global.process)) {
+- return function() {
+- return exports.deprecate(fn, msg).apply(this, arguments);
+- };
+- }
+-
+- if (process.noDeprecation === true) {
+- return fn;
+- }
+-
+- var warned = false;
+- function deprecated() {
+- if (!warned) {
+- if (process.throwDeprecation) {
+- throw new Error(msg);
+- } else if (process.traceDeprecation) {
+- console.trace(msg);
+- } else {
+- console.error(msg);
+- }
+- warned = true;
+- }
+- return fn.apply(this, arguments);
+- }
+-
+- return deprecated;
+-};
+-
+-
+-var debugs = {};
+-var debugEnviron;
+-exports.debuglog = function(set) {
+- if (isUndefined(debugEnviron))
+- debugEnviron = process.env.NODE_DEBUG || '';
+- set = set.toUpperCase();
+- if (!debugs[set]) {
+- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
+- var pid = process.pid;
+- debugs[set] = function() {
+- var msg = exports.format.apply(exports, arguments);
+- console.error('%s %d: %s', set, pid, msg);
+- };
+- } else {
+- debugs[set] = function() {};
+- }
+- }
+- return debugs[set];
+-};
+-
+-
+-/**
+- * Echos the value of a value. Trys to print the value out
+- * in the best way possible given the different types.
+- *
+- * @param {Object} obj The object to print out.
+- * @param {Object} opts Optional options object that alters the output.
+- */
+-/* legacy: obj, showHidden, depth, colors*/
+-function inspect(obj, opts) {
+- // default options
+- var ctx = {
+- seen: [],
+- stylize: stylizeNoColor
+- };
+- // legacy...
+- if (arguments.length >= 3) ctx.depth = arguments[2];
+- if (arguments.length >= 4) ctx.colors = arguments[3];
+- if (isBoolean(opts)) {
+- // legacy...
+- ctx.showHidden = opts;
+- } else if (opts) {
+- // got an "options" object
+- exports._extend(ctx, opts);
+- }
+- // set default options
+- if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
+- if (isUndefined(ctx.depth)) ctx.depth = 2;
+- if (isUndefined(ctx.colors)) ctx.colors = false;
+- if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
+- if (ctx.colors) ctx.stylize = stylizeWithColor;
+- return formatValue(ctx, obj, ctx.depth);
+-}
+-exports.inspect = inspect;
+-
+-
+-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
+-inspect.colors = {
+- 'bold' : [1, 22],
+- 'italic' : [3, 23],
+- 'underline' : [4, 24],
+- 'inverse' : [7, 27],
+- 'white' : [37, 39],
+- 'grey' : [90, 39],
+- 'black' : [30, 39],
+- 'blue' : [34, 39],
+- 'cyan' : [36, 39],
+- 'green' : [32, 39],
+- 'magenta' : [35, 39],
+- 'red' : [31, 39],
+- 'yellow' : [33, 39]
+-};
+-
+-// Don't use 'blue' not visible on cmd.exe
+-inspect.styles = {
+- 'special': 'cyan',
+- 'number': 'yellow',
+- 'boolean': 'yellow',
+- 'undefined': 'grey',
+- 'null': 'bold',
+- 'string': 'green',
+- 'date': 'magenta',
+- // "name": intentionally not styling
+- 'regexp': 'red'
+-};
+-
+-
+-function stylizeWithColor(str, styleType) {
+- var style = inspect.styles[styleType];
+-
+- if (style) {
+- return '\u001b[' + inspect.colors[style][0] + 'm' + str +
+- '\u001b[' + inspect.colors[style][1] + 'm';
+- } else {
+- return str;
+- }
+-}
+-
+-
+-function stylizeNoColor(str, styleType) {
+- return str;
+-}
+-
+-
+-function arrayToHash(array) {
+- var hash = {};
+-
+- array.forEach(function(val, idx) {
+- hash[val] = true;
+- });
+-
+- return hash;
+-}
+-
+-
+-function formatValue(ctx, value, recurseTimes) {
+- // Provide a hook for user-specified inspect functions.
+- // Check that value is an object with an inspect function on it
+- if (ctx.customInspect &&
+- value &&
+- isFunction(value.inspect) &&
+- // Filter out the util module, it's inspect function is special
+- value.inspect !== exports.inspect &&
+- // Also filter out any prototype objects using the circular check.
+- !(value.constructor && value.constructor.prototype === value)) {
+- var ret = value.inspect(recurseTimes, ctx);
+- if (!isString(ret)) {
+- ret = formatValue(ctx, ret, recurseTimes);
+- }
+- return ret;
+- }
+-
+- // Primitive types cannot have properties
+- var primitive = formatPrimitive(ctx, value);
+- if (primitive) {
+- return primitive;
+- }
+-
+- // Look up the keys of the object.
+- var keys = Object.keys(value);
+- var visibleKeys = arrayToHash(keys);
+-
+- if (ctx.showHidden) {
+- keys = Object.getOwnPropertyNames(value);
+- }
+-
+- // Some type of object without properties can be shortcutted.
+- if (keys.length === 0) {
+- if (isFunction(value)) {
+- var name = value.name ? ': ' + value.name : '';
+- return ctx.stylize('[Function' + name + ']', 'special');
+- }
+- if (isRegExp(value)) {
+- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
+- }
+- if (isDate(value)) {
+- return ctx.stylize(Date.prototype.toString.call(value), 'date');
+- }
+- if (isError(value)) {
+- return formatError(value);
+- }
+- }
+-
+- var base = '', array = false, braces = ['{', '}'];
+-
+- // Make Array say that they are Array
+- if (isArray(value)) {
+- array = true;
+- braces = ['[', ']'];
+- }
+-
+- // Make functions say that they are functions
+- if (isFunction(value)) {
+- var n = value.name ? ': ' + value.name : '';
+- base = ' [Function' + n + ']';
+- }
+-
+- // Make RegExps say that they are RegExps
+- if (isRegExp(value)) {
+- base = ' ' + RegExp.prototype.toString.call(value);
+- }
+-
+- // Make dates with properties first say the date
+- if (isDate(value)) {
+- base = ' ' + Date.prototype.toUTCString.call(value);
+- }
+-
+- // Make error with message first say the error
+- if (isError(value)) {
+- base = ' ' + formatError(value);
+- }
+-
+- if (keys.length === 0 && (!array || value.length == 0)) {
+- return braces[0] + base + braces[1];
+- }
+-
+- if (recurseTimes < 0) {
+- if (isRegExp(value)) {
+- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
+- } else {
+- return ctx.stylize('[Object]', 'special');
+- }
+- }
+-
+- ctx.seen.push(value);
+-
+- var output;
+- if (array) {
+- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
+- } else {
+- output = keys.map(function(key) {
+- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
+- });
+- }
+-
+- ctx.seen.pop();
+-
+- return reduceToSingleString(output, base, braces);
+-}
+-
+-
+-function formatPrimitive(ctx, value) {
+- if (isUndefined(value))
+- return ctx.stylize('undefined', 'undefined');
+- if (isString(value)) {
+- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
+- .replace(/'/g, "\\'")
+- .replace(/\\"/g, '"') + '\'';
+- return ctx.stylize(simple, 'string');
+- }
+- if (isNumber(value)) {
+- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0,
+- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 .
+- if (value === 0 && 1 / value < 0)
+- return ctx.stylize('-0', 'number');
+- return ctx.stylize('' + value, 'number');
+- }
+- if (isBoolean(value))
+- return ctx.stylize('' + value, 'boolean');
+- // For some reason typeof null is "object", so special case here.
+- if (isNull(value))
+- return ctx.stylize('null', 'null');
+-}
+-
+-
+-function formatError(value) {
+- return '[' + Error.prototype.toString.call(value) + ']';
+-}
+-
+-
+-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
+- var output = [];
+- for (var i = 0, l = value.length; i < l; ++i) {
+- if (hasOwnProperty(value, String(i))) {
+- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
+- String(i), true));
+- } else {
+- output.push('');
+- }
+- }
+- keys.forEach(function(key) {
+- if (!key.match(/^\d+$/)) {
+- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
+- key, true));
+- }
+- });
+- return output;
+-}
+-
+-
+-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
+- var name, str, desc;
+- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
+- if (desc.get) {
+- if (desc.set) {
+- str = ctx.stylize('[Getter/Setter]', 'special');
+- } else {
+- str = ctx.stylize('[Getter]', 'special');
+- }
+- } else {
+- if (desc.set) {
+- str = ctx.stylize('[Setter]', 'special');
+- }
+- }
+- if (!hasOwnProperty(visibleKeys, key)) {
+- name = '[' + key + ']';
+- }
+- if (!str) {
+- if (ctx.seen.indexOf(desc.value) < 0) {
+- if (isNull(recurseTimes)) {
+- str = formatValue(ctx, desc.value, null);
+- } else {
+- str = formatValue(ctx, desc.value, recurseTimes - 1);
+- }
+- if (str.indexOf('\n') > -1) {
+- if (array) {
+- str = str.split('\n').map(function(line) {
+- return ' ' + line;
+- }).join('\n').substr(2);
+- } else {
+- str = '\n' + str.split('\n').map(function(line) {
+- return ' ' + line;
+- }).join('\n');
+- }
+- }
+- } else {
+- str = ctx.stylize('[Circular]', 'special');
+- }
+- }
+- if (isUndefined(name)) {
+- if (array && key.match(/^\d+$/)) {
+- return str;
+- }
+- name = JSON.stringify('' + key);
+- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
+- name = name.substr(1, name.length - 2);
+- name = ctx.stylize(name, 'name');
+- } else {
+- name = name.replace(/'/g, "\\'")
+- .replace(/\\"/g, '"')
+- .replace(/(^"|"$)/g, "'");
+- name = ctx.stylize(name, 'string');
+- }
+- }
+-
+- return name + ': ' + str;
+-}
+-
+-
+-function reduceToSingleString(output, base, braces) {
+- var numLinesEst = 0;
+- var length = output.reduce(function(prev, cur) {
+- numLinesEst++;
+- if (cur.indexOf('\n') >= 0) numLinesEst++;
+- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
+- }, 0);
+-
+- if (length > 60) {
+- return braces[0] +
+- (base === '' ? '' : base + '\n ') +
+- ' ' +
+- output.join(',\n ') +
+- ' ' +
+- braces[1];
+- }
+-
+- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
+-}
+-
+-
+ // NOTE: These type checking functions intentionally don't use `instanceof`
+ // because it is fragile and can be easily faked with `Object.create()`.
+ function isArray(ar) {
+@@ -522,166 +98,10 @@ function isPrimitive(arg) {
+ exports.isPrimitive = isPrimitive;
+
+ function isBuffer(arg) {
+- return arg instanceof Buffer;
++ return Buffer.isBuffer(arg);
+ }
+ exports.isBuffer = isBuffer;
+
+ function objectToString(o) {
+ return Object.prototype.toString.call(o);
+-}
+-
+-
+-function pad(n) {
+- return n < 10 ? '0' + n.toString(10) : n.toString(10);
+-}
+-
+-
+-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
+- 'Oct', 'Nov', 'Dec'];
+-
+-// 26 Feb 16:19:34
+-function timestamp() {
+- var d = new Date();
+- var time = [pad(d.getHours()),
+- pad(d.getMinutes()),
+- pad(d.getSeconds())].join(':');
+- return [d.getDate(), months[d.getMonth()], time].join(' ');
+-}
+-
+-
+-// log is just a thin wrapper to console.log that prepends a timestamp
+-exports.log = function() {
+- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
+-};
+-
+-
+-/**
+- * Inherit the prototype methods from one constructor into another.
+- *
+- * The Function.prototype.inherits from lang.js rewritten as a standalone
+- * function (not on Function.prototype). NOTE: If this file is to be loaded
+- * during bootstrapping this function needs to be rewritten using some native
+- * functions as prototype setup using normal JavaScript does not work as
+- * expected during bootstrapping (see mirror.js in r114903).
+- *
+- * @param {function} ctor Constructor function which needs to inherit the
+- * prototype.
+- * @param {function} superCtor Constructor function to inherit prototype from.
+- */
+-exports.inherits = function(ctor, superCtor) {
+- ctor.super_ = superCtor;
+- ctor.prototype = Object.create(superCtor.prototype, {
+- constructor: {
+- value: ctor,
+- enumerable: false,
+- writable: true,
+- configurable: true
+- }
+- });
+-};
+-
+-exports._extend = function(origin, add) {
+- // Don't do anything if add isn't an object
+- if (!add || !isObject(add)) return origin;
+-
+- var keys = Object.keys(add);
+- var i = keys.length;
+- while (i--) {
+- origin[keys[i]] = add[keys[i]];
+- }
+- return origin;
+-};
+-
+-function hasOwnProperty(obj, prop) {
+- return Object.prototype.hasOwnProperty.call(obj, prop);
+-}
+-
+-
+-// Deprecated old stuff.
+-
+-exports.p = exports.deprecate(function() {
+- for (var i = 0, len = arguments.length; i < len; ++i) {
+- console.error(exports.inspect(arguments[i]));
+- }
+-}, 'util.p: Use console.error() instead');
+-
+-
+-exports.exec = exports.deprecate(function() {
+- return require('child_process').exec.apply(this, arguments);
+-}, 'util.exec is now called `child_process.exec`.');
+-
+-
+-exports.print = exports.deprecate(function() {
+- for (var i = 0, len = arguments.length; i < len; ++i) {
+- process.stdout.write(String(arguments[i]));
+- }
+-}, 'util.print: Use console.log instead');
+-
+-
+-exports.puts = exports.deprecate(function() {
+- for (var i = 0, len = arguments.length; i < len; ++i) {
+- process.stdout.write(arguments[i] + '\n');
+- }
+-}, 'util.puts: Use console.log instead');
+-
+-
+-exports.debug = exports.deprecate(function(x) {
+- process.stderr.write('DEBUG: ' + x + '\n');
+-}, 'util.debug: Use console.error instead');
+-
+-
+-exports.error = exports.deprecate(function(x) {
+- for (var i = 0, len = arguments.length; i < len; ++i) {
+- process.stderr.write(arguments[i] + '\n');
+- }
+-}, 'util.error: Use console.error instead');
+-
+-
+-exports.pump = exports.deprecate(function(readStream, writeStream, callback) {
+- var callbackCalled = false;
+-
+- function call(a, b, c) {
+- if (callback && !callbackCalled) {
+- callback(a, b, c);
+- callbackCalled = true;
+- }
+- }
+-
+- readStream.addListener('data', function(chunk) {
+- if (writeStream.write(chunk) === false) readStream.pause();
+- });
+-
+- writeStream.addListener('drain', function() {
+- readStream.resume();
+- });
+-
+- readStream.addListener('end', function() {
+- writeStream.end();
+- });
+-
+- readStream.addListener('close', function() {
+- call();
+- });
+-
+- readStream.addListener('error', function(err) {
+- writeStream.end();
+- call(err);
+- });
+-
+- writeStream.addListener('error', function(err) {
+- readStream.destroy();
+- call(err);
+- });
+-}, 'util.pump(): Use readableStream.pipe() instead');
+-
+-
+-var uv;
+-exports._errnoException = function(err, syscall) {
+- if (isUndefined(uv)) uv = process.binding('uv');
+- var errname = uv.errname(err);
+- var e = new Error(syscall + ' ' + errname);
+- e.code = errname;
+- e.errno = errname;
+- e.syscall = syscall;
+- return e;
+-};
++} \ No newline at end of file
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
new file mode 100644
index 000000000..9074e8ebc
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
@@ -0,0 +1,107 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// NOTE: These type checking functions intentionally don't use `instanceof`
+// because it is fragile and can be easily faked with `Object.create()`.
+function isArray(ar) {
+ return Array.isArray(ar);
+}
+exports.isArray = isArray;
+
+function isBoolean(arg) {
+ return typeof arg === 'boolean';
+}
+exports.isBoolean = isBoolean;
+
+function isNull(arg) {
+ return arg === null;
+}
+exports.isNull = isNull;
+
+function isNullOrUndefined(arg) {
+ return arg == null;
+}
+exports.isNullOrUndefined = isNullOrUndefined;
+
+function isNumber(arg) {
+ return typeof arg === 'number';
+}
+exports.isNumber = isNumber;
+
+function isString(arg) {
+ return typeof arg === 'string';
+}
+exports.isString = isString;
+
+function isSymbol(arg) {
+ return typeof arg === 'symbol';
+}
+exports.isSymbol = isSymbol;
+
+function isUndefined(arg) {
+ return arg === void 0;
+}
+exports.isUndefined = isUndefined;
+
+function isRegExp(re) {
+ return isObject(re) && objectToString(re) === '[object RegExp]';
+}
+exports.isRegExp = isRegExp;
+
+function isObject(arg) {
+ return typeof arg === 'object' && arg !== null;
+}
+exports.isObject = isObject;
+
+function isDate(d) {
+ return isObject(d) && objectToString(d) === '[object Date]';
+}
+exports.isDate = isDate;
+
+function isError(e) {
+ return isObject(e) &&
+ (objectToString(e) === '[object Error]' || e instanceof Error);
+}
+exports.isError = isError;
+
+function isFunction(arg) {
+ return typeof arg === 'function';
+}
+exports.isFunction = isFunction;
+
+function isPrimitive(arg) {
+ return arg === null ||
+ typeof arg === 'boolean' ||
+ typeof arg === 'number' ||
+ typeof arg === 'string' ||
+ typeof arg === 'symbol' || // ES6 symbol
+ typeof arg === 'undefined';
+}
+exports.isPrimitive = isPrimitive;
+
+function isBuffer(arg) {
+ return Buffer.isBuffer(arg);
+}
+exports.isBuffer = isBuffer;
+
+function objectToString(o) {
+ return Object.prototype.toString.call(o);
+} \ No newline at end of file
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json
new file mode 100644
index 000000000..b67333380
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json
@@ -0,0 +1,37 @@
+{
+ "name": "core-util-is",
+ "version": "1.0.1",
+ "description": "The `util.is*` functions introduced in Node v0.12.",
+ "main": "lib/util.js",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/core-util-is.git"
+ },
+ "keywords": [
+ "util",
+ "isBuffer",
+ "isArray",
+ "isNumber",
+ "isString",
+ "isRegExp",
+ "isThis",
+ "isThat",
+ "polyfill"
+ ],
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me/"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/isaacs/core-util-is/issues"
+ },
+ "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n",
+ "readmeFilename": "README.md",
+ "homepage": "https://github.com/isaacs/core-util-is#readme",
+ "_id": "core-util-is@1.0.1",
+ "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538",
+ "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz",
+ "_from": "core-util-is@>=1.0.0 <1.1.0"
+}
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js
new file mode 100644
index 000000000..007fa1057
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js
@@ -0,0 +1,106 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// NOTE: These type checking functions intentionally don't use `instanceof`
+// because it is fragile and can be easily faked with `Object.create()`.
+function isArray(ar) {
+ return Array.isArray(ar);
+}
+exports.isArray = isArray;
+
+function isBoolean(arg) {
+ return typeof arg === 'boolean';
+}
+exports.isBoolean = isBoolean;
+
+function isNull(arg) {
+ return arg === null;
+}
+exports.isNull = isNull;
+
+function isNullOrUndefined(arg) {
+ return arg == null;
+}
+exports.isNullOrUndefined = isNullOrUndefined;
+
+function isNumber(arg) {
+ return typeof arg === 'number';
+}
+exports.isNumber = isNumber;
+
+function isString(arg) {
+ return typeof arg === 'string';
+}
+exports.isString = isString;
+
+function isSymbol(arg) {
+ return typeof arg === 'symbol';
+}
+exports.isSymbol = isSymbol;
+
+function isUndefined(arg) {
+ return arg === void 0;
+}
+exports.isUndefined = isUndefined;
+
+function isRegExp(re) {
+ return isObject(re) && objectToString(re) === '[object RegExp]';
+}
+exports.isRegExp = isRegExp;
+
+function isObject(arg) {
+ return typeof arg === 'object' && arg !== null;
+}
+exports.isObject = isObject;
+
+function isDate(d) {
+ return isObject(d) && objectToString(d) === '[object Date]';
+}
+exports.isDate = isDate;
+
+function isError(e) {
+ return isObject(e) && objectToString(e) === '[object Error]';
+}
+exports.isError = isError;
+
+function isFunction(arg) {
+ return typeof arg === 'function';
+}
+exports.isFunction = isFunction;
+
+function isPrimitive(arg) {
+ return arg === null ||
+ typeof arg === 'boolean' ||
+ typeof arg === 'number' ||
+ typeof arg === 'string' ||
+ typeof arg === 'symbol' || // ES6 symbol
+ typeof arg === 'undefined';
+}
+exports.isPrimitive = isPrimitive;
+
+function isBuffer(arg) {
+ return arg instanceof Buffer;
+}
+exports.isBuffer = isBuffer;
+
+function objectToString(o) {
+ return Object.prototype.toString.call(o);
+}
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md
new file mode 100644
index 000000000..052a62b8d
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md
@@ -0,0 +1,54 @@
+
+# isarray
+
+`Array#isArray` for older browsers.
+
+## Usage
+
+```js
+var isArray = require('isarray');
+
+console.log(isArray([])); // => true
+console.log(isArray({})); // => false
+```
+
+## Installation
+
+With [npm](http://npmjs.org) do
+
+```bash
+$ npm install isarray
+```
+
+Then bundle for the browser with
+[browserify](https://github.com/substack/browserify).
+
+With [component](http://component.io) do
+
+```bash
+$ component install juliangruber/isarray
+```
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js
new file mode 100644
index 000000000..ec58596ae
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js
@@ -0,0 +1,209 @@
+
+/**
+ * Require the given path.
+ *
+ * @param {String} path
+ * @return {Object} exports
+ * @api public
+ */
+
+function require(path, parent, orig) {
+ var resolved = require.resolve(path);
+
+ // lookup failed
+ if (null == resolved) {
+ orig = orig || path;
+ parent = parent || 'root';
+ var err = new Error('Failed to require "' + orig + '" from "' + parent + '"');
+ err.path = orig;
+ err.parent = parent;
+ err.require = true;
+ throw err;
+ }
+
+ var module = require.modules[resolved];
+
+ // perform real require()
+ // by invoking the module's
+ // registered function
+ if (!module.exports) {
+ module.exports = {};
+ module.client = module.component = true;
+ module.call(this, module.exports, require.relative(resolved), module);
+ }
+
+ return module.exports;
+}
+
+/**
+ * Registered modules.
+ */
+
+require.modules = {};
+
+/**
+ * Registered aliases.
+ */
+
+require.aliases = {};
+
+/**
+ * Resolve `path`.
+ *
+ * Lookup:
+ *
+ * - PATH/index.js
+ * - PATH.js
+ * - PATH
+ *
+ * @param {String} path
+ * @return {String} path or null
+ * @api private
+ */
+
+require.resolve = function(path) {
+ if (path.charAt(0) === '/') path = path.slice(1);
+ var index = path + '/index.js';
+
+ var paths = [
+ path,
+ path + '.js',
+ path + '.json',
+ path + '/index.js',
+ path + '/index.json'
+ ];
+
+ for (var i = 0; i < paths.length; i++) {
+ var path = paths[i];
+ if (require.modules.hasOwnProperty(path)) return path;
+ }
+
+ if (require.aliases.hasOwnProperty(index)) {
+ return require.aliases[index];
+ }
+};
+
+/**
+ * Normalize `path` relative to the current path.
+ *
+ * @param {String} curr
+ * @param {String} path
+ * @return {String}
+ * @api private
+ */
+
+require.normalize = function(curr, path) {
+ var segs = [];
+
+ if ('.' != path.charAt(0)) return path;
+
+ curr = curr.split('/');
+ path = path.split('/');
+
+ for (var i = 0; i < path.length; ++i) {
+ if ('..' == path[i]) {
+ curr.pop();
+ } else if ('.' != path[i] && '' != path[i]) {
+ segs.push(path[i]);
+ }
+ }
+
+ return curr.concat(segs).join('/');
+};
+
+/**
+ * Register module at `path` with callback `definition`.
+ *
+ * @param {String} path
+ * @param {Function} definition
+ * @api private
+ */
+
+require.register = function(path, definition) {
+ require.modules[path] = definition;
+};
+
+/**
+ * Alias a module definition.
+ *
+ * @param {String} from
+ * @param {String} to
+ * @api private
+ */
+
+require.alias = function(from, to) {
+ if (!require.modules.hasOwnProperty(from)) {
+ throw new Error('Failed to alias "' + from + '", it does not exist');
+ }
+ require.aliases[to] = from;
+};
+
+/**
+ * Return a require function relative to the `parent` path.
+ *
+ * @param {String} parent
+ * @return {Function}
+ * @api private
+ */
+
+require.relative = function(parent) {
+ var p = require.normalize(parent, '..');
+
+ /**
+ * lastIndexOf helper.
+ */
+
+ function lastIndexOf(arr, obj) {
+ var i = arr.length;
+ while (i--) {
+ if (arr[i] === obj) return i;
+ }
+ return -1;
+ }
+
+ /**
+ * The relative require() itself.
+ */
+
+ function localRequire(path) {
+ var resolved = localRequire.resolve(path);
+ return require(resolved, parent, path);
+ }
+
+ /**
+ * Resolve relative to the parent.
+ */
+
+ localRequire.resolve = function(path) {
+ var c = path.charAt(0);
+ if ('/' == c) return path.slice(1);
+ if ('.' == c) return require.normalize(p, path);
+
+ // resolve deps by returning
+ // the dep in the nearest "deps"
+ // directory
+ var segs = parent.split('/');
+ var i = lastIndexOf(segs, 'deps') + 1;
+ if (!i) i = 0;
+ path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
+ return path;
+ };
+
+ /**
+ * Check if module is defined at `path`.
+ */
+
+ localRequire.exists = function(path) {
+ return require.modules.hasOwnProperty(localRequire.resolve(path));
+ };
+
+ return localRequire;
+};
+require.register("isarray/index.js", function(exports, require, module){
+module.exports = Array.isArray || function (arr) {
+ return Object.prototype.toString.call(arr) == '[object Array]';
+};
+
+});
+require.alias("isarray/index.js", "isarray/index.js");
+
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json
new file mode 100644
index 000000000..9e31b6838
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json
@@ -0,0 +1,19 @@
+{
+ "name" : "isarray",
+ "description" : "Array#isArray for older browsers",
+ "version" : "0.0.1",
+ "repository" : "juliangruber/isarray",
+ "homepage": "https://github.com/juliangruber/isarray",
+ "main" : "index.js",
+ "scripts" : [
+ "index.js"
+ ],
+ "dependencies" : {},
+ "keywords": ["browser","isarray","array"],
+ "author": {
+ "name": "Julian Gruber",
+ "email": "mail@juliangruber.com",
+ "url": "http://juliangruber.com"
+ },
+ "license": "MIT"
+}
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js
new file mode 100644
index 000000000..5f5ad45d4
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js
@@ -0,0 +1,3 @@
+module.exports = Array.isArray || function (arr) {
+ return Object.prototype.toString.call(arr) == '[object Array]';
+};
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json
new file mode 100644
index 000000000..fb1eb3786
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json
@@ -0,0 +1,38 @@
+{
+ "name": "isarray",
+ "description": "Array#isArray for older browsers",
+ "version": "0.0.1",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/juliangruber/isarray.git"
+ },
+ "homepage": "https://github.com/juliangruber/isarray",
+ "main": "index.js",
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "tap": "*"
+ },
+ "keywords": [
+ "browser",
+ "isarray",
+ "array"
+ ],
+ "author": {
+ "name": "Julian Gruber",
+ "email": "mail@juliangruber.com",
+ "url": "http://juliangruber.com"
+ },
+ "license": "MIT",
+ "readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/juliangruber/isarray/issues"
+ },
+ "_id": "isarray@0.0.1",
+ "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf",
+ "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
+ "_from": "isarray@0.0.1"
+}
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml
new file mode 100644
index 000000000..5ac988553
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml
@@ -0,0 +1,7 @@
+language: node_js
+node_js:
+ - "0.8"
+ - "0.10"
+ - "0.11"
+ - "0.12"
+ - "iojs"
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js
new file mode 100644
index 000000000..049521cad
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js
@@ -0,0 +1,13 @@
+'use strict';
+module.exports = nextTick;
+
+function nextTick(fn) {
+ var args = new Array(arguments.length - 1);
+ var i = 0;
+ while (i < args.length) {
+ args[i++] = arguments[i];
+ }
+ process.nextTick(function afterTick() {
+ fn.apply(null, args);
+ });
+}
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md
new file mode 100644
index 000000000..c67e3532b
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md
@@ -0,0 +1,19 @@
+# Copyright (c) 2015 Calvin Metcalf
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.**
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json
new file mode 100644
index 000000000..bfaa2785f
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json
@@ -0,0 +1,28 @@
+{
+ "name": "process-nextick-args",
+ "version": "1.0.3",
+ "description": "process.nextTick but always with args",
+ "main": "index.js",
+ "scripts": {
+ "test": "node test.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git"
+ },
+ "author": "",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/calvinmetcalf/process-nextick-args/issues"
+ },
+ "homepage": "https://github.com/calvinmetcalf/process-nextick-args",
+ "devDependencies": {
+ "tap": "~0.2.6"
+ },
+ "readme": "process-nextick-args\n=====\n\n[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args)\n\n```bash\nnpm install --save process-nextick-args\n```\n\nAlways be able to pass arguments to process.nextTick, no matter the platform\n\n```js\nvar nextTick = require('process-nextick-args');\n\nnextTick(function (a, b, c) {\n console.log(a, b, c);\n}, 'step', 3, 'profit');\n```\n",
+ "readmeFilename": "readme.md",
+ "_id": "process-nextick-args@1.0.3",
+ "_shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630",
+ "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz",
+ "_from": "process-nextick-args@>=1.0.0 <1.1.0"
+}
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md
new file mode 100644
index 000000000..78e7cfaeb
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md
@@ -0,0 +1,18 @@
+process-nextick-args
+=====
+
+[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args)
+
+```bash
+npm install --save process-nextick-args
+```
+
+Always be able to pass arguments to process.nextTick, no matter the platform
+
+```js
+var nextTick = require('process-nextick-args');
+
+nextTick(function (a, b, c) {
+ console.log(a, b, c);
+}, 'step', 3, 'profit');
+```
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js
new file mode 100644
index 000000000..ef1572158
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js
@@ -0,0 +1,24 @@
+var test = require("tap").test;
+var nextTick = require('./');
+
+test('should work', function (t) {
+ t.plan(5);
+ nextTick(function (a) {
+ t.ok(a);
+ nextTick(function (thing) {
+ t.equals(thing, 7);
+ }, 7);
+ }, true);
+ nextTick(function (a, b, c) {
+ t.equals(a, 'step');
+ t.equals(b, 3);
+ t.equals(c, 'profit');
+ }, 'step', 3, 'profit');
+});
+
+test('correct number of arguments', function (t) {
+ t.plan(1);
+ nextTick(function () {
+ t.equals(2, arguments.length, 'correct number');
+ }, 1, 2);
+});
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore
new file mode 100644
index 000000000..206320cc1
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore
@@ -0,0 +1,2 @@
+build
+test
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE
new file mode 100644
index 000000000..6de584a48
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE
@@ -0,0 +1,20 @@
+Copyright Joyent, Inc. and other Node contributors.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md
new file mode 100644
index 000000000..4d2aa0015
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md
@@ -0,0 +1,7 @@
+**string_decoder.js** (`require('string_decoder')`) from Node.js core
+
+Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details.
+
+Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**
+
+The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js
new file mode 100644
index 000000000..b00e54fb7
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js
@@ -0,0 +1,221 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+var Buffer = require('buffer').Buffer;
+
+var isBufferEncoding = Buffer.isEncoding
+ || function(encoding) {
+ switch (encoding && encoding.toLowerCase()) {
+ case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
+ default: return false;
+ }
+ }
+
+
+function assertEncoding(encoding) {
+ if (encoding && !isBufferEncoding(encoding)) {
+ throw new Error('Unknown encoding: ' + encoding);
+ }
+}
+
+// StringDecoder provides an interface for efficiently splitting a series of
+// buffers into a series of JS strings without breaking apart multi-byte
+// characters. CESU-8 is handled as part of the UTF-8 encoding.
+//
+// @TODO Handling all encodings inside a single object makes it very difficult
+// to reason about this code, so it should be split up in the future.
+// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
+// points as used by CESU-8.
+var StringDecoder = exports.StringDecoder = function(encoding) {
+ this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
+ assertEncoding(encoding);
+ switch (this.encoding) {
+ case 'utf8':
+ // CESU-8 represents each of Surrogate Pair by 3-bytes
+ this.surrogateSize = 3;
+ break;
+ case 'ucs2':
+ case 'utf16le':
+ // UTF-16 represents each of Surrogate Pair by 2-bytes
+ this.surrogateSize = 2;
+ this.detectIncompleteChar = utf16DetectIncompleteChar;
+ break;
+ case 'base64':
+ // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
+ this.surrogateSize = 3;
+ this.detectIncompleteChar = base64DetectIncompleteChar;
+ break;
+ default:
+ this.write = passThroughWrite;
+ return;
+ }
+
+ // Enough space to store all bytes of a single character. UTF-8 needs 4
+ // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
+ this.charBuffer = new Buffer(6);
+ // Number of bytes received for the current incomplete multi-byte character.
+ this.charReceived = 0;
+ // Number of bytes expected for the current incomplete multi-byte character.
+ this.charLength = 0;
+};
+
+
+// write decodes the given buffer and returns it as JS string that is
+// guaranteed to not contain any partial multi-byte characters. Any partial
+// character found at the end of the buffer is buffered up, and will be
+// returned when calling write again with the remaining bytes.
+//
+// Note: Converting a Buffer containing an orphan surrogate to a String
+// currently works, but converting a String to a Buffer (via `new Buffer`, or
+// Buffer#write) will replace incomplete surrogates with the unicode
+// replacement character. See https://codereview.chromium.org/121173009/ .
+StringDecoder.prototype.write = function(buffer) {
+ var charStr = '';
+ // if our last write ended with an incomplete multibyte character
+ while (this.charLength) {
+ // determine how many remaining bytes this buffer has to offer for this char
+ var available = (buffer.length >= this.charLength - this.charReceived) ?
+ this.charLength - this.charReceived :
+ buffer.length;
+
+ // add the new bytes to the char buffer
+ buffer.copy(this.charBuffer, this.charReceived, 0, available);
+ this.charReceived += available;
+
+ if (this.charReceived < this.charLength) {
+ // still not enough chars in this buffer? wait for more ...
+ return '';
+ }
+
+ // remove bytes belonging to the current character from the buffer
+ buffer = buffer.slice(available, buffer.length);
+
+ // get the character that was split
+ charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
+
+ // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
+ var charCode = charStr.charCodeAt(charStr.length - 1);
+ if (charCode >= 0xD800 && charCode <= 0xDBFF) {
+ this.charLength += this.surrogateSize;
+ charStr = '';
+ continue;
+ }
+ this.charReceived = this.charLength = 0;
+
+ // if there are no more bytes in this buffer, just emit our char
+ if (buffer.length === 0) {
+ return charStr;
+ }
+ break;
+ }
+
+ // determine and set charLength / charReceived
+ this.detectIncompleteChar(buffer);
+
+ var end = buffer.length;
+ if (this.charLength) {
+ // buffer the incomplete character bytes we got
+ buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
+ end -= this.charReceived;
+ }
+
+ charStr += buffer.toString(this.encoding, 0, end);
+
+ var end = charStr.length - 1;
+ var charCode = charStr.charCodeAt(end);
+ // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
+ if (charCode >= 0xD800 && charCode <= 0xDBFF) {
+ var size = this.surrogateSize;
+ this.charLength += size;
+ this.charReceived += size;
+ this.charBuffer.copy(this.charBuffer, size, 0, size);
+ buffer.copy(this.charBuffer, 0, 0, size);
+ return charStr.substring(0, end);
+ }
+
+ // or just emit the charStr
+ return charStr;
+};
+
+// detectIncompleteChar determines if there is an incomplete UTF-8 character at
+// the end of the given buffer. If so, it sets this.charLength to the byte
+// length that character, and sets this.charReceived to the number of bytes
+// that are available for this character.
+StringDecoder.prototype.detectIncompleteChar = function(buffer) {
+ // determine how many bytes we have to check at the end of this buffer
+ var i = (buffer.length >= 3) ? 3 : buffer.length;
+
+ // Figure out if one of the last i bytes of our buffer announces an
+ // incomplete char.
+ for (; i > 0; i--) {
+ var c = buffer[buffer.length - i];
+
+ // See http://en.wikipedia.org/wiki/UTF-8#Description
+
+ // 110XXXXX
+ if (i == 1 && c >> 5 == 0x06) {
+ this.charLength = 2;
+ break;
+ }
+
+ // 1110XXXX
+ if (i <= 2 && c >> 4 == 0x0E) {
+ this.charLength = 3;
+ break;
+ }
+
+ // 11110XXX
+ if (i <= 3 && c >> 3 == 0x1E) {
+ this.charLength = 4;
+ break;
+ }
+ }
+ this.charReceived = i;
+};
+
+StringDecoder.prototype.end = function(buffer) {
+ var res = '';
+ if (buffer && buffer.length)
+ res = this.write(buffer);
+
+ if (this.charReceived) {
+ var cr = this.charReceived;
+ var buf = this.charBuffer;
+ var enc = this.encoding;
+ res += buf.slice(0, cr).toString(enc);
+ }
+
+ return res;
+};
+
+function passThroughWrite(buffer) {
+ return buffer.toString(this.encoding);
+}
+
+function utf16DetectIncompleteChar(buffer) {
+ this.charReceived = buffer.length % 2;
+ this.charLength = this.charReceived ? 2 : 0;
+}
+
+function base64DetectIncompleteChar(buffer) {
+ this.charReceived = buffer.length % 3;
+ this.charLength = this.charReceived ? 3 : 0;
+}
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json
new file mode 100644
index 000000000..ee7070235
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json
@@ -0,0 +1,34 @@
+{
+ "name": "string_decoder",
+ "version": "0.10.31",
+ "description": "The string_decoder module from Node core",
+ "main": "index.js",
+ "dependencies": {},
+ "devDependencies": {
+ "tap": "~0.4.8"
+ },
+ "scripts": {
+ "test": "tap test/simple/*.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/rvagg/string_decoder.git"
+ },
+ "homepage": "https://github.com/rvagg/string_decoder",
+ "keywords": [
+ "string",
+ "decoder",
+ "browser",
+ "browserify"
+ ],
+ "license": "MIT",
+ "readme": "**string_decoder.js** (`require('string_decoder')`) from Node.js core\n\nCopyright Joyent, Inc. and other Node contributors. See LICENCE file for details.\n\nVersion numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**\n\nThe *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/rvagg/string_decoder/issues"
+ },
+ "_id": "string_decoder@0.10.31",
+ "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
+ "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
+ "_from": "string_decoder@>=0.10.0 <0.11.0"
+}
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md
new file mode 100644
index 000000000..acc867537
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md
@@ -0,0 +1,16 @@
+
+1.0.2 / 2015-10-07
+==================
+
+ * use try/catch when checking `localStorage` (#3, @kumavis)
+
+1.0.1 / 2014-11-25
+==================
+
+ * browser: use `console.warn()` for deprecation calls
+ * browser: more jsdocs
+
+1.0.0 / 2014-04-30
+==================
+
+ * initial commit
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE
new file mode 100644
index 000000000..6a60e8c22
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md
new file mode 100644
index 000000000..75622fa7c
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md
@@ -0,0 +1,53 @@
+util-deprecate
+==============
+### The Node.js `util.deprecate()` function with browser support
+
+In Node.js, this module simply re-exports the `util.deprecate()` function.
+
+In the web browser (i.e. via browserify), a browser-specific implementation
+of the `util.deprecate()` function is used.
+
+
+## API
+
+A `deprecate()` function is the only thing exposed by this module.
+
+``` javascript
+// setup:
+exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');
+
+
+// users see:
+foo();
+// foo() is deprecated, use bar() instead
+foo();
+foo();
+```
+
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js
new file mode 100644
index 000000000..549ae2f06
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js
@@ -0,0 +1,67 @@
+
+/**
+ * Module exports.
+ */
+
+module.exports = deprecate;
+
+/**
+ * Mark that a method should not be used.
+ * Returns a modified function which warns once by default.
+ *
+ * If `localStorage.noDeprecation = true` is set, then it is a no-op.
+ *
+ * If `localStorage.throwDeprecation = true` is set, then deprecated functions
+ * will throw an Error when invoked.
+ *
+ * If `localStorage.traceDeprecation = true` is set, then deprecated functions
+ * will invoke `console.trace()` instead of `console.error()`.
+ *
+ * @param {Function} fn - the function to deprecate
+ * @param {String} msg - the string to print to the console when `fn` is invoked
+ * @returns {Function} a new "deprecated" version of `fn`
+ * @api public
+ */
+
+function deprecate (fn, msg) {
+ if (config('noDeprecation')) {
+ return fn;
+ }
+
+ var warned = false;
+ function deprecated() {
+ if (!warned) {
+ if (config('throwDeprecation')) {
+ throw new Error(msg);
+ } else if (config('traceDeprecation')) {
+ console.trace(msg);
+ } else {
+ console.warn(msg);
+ }
+ warned = true;
+ }
+ return fn.apply(this, arguments);
+ }
+
+ return deprecated;
+}
+
+/**
+ * Checks `localStorage` for boolean values for the given `name`.
+ *
+ * @param {String} name
+ * @returns {Boolean}
+ * @api private
+ */
+
+function config (name) {
+ // accessing global.localStorage can trigger a DOMException in sandboxed iframes
+ try {
+ if (!global.localStorage) return false;
+ } catch (_) {
+ return false;
+ }
+ var val = global.localStorage[name];
+ if (null == val) return false;
+ return String(val).toLowerCase() === 'true';
+}
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js
new file mode 100644
index 000000000..5e6fcff5d
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js
@@ -0,0 +1,6 @@
+
+/**
+ * For Node.js, simply re-export the core `util.deprecate` function.
+ */
+
+module.exports = require('util').deprecate;
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json
new file mode 100644
index 000000000..ae0c70f6c
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json
@@ -0,0 +1,54 @@
+{
+ "name": "util-deprecate",
+ "version": "1.0.2",
+ "description": "The Node.js `util.deprecate()` function with browser support",
+ "main": "node.js",
+ "browser": "browser.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/TooTallNate/util-deprecate.git"
+ },
+ "keywords": [
+ "util",
+ "deprecate",
+ "browserify",
+ "browser",
+ "node"
+ ],
+ "author": {
+ "name": "Nathan Rajlich",
+ "email": "nathan@tootallnate.net",
+ "url": "http://n8.io/"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/TooTallNate/util-deprecate/issues"
+ },
+ "homepage": "https://github.com/TooTallNate/util-deprecate",
+ "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4",
+ "_id": "util-deprecate@1.0.2",
+ "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf",
+ "_from": "util-deprecate@>=1.0.1 <1.1.0",
+ "_npmVersion": "2.14.4",
+ "_nodeVersion": "4.1.2",
+ "_npmUser": {
+ "name": "tootallnate",
+ "email": "nathan@tootallnate.net"
+ },
+ "maintainers": [
+ {
+ "name": "tootallnate",
+ "email": "nathan@tootallnate.net"
+ }
+ ],
+ "dist": {
+ "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf",
+ "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json b/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json
new file mode 100644
index 000000000..0d67d9bbb
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json
@@ -0,0 +1,46 @@
+{
+ "name": "readable-stream",
+ "version": "2.0.2",
+ "description": "Streams3, a user-land copy of the stream library from iojs v2.x",
+ "main": "readable.js",
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.1",
+ "isarray": "0.0.1",
+ "process-nextick-args": "~1.0.0",
+ "string_decoder": "~0.10.x",
+ "util-deprecate": "~1.0.1"
+ },
+ "devDependencies": {
+ "tap": "~0.2.6",
+ "tape": "~4.0.0",
+ "zuul": "~3.0.0"
+ },
+ "scripts": {
+ "test": "tap test/parallel/*.js",
+ "browser": "zuul --browser-name $BROWSER_NAME --browser-version $BROWSER_VERSION -- test/browser.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/nodejs/readable-stream.git"
+ },
+ "keywords": [
+ "readable",
+ "stream",
+ "pipe"
+ ],
+ "browser": {
+ "util": false
+ },
+ "license": "MIT",
+ "readme": "# readable-stream\n\n***Node-core streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)\n\n\n[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)\n[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)\n\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)\n\n```bash\nnpm install --save readable-stream\n```\n\n***Node-core streams for userland***\n\nThis package is a mirror of the Streams2 and Streams3 implementations in\nNode-core, including [documentation](doc/stream.markdown).\n\nIf you want to guarantee a stable streams base, regardless of what version of\nNode you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *\"stream\"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).\n\nAs of version 2.0.0 **readable-stream** uses semantic versioning. \n\n# Streams WG Team Members\n\n* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) &lt;christopher.s.dickinson@gmail.com&gt;\n - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B\n* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) &lt;calvin.metcalf@gmail.com&gt;\n - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242\n* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) &lt;rod@vagg.org&gt;\n - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D\n* **Sam Newman** ([@sonewman](https://github.com/sonewman)) &lt;newmansam@outlook.com&gt;\n* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) &lt;mathiasbuus@gmail.com&gt;\n* **Domenic Denicola** ([@domenic](https://github.com/domenic)) &lt;d@domenic.me&gt;\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/nodejs/readable-stream/issues"
+ },
+ "homepage": "https://github.com/nodejs/readable-stream#readme",
+ "_id": "readable-stream@2.0.2",
+ "_shasum": "bec81beae8cf455168bc2e5b2b31f5bcfaed9b1b",
+ "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.2.tgz",
+ "_from": "readable-stream@>=2.0.0 <2.1.0"
+}
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js
new file mode 100644
index 000000000..27e8d8a55
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_passthrough.js")
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js
new file mode 100644
index 000000000..6222a5798
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js
@@ -0,0 +1,12 @@
+var Stream = (function (){
+ try {
+ return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify
+ } catch(_){}
+}());
+exports = module.exports = require('./lib/_stream_readable.js');
+exports.Stream = Stream || exports;
+exports.Readable = exports;
+exports.Writable = require('./lib/_stream_writable.js');
+exports.Duplex = require('./lib/_stream_duplex.js');
+exports.Transform = require('./lib/_stream_transform.js');
+exports.PassThrough = require('./lib/_stream_passthrough.js');
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js
new file mode 100644
index 000000000..5d482f078
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_transform.js")
diff --git a/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js b/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js
new file mode 100644
index 000000000..e1e9efdf3
--- /dev/null
+++ b/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_writable.js")
diff --git a/node_modules/request/node_modules/bl/package.json b/node_modules/request/node_modules/bl/package.json
new file mode 100644
index 000000000..151384703
--- /dev/null
+++ b/node_modules/request/node_modules/bl/package.json
@@ -0,0 +1,62 @@
+{
+ "name": "bl",
+ "version": "1.0.0",
+ "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!",
+ "main": "bl.js",
+ "scripts": {
+ "test": "node test/test.js | faucet",
+ "test-local": "brtapsauce-local test/basic-test.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/rvagg/bl.git"
+ },
+ "homepage": "https://github.com/rvagg/bl",
+ "authors": [
+ "Rod Vagg <rod@vagg.org> (https://github.com/rvagg)",
+ "Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)",
+ "Jarett Cruger <jcrugzz@gmail.com> (https://github.com/jcrugzz)"
+ ],
+ "keywords": [
+ "buffer",
+ "buffers",
+ "stream",
+ "awesomesauce"
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "readable-stream": "~2.0.0"
+ },
+ "devDependencies": {
+ "tape": "~2.12.3",
+ "hash_file": "~0.1.1",
+ "faucet": "~0.0.1",
+ "brtapsauce": "~0.3.0"
+ },
+ "gitHead": "1794938be6697a6d1e02cd942a4eea59b353347a",
+ "bugs": {
+ "url": "https://github.com/rvagg/bl/issues"
+ },
+ "_id": "bl@1.0.0",
+ "_shasum": "ada9a8a89a6d7ac60862f7dec7db207873e0c3f5",
+ "_from": "bl@>=1.0.0 <1.1.0",
+ "_npmVersion": "2.9.0",
+ "_nodeVersion": "2.0.1-nightly20150618d2e4e03444",
+ "_npmUser": {
+ "name": "rvagg",
+ "email": "rod@vagg.org"
+ },
+ "maintainers": [
+ {
+ "name": "rvagg",
+ "email": "rod@vagg.org"
+ }
+ ],
+ "dist": {
+ "shasum": "ada9a8a89a6d7ac60862f7dec7db207873e0c3f5",
+ "tarball": "http://registry.npmjs.org/bl/-/bl-1.0.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/bl/-/bl-1.0.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/bl/test/basic-test.js b/node_modules/request/node_modules/bl/test/basic-test.js
new file mode 100644
index 000000000..75116a30f
--- /dev/null
+++ b/node_modules/request/node_modules/bl/test/basic-test.js
@@ -0,0 +1,541 @@
+var tape = require('tape')
+ , crypto = require('crypto')
+ , fs = require('fs')
+ , hash = require('hash_file')
+ , BufferList = require('../')
+
+ , encodings =
+ ('hex utf8 utf-8 ascii binary base64'
+ + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
+
+tape('single bytes from single buffer', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abcd'))
+
+ t.equal(bl.length, 4)
+
+ t.equal(bl.get(0), 97)
+ t.equal(bl.get(1), 98)
+ t.equal(bl.get(2), 99)
+ t.equal(bl.get(3), 100)
+
+ t.end()
+})
+
+tape('single bytes from multiple buffers', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.get(0), 97)
+ t.equal(bl.get(1), 98)
+ t.equal(bl.get(2), 99)
+ t.equal(bl.get(3), 100)
+ t.equal(bl.get(4), 101)
+ t.equal(bl.get(5), 102)
+ t.equal(bl.get(6), 103)
+ t.equal(bl.get(7), 104)
+ t.equal(bl.get(8), 105)
+ t.equal(bl.get(9), 106)
+ t.end()
+})
+
+tape('multi bytes from single buffer', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abcd'))
+
+ t.equal(bl.length, 4)
+
+ t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
+ t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
+ t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
+
+ t.end()
+})
+
+tape('multiple bytes from multiple buffers', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+ t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+ t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+ t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+ t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+ t.end()
+})
+
+tape('multiple bytes from multiple buffer lists', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new BufferList([new Buffer('abcd'), new Buffer('efg')]))
+ bl.append(new BufferList([new Buffer('hi'), new Buffer('j')]))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+ t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+ t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+ t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+ t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+ t.end()
+})
+
+tape('consuming from multiple buffers', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+
+ bl.consume(3)
+ t.equal(bl.length, 7)
+ t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
+
+ bl.consume(2)
+ t.equal(bl.length, 5)
+ t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
+
+ bl.consume(1)
+ t.equal(bl.length, 4)
+ t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
+
+ bl.consume(1)
+ t.equal(bl.length, 3)
+ t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
+
+ bl.consume(2)
+ t.equal(bl.length, 1)
+ t.equal(bl.slice(0, 1).toString('ascii'), 'j')
+
+ t.end()
+})
+
+tape('test readUInt8 / readInt8', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x3
+ buf2[2] = 0x4
+ buf3[0] = 0x23
+ buf3[1] = 0x42
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readUInt8(2), 0x3)
+ t.equal(bl.readInt8(2), 0x3)
+ t.equal(bl.readUInt8(3), 0x4)
+ t.equal(bl.readInt8(3), 0x4)
+ t.equal(bl.readUInt8(4), 0x23)
+ t.equal(bl.readInt8(4), 0x23)
+ t.equal(bl.readUInt8(5), 0x42)
+ t.equal(bl.readInt8(5), 0x42)
+ t.end()
+})
+
+tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x3
+ buf2[2] = 0x4
+ buf3[0] = 0x23
+ buf3[1] = 0x42
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readUInt16BE(2), 0x0304)
+ t.equal(bl.readUInt16LE(2), 0x0403)
+ t.equal(bl.readInt16BE(2), 0x0304)
+ t.equal(bl.readInt16LE(2), 0x0403)
+ t.equal(bl.readUInt16BE(3), 0x0423)
+ t.equal(bl.readUInt16LE(3), 0x2304)
+ t.equal(bl.readInt16BE(3), 0x0423)
+ t.equal(bl.readInt16LE(3), 0x2304)
+ t.equal(bl.readUInt16BE(4), 0x2342)
+ t.equal(bl.readUInt16LE(4), 0x4223)
+ t.equal(bl.readInt16BE(4), 0x2342)
+ t.equal(bl.readInt16LE(4), 0x4223)
+ t.end()
+})
+
+tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x3
+ buf2[2] = 0x4
+ buf3[0] = 0x23
+ buf3[1] = 0x42
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readUInt32BE(2), 0x03042342)
+ t.equal(bl.readUInt32LE(2), 0x42230403)
+ t.equal(bl.readInt32BE(2), 0x03042342)
+ t.equal(bl.readInt32LE(2), 0x42230403)
+ t.end()
+})
+
+tape('test readFloatLE / readFloatBE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x00
+ buf2[2] = 0x00
+ buf3[0] = 0x80
+ buf3[1] = 0x3f
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readFloatLE(2), 0x01)
+ t.end()
+})
+
+tape('test readDoubleLE / readDoubleBE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(10)
+ , bl = new BufferList()
+
+ buf2[1] = 0x55
+ buf2[2] = 0x55
+ buf3[0] = 0x55
+ buf3[1] = 0x55
+ buf3[2] = 0x55
+ buf3[3] = 0x55
+ buf3[4] = 0xd5
+ buf3[5] = 0x3f
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readDoubleLE(2), 0.3333333333333333)
+ t.end()
+})
+
+tape('test toString', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
+ t.equal(bl.toString('ascii', 3, 10), 'defghij')
+ t.equal(bl.toString('ascii', 3, 6), 'def')
+ t.equal(bl.toString('ascii', 3, 8), 'defgh')
+ t.equal(bl.toString('ascii', 5, 10), 'fghij')
+
+ t.end()
+})
+
+tape('test toString encoding', function (t) {
+ var bl = new BufferList()
+ , b = new Buffer('abcdefghij\xff\x00')
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+ bl.append(new Buffer('\xff\x00'))
+
+ encodings.forEach(function (enc) {
+ t.equal(bl.toString(enc), b.toString(enc), enc)
+ })
+
+ t.end()
+})
+
+!process.browser && tape('test stream', function (t) {
+ var random = crypto.randomBytes(65534)
+ , rndhash = hash(random, 'md5')
+ , md5sum = crypto.createHash('md5')
+ , bl = new BufferList(function (err, buf) {
+ t.ok(Buffer.isBuffer(buf))
+ t.ok(err === null)
+ t.equal(rndhash, hash(bl.slice(), 'md5'))
+ t.equal(rndhash, hash(buf, 'md5'))
+
+ bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
+ .on('close', function () {
+ var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
+ s.on('data', md5sum.update.bind(md5sum))
+ s.on('end', function() {
+ t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
+ t.end()
+ })
+ })
+
+ })
+
+ fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
+ fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
+})
+
+tape('instantiation with Buffer', function (t) {
+ var buf = crypto.randomBytes(1024)
+ , buf2 = crypto.randomBytes(1024)
+ , b = BufferList(buf)
+
+ t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
+ b = BufferList([ buf, buf2 ])
+ t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('test String appendage', function (t) {
+ var bl = new BufferList()
+ , b = new Buffer('abcdefghij\xff\x00')
+
+ bl.append('abcd')
+ bl.append('efg')
+ bl.append('hi')
+ bl.append('j')
+ bl.append('\xff\x00')
+
+ encodings.forEach(function (enc) {
+ t.equal(bl.toString(enc), b.toString(enc))
+ })
+
+ t.end()
+})
+
+tape('write nothing, should get empty buffer', function (t) {
+ t.plan(3)
+ BufferList(function (err, data) {
+ t.notOk(err, 'no error')
+ t.ok(Buffer.isBuffer(data), 'got a buffer')
+ t.equal(0, data.length, 'got a zero-length buffer')
+ t.end()
+ }).end()
+})
+
+tape('unicode string', function (t) {
+ t.plan(2)
+ var inp1 = '\u2600'
+ , inp2 = '\u2603'
+ , exp = inp1 + ' and ' + inp2
+ , bl = BufferList()
+ bl.write(inp1)
+ bl.write(' and ')
+ bl.write(inp2)
+ t.equal(exp, bl.toString())
+ t.equal(new Buffer(exp).toString('hex'), bl.toString('hex'))
+})
+
+tape('should emit finish', function (t) {
+ var source = BufferList()
+ , dest = BufferList()
+
+ source.write('hello')
+ source.pipe(dest)
+
+ dest.on('finish', function () {
+ t.equal(dest.toString('utf8'), 'hello')
+ t.end()
+ })
+})
+
+tape('basic copy', function (t) {
+ var buf = crypto.randomBytes(1024)
+ , buf2 = new Buffer(1024)
+ , b = BufferList(buf)
+
+ b.copy(buf2)
+ t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy after many appends', function (t) {
+ var buf = crypto.randomBytes(512)
+ , buf2 = new Buffer(1024)
+ , b = BufferList(buf)
+
+ b.append(buf)
+ b.copy(buf2)
+ t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy at a precise position', function (t) {
+ var buf = crypto.randomBytes(1004)
+ , buf2 = new Buffer(1024)
+ , b = BufferList(buf)
+
+ b.copy(buf2, 20)
+ t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy starting from a precise location', function (t) {
+ var buf = crypto.randomBytes(10)
+ , buf2 = new Buffer(5)
+ , b = BufferList(buf)
+
+ b.copy(buf2, 0, 5)
+ t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy in an interval', function (t) {
+ var rnd = crypto.randomBytes(10)
+ , b = BufferList(rnd) // put the random bytes there
+ , actual = new Buffer(3)
+ , expected = new Buffer(3)
+
+ rnd.copy(expected, 0, 5, 8)
+ b.copy(actual, 0, 5, 8)
+
+ t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy an interval between two buffers', function (t) {
+ var buf = crypto.randomBytes(10)
+ , buf2 = new Buffer(10)
+ , b = BufferList(buf)
+
+ b.append(buf)
+ b.copy(buf2, 0, 5, 15)
+
+ t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('duplicate', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList('abcdefghij\xff\x00')
+ , dup = bl.duplicate()
+
+ t.equal(bl.prototype, dup.prototype)
+ t.equal(bl.toString('hex'), dup.toString('hex'))
+})
+
+tape('destroy no pipe', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList('alsdkfja;lsdkfja;lsdk')
+ bl.destroy()
+
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+})
+
+!process.browser && tape('destroy with pipe before read end', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList()
+ fs.createReadStream(__dirname + '/sauce.js')
+ .pipe(bl)
+
+ bl.destroy()
+
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+
+})
+
+!process.browser && tape('destroy with pipe before read end with race', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList()
+ fs.createReadStream(__dirname + '/sauce.js')
+ .pipe(bl)
+
+ setTimeout(function () {
+ bl.destroy()
+ setTimeout(function () {
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+ }, 500)
+ }, 500)
+})
+
+!process.browser && tape('destroy with pipe after read end', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList()
+ fs.createReadStream(__dirname + '/sauce.js')
+ .on('end', onEnd)
+ .pipe(bl)
+
+ function onEnd () {
+ bl.destroy()
+
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+ }
+})
+
+!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
+ t.plan(4)
+
+ var bl = new BufferList()
+ , ds = new BufferList()
+
+ fs.createReadStream(__dirname + '/sauce.js')
+ .on('end', onEnd)
+ .pipe(bl)
+
+ function onEnd () {
+ bl.pipe(ds)
+
+ setTimeout(function () {
+ bl.destroy()
+
+ t.equals(bl._bufs.length, 0)
+ t.equals(bl.length, 0)
+
+ ds.destroy()
+
+ t.equals(bl._bufs.length, 0)
+ t.equals(bl.length, 0)
+
+ }, 100)
+ }
+})
+
+!process.browser && tape('handle error', function (t) {
+ t.plan(2)
+ fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
+ t.ok(err instanceof Error, 'has error')
+ t.notOk(data, 'no data')
+ }))
+})
diff --git a/node_modules/request/node_modules/bl/test/sauce.js b/node_modules/request/node_modules/bl/test/sauce.js
new file mode 100644
index 000000000..a6d28625f
--- /dev/null
+++ b/node_modules/request/node_modules/bl/test/sauce.js
@@ -0,0 +1,38 @@
+#!/usr/bin/env node
+
+const user = process.env.SAUCE_USER
+ , key = process.env.SAUCE_KEY
+ , path = require('path')
+ , brtapsauce = require('brtapsauce')
+ , testFile = path.join(__dirname, 'basic-test.js')
+
+ , capabilities = [
+ { browserName: 'chrome' , platform: 'Windows XP', version: '' }
+ , { browserName: 'firefox' , platform: 'Windows 8' , version: '' }
+ , { browserName: 'firefox' , platform: 'Windows XP', version: '4' }
+ , { browserName: 'internet explorer' , platform: 'Windows 8' , version: '10' }
+ , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '9' }
+ , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '8' }
+ , { browserName: 'internet explorer' , platform: 'Windows XP', version: '7' }
+ , { browserName: 'internet explorer' , platform: 'Windows XP', version: '6' }
+ , { browserName: 'safari' , platform: 'Windows 7' , version: '5' }
+ , { browserName: 'safari' , platform: 'OS X 10.8' , version: '6' }
+ , { browserName: 'opera' , platform: 'Windows 7' , version: '' }
+ , { browserName: 'opera' , platform: 'Windows 7' , version: '11' }
+ , { browserName: 'ipad' , platform: 'OS X 10.8' , version: '6' }
+ , { browserName: 'android' , platform: 'Linux' , version: '4.0', 'device-type': 'tablet' }
+ ]
+
+if (!user)
+ throw new Error('Must set a SAUCE_USER env var')
+if (!key)
+ throw new Error('Must set a SAUCE_KEY env var')
+
+brtapsauce({
+ name : 'Traversty'
+ , user : user
+ , key : key
+ , brsrc : testFile
+ , capabilities : capabilities
+ , options : { timeout: 60 * 6 }
+}) \ No newline at end of file
diff --git a/node_modules/request/node_modules/bl/test/test.js b/node_modules/request/node_modules/bl/test/test.js
new file mode 100644
index 000000000..aa9b48771
--- /dev/null
+++ b/node_modules/request/node_modules/bl/test/test.js
@@ -0,0 +1,9 @@
+require('./basic-test')
+
+if (!process.env.SAUCE_KEY || !process.env.SAUCE_USER)
+ return console.log('SAUCE_KEY and/or SAUCE_USER not set, not running sauce tests')
+
+if (!/v0\.10/.test(process.version))
+ return console.log('Not Node v0.10.x, not running sauce tests')
+
+require('./sauce.js') \ No newline at end of file
diff --git a/node_modules/request/node_modules/caseless/LICENSE b/node_modules/request/node_modules/caseless/LICENSE
new file mode 100644
index 000000000..61789f4a4
--- /dev/null
+++ b/node_modules/request/node_modules/caseless/LICENSE
@@ -0,0 +1,28 @@
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+1. Definitions.
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+END OF TERMS AND CONDITIONS \ No newline at end of file
diff --git a/node_modules/request/node_modules/caseless/README.md b/node_modules/request/node_modules/caseless/README.md
new file mode 100644
index 000000000..e5077a216
--- /dev/null
+++ b/node_modules/request/node_modules/caseless/README.md
@@ -0,0 +1,45 @@
+## 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 manner while also preserving the caseing of headers the first time they are set.
+
+## Usage
+
+```javascript
+var headers = {}
+ , c = caseless(headers)
+ ;
+c.set('a-Header', 'asdf')
+c.get('a-header') === 'asdf'
+```
+
+## has(key)
+
+Has takes a name and if it finds a matching header will return that header name with the preserved caseing it was set with.
+
+```javascript
+c.has('a-header') === 'a-Header'
+```
+
+## set(key, value[, clobber=true])
+
+Set is fairly straight forward except that if the header exists and clobber is disabled it will add `','+value` to the existing header.
+
+```javascript
+c.set('a-Header', 'fdas')
+c.set('a-HEADER', 'more', false)
+c.get('a-header') === 'fdsa,more'
+```
+
+## swap(key)
+
+Swaps the casing of a header with the new one that is passed in.
+
+```javascript
+var headers = {}
+ , c = caseless(headers)
+ ;
+c.set('a-Header', 'fdas')
+c.swap('a-HEADER')
+c.has('a-header') === 'a-HEADER'
+headers === {'a-HEADER': 'fdas'}
+```
diff --git a/node_modules/request/node_modules/caseless/index.js b/node_modules/request/node_modules/caseless/index.js
new file mode 100644
index 000000000..d86a70eca
--- /dev/null
+++ b/node_modules/request/node_modules/caseless/index.js
@@ -0,0 +1,66 @@
+function Caseless (dict) {
+ this.dict = dict || {}
+}
+Caseless.prototype.set = function (name, value, clobber) {
+ if (typeof name === 'object') {
+ for (var i in name) {
+ this.set(i, name[i], value)
+ }
+ } else {
+ if (typeof clobber === 'undefined') clobber = true
+ var has = this.has(name)
+
+ if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value
+ else this.dict[has || name] = value
+ return has
+ }
+}
+Caseless.prototype.has = function (name) {
+ var keys = Object.keys(this.dict)
+ , name = name.toLowerCase()
+ ;
+ for (var i=0;i<keys.length;i++) {
+ if (keys[i].toLowerCase() === name) return keys[i]
+ }
+ return false
+}
+Caseless.prototype.get = function (name) {
+ name = name.toLowerCase()
+ var result, _key
+ var headers = this.dict
+ Object.keys(headers).forEach(function (key) {
+ _key = key.toLowerCase()
+ if (name === _key) result = headers[key]
+ })
+ return result
+}
+Caseless.prototype.swap = function (name) {
+ var has = this.has(name)
+ if (!has) throw new Error('There is no header than matches "'+name+'"')
+ this.dict[name] = this.dict[has]
+ delete this.dict[has]
+}
+Caseless.prototype.del = function (name) {
+ var has = this.has(name)
+ return delete this.dict[has || name]
+}
+
+module.exports = function (dict) {return new Caseless(dict)}
+module.exports.httpify = function (resp, headers) {
+ var c = new Caseless(headers)
+ resp.setHeader = function (key, value, clobber) {
+ if (typeof value === 'undefined') return
+ return c.set(key, value, clobber)
+ }
+ resp.hasHeader = function (key) {
+ return c.has(key)
+ }
+ resp.getHeader = function (key) {
+ return c.get(key)
+ }
+ resp.removeHeader = function (key) {
+ return c.del(key)
+ }
+ resp.headers = c.dict
+ return c
+}
diff --git a/node_modules/request/node_modules/caseless/package.json b/node_modules/request/node_modules/caseless/package.json
new file mode 100644
index 000000000..2cd79ea01
--- /dev/null
+++ b/node_modules/request/node_modules/caseless/package.json
@@ -0,0 +1,62 @@
+{
+ "name": "caseless",
+ "version": "0.11.0",
+ "description": "Caseless object set/get/has, very useful when working with HTTP headers.",
+ "main": "index.js",
+ "scripts": {
+ "test": "node test.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/mikeal/caseless.git"
+ },
+ "keywords": [
+ "headers",
+ "http",
+ "caseless"
+ ],
+ "test": "node test.js",
+ "author": {
+ "name": "Mikeal Rogers",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ "license": "Apache-2.0",
+ "bugs": {
+ "url": "https://github.com/mikeal/caseless/issues"
+ },
+ "devDependencies": {
+ "tape": "^2.10.2"
+ },
+ "gitHead": "c578232a02cc2b46b6da8851caf57fdbfac89ff5",
+ "homepage": "https://github.com/mikeal/caseless#readme",
+ "_id": "caseless@0.11.0",
+ "_shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7",
+ "_from": "caseless@>=0.11.0 <0.12.0",
+ "_npmVersion": "2.8.3",
+ "_nodeVersion": "1.8.1",
+ "_npmUser": {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ {
+ "name": "nylen",
+ "email": "jnylen@gmail.com"
+ },
+ {
+ "name": "simov",
+ "email": "simeonvelichkov@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7",
+ "tarball": "http://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.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
new file mode 100644
index 000000000..084bbaf5e
--- /dev/null
+++ b/node_modules/request/node_modules/caseless/test.js
@@ -0,0 +1,40 @@
+var tape = require('tape')
+ , caseless = require('./')
+ ;
+
+tape('set get has', function (t) {
+ var headers = {}
+ , c = caseless(headers)
+ ;
+ t.plan(17)
+ c.set('a-Header', 'asdf')
+ t.equal(c.get('a-header'), 'asdf')
+ t.equal(c.has('a-header'), 'a-Header')
+ t.ok(!c.has('nothing'))
+ // old bug where we used the wrong regex
+ t.ok(!c.has('a-hea'))
+ c.set('a-header', 'fdsa')
+ t.equal(c.get('a-header'), 'fdsa')
+ t.equal(c.get('a-Header'), 'fdsa')
+ c.set('a-HEADER', 'more', false)
+ t.equal(c.get('a-header'), 'fdsa,more')
+
+ t.deepEqual(headers, {'a-Header': 'fdsa,more'})
+ c.swap('a-HEADER')
+ t.deepEqual(headers, {'a-HEADER': 'fdsa,more'})
+
+ c.set('deleteme', 'foobar')
+ t.ok(c.has('deleteme'))
+ t.ok(c.del('deleteme'))
+ t.notOk(c.has('deleteme'))
+ 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/License b/node_modules/request/node_modules/combined-stream/License
new file mode 100644
index 000000000..4804b7ab4
--- /dev/null
+++ b/node_modules/request/node_modules/combined-stream/License
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/request/node_modules/combined-stream/Readme.md b/node_modules/request/node_modules/combined-stream/Readme.md
new file mode 100644
index 000000000..3a9e025fb
--- /dev/null
+++ b/node_modules/request/node_modules/combined-stream/Readme.md
@@ -0,0 +1,138 @@
+# combined-stream
+
+A stream that emits multiple other streams one after another.
+
+**NB** Currently `combined-stream` works with streams vesrion 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatability with `combined-stream`.
+
+- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module.
+
+- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another.
+
+## Installation
+
+``` bash
+npm install combined-stream
+```
+
+## Usage
+
+Here is a simple example that shows how you can use combined-stream to combine
+two files into one:
+
+``` javascript
+var CombinedStream = require('combined-stream');
+var fs = require('fs');
+
+var combinedStream = CombinedStream.create();
+combinedStream.append(fs.createReadStream('file1.txt'));
+combinedStream.append(fs.createReadStream('file2.txt'));
+
+combinedStream.pipe(fs.createWriteStream('combined.txt'));
+```
+
+While the example above works great, it will pause all source streams until
+they are needed. If you don't want that to happen, you can set `pauseStreams`
+to `false`:
+
+``` javascript
+var CombinedStream = require('combined-stream');
+var fs = require('fs');
+
+var combinedStream = CombinedStream.create({pauseStreams: false});
+combinedStream.append(fs.createReadStream('file1.txt'));
+combinedStream.append(fs.createReadStream('file2.txt'));
+
+combinedStream.pipe(fs.createWriteStream('combined.txt'));
+```
+
+However, what if you don't have all the source streams yet, or you don't want
+to allocate the resources (file descriptors, memory, etc.) for them right away?
+Well, in that case you can simply provide a callback that supplies the stream
+by calling a `next()` function:
+
+``` javascript
+var CombinedStream = require('combined-stream');
+var fs = require('fs');
+
+var combinedStream = CombinedStream.create();
+combinedStream.append(function(next) {
+ next(fs.createReadStream('file1.txt'));
+});
+combinedStream.append(function(next) {
+ next(fs.createReadStream('file2.txt'));
+});
+
+combinedStream.pipe(fs.createWriteStream('combined.txt'));
+```
+
+## API
+
+### CombinedStream.create([options])
+
+Returns a new combined stream object. Available options are:
+
+* `maxDataSize`
+* `pauseStreams`
+
+The effect of those options is described below.
+
+### combinedStream.pauseStreams = `true`
+
+Whether to apply back pressure to the underlaying streams. If set to `false`,
+the underlaying streams will never be paused. If set to `true`, the
+underlaying streams will be paused right after being appended, as well as when
+`delayedStream.pipe()` wants to throttle.
+
+### combinedStream.maxDataSize = `2 * 1024 * 1024`
+
+The maximum amount of bytes (or characters) to buffer for all source streams.
+If this value is exceeded, `combinedStream` emits an `'error'` event.
+
+### combinedStream.dataSize = `0`
+
+The amount of bytes (or characters) currently buffered by `combinedStream`.
+
+### combinedStream.append(stream)
+
+Appends the given `stream` to the combinedStream object. If `pauseStreams` is
+set to `true, this stream will also be paused right away.
+
+`streams` can also be a function that takes one parameter called `next`. `next`
+is a function that must be invoked in order to provide the `next` stream, see
+example above.
+
+Regardless of how the `stream` is appended, combined-stream always attaches an
+`'error'` listener to it, so you don't have to do that manually.
+
+Special case: `stream` can also be a String or Buffer.
+
+### combinedStream.write(data)
+
+You should not call this, `combinedStream` takes care of piping the appended
+streams into itself for you.
+
+### combinedStream.resume()
+
+Causes `combinedStream` to start drain the streams it manages. The function is
+idempotent, and also emits a `'resume'` event each time which usually goes to
+the stream that is currently being drained.
+
+### combinedStream.pause();
+
+If `combinedStream.pauseStreams` is set to `false`, this does nothing.
+Otherwise a `'pause'` event is emitted, this goes to the stream that is
+currently being drained, so you can use it to apply back pressure.
+
+### combinedStream.end();
+
+Sets `combinedStream.writable` to false, emits an `'end'` event, and removes
+all streams from the queue.
+
+### combinedStream.destroy();
+
+Same as `combinedStream.end()`, except it emits a `'close'` event instead of
+`'end'`.
+
+## License
+
+combined-stream is licensed under the MIT license.
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
new file mode 100644
index 000000000..6b5c21b6b
--- /dev/null
+++ b/node_modules/request/node_modules/combined-stream/lib/combined_stream.js
@@ -0,0 +1,188 @@
+var util = require('util');
+var Stream = require('stream').Stream;
+var DelayedStream = require('delayed-stream');
+
+module.exports = CombinedStream;
+function CombinedStream() {
+ this.writable = false;
+ this.readable = true;
+ this.dataSize = 0;
+ this.maxDataSize = 2 * 1024 * 1024;
+ this.pauseStreams = true;
+
+ this._released = false;
+ this._streams = [];
+ this._currentStream = null;
+}
+util.inherits(CombinedStream, Stream);
+
+CombinedStream.create = function(options) {
+ var combinedStream = new this();
+
+ options = options || {};
+ for (var option in options) {
+ combinedStream[option] = options[option];
+ }
+
+ return combinedStream;
+};
+
+CombinedStream.isStreamLike = function(stream) {
+ return (typeof stream !== 'function')
+ && (typeof stream !== 'string')
+ && (typeof stream !== 'boolean')
+ && (typeof stream !== 'number')
+ && (!Buffer.isBuffer(stream));
+};
+
+CombinedStream.prototype.append = function(stream) {
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+
+ if (isStreamLike) {
+ if (!(stream instanceof DelayedStream)) {
+ var newStream = DelayedStream.create(stream, {
+ maxDataSize: Infinity,
+ pauseStream: this.pauseStreams,
+ });
+ stream.on('data', this._checkDataSize.bind(this));
+ stream = newStream;
+ }
+
+ this._handleErrors(stream);
+
+ if (this.pauseStreams) {
+ stream.pause();
+ }
+ }
+
+ this._streams.push(stream);
+ return this;
+};
+
+CombinedStream.prototype.pipe = function(dest, options) {
+ Stream.prototype.pipe.call(this, dest, options);
+ this.resume();
+ return dest;
+};
+
+CombinedStream.prototype._getNext = function() {
+ this._currentStream = null;
+ var stream = this._streams.shift();
+
+
+ if (typeof stream == 'undefined') {
+ this.end();
+ return;
+ }
+
+ if (typeof stream !== 'function') {
+ this._pipeNext(stream);
+ return;
+ }
+
+ var getStream = stream;
+ getStream(function(stream) {
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+ if (isStreamLike) {
+ stream.on('data', this._checkDataSize.bind(this));
+ this._handleErrors(stream);
+ }
+
+ this._pipeNext(stream);
+ }.bind(this));
+};
+
+CombinedStream.prototype._pipeNext = function(stream) {
+ this._currentStream = stream;
+
+ var isStreamLike = CombinedStream.isStreamLike(stream);
+ if (isStreamLike) {
+ stream.on('end', this._getNext.bind(this));
+ stream.pipe(this, {end: false});
+ return;
+ }
+
+ var value = stream;
+ this.write(value);
+ this._getNext();
+};
+
+CombinedStream.prototype._handleErrors = function(stream) {
+ var self = this;
+ stream.on('error', function(err) {
+ self._emitError(err);
+ });
+};
+
+CombinedStream.prototype.write = function(data) {
+ this.emit('data', data);
+};
+
+CombinedStream.prototype.pause = function() {
+ if (!this.pauseStreams) {
+ return;
+ }
+
+ if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();
+ this.emit('pause');
+};
+
+CombinedStream.prototype.resume = function() {
+ if (!this._released) {
+ this._released = true;
+ this.writable = true;
+ this._getNext();
+ }
+
+ if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();
+ this.emit('resume');
+};
+
+CombinedStream.prototype.end = function() {
+ this._reset();
+ this.emit('end');
+};
+
+CombinedStream.prototype.destroy = function() {
+ this._reset();
+ this.emit('close');
+};
+
+CombinedStream.prototype._reset = function() {
+ this.writable = false;
+ this._streams = [];
+ this._currentStream = null;
+};
+
+CombinedStream.prototype._checkDataSize = function() {
+ this._updateDataSize();
+ if (this.dataSize <= this.maxDataSize) {
+ return;
+ }
+
+ var message =
+ 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';
+ this._emitError(new Error(message));
+};
+
+CombinedStream.prototype._updateDataSize = function() {
+ this.dataSize = 0;
+
+ var self = this;
+ this._streams.forEach(function(stream) {
+ if (!stream.dataSize) {
+ return;
+ }
+
+ self.dataSize += stream.dataSize;
+ });
+
+ if (this._currentStream && this._currentStream.dataSize) {
+ this.dataSize += this._currentStream.dataSize;
+ }
+};
+
+CombinedStream.prototype._emitError = function(err) {
+ this._reset();
+ this.emit('error', err);
+};
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore
new file mode 100644
index 000000000..9daeafb98
--- /dev/null
+++ b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore
@@ -0,0 +1 @@
+test
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License
new file mode 100644
index 000000000..4804b7ab4
--- /dev/null
+++ b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile
new file mode 100644
index 000000000..b4ff85a33
--- /dev/null
+++ b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile
@@ -0,0 +1,7 @@
+SHELL := /bin/bash
+
+test:
+ @./test/run.js
+
+.PHONY: test
+
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md
new file mode 100644
index 000000000..aca36f9f0
--- /dev/null
+++ b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md
@@ -0,0 +1,141 @@
+# delayed-stream
+
+Buffers events from a stream until you are ready to handle them.
+
+## Installation
+
+``` bash
+npm install delayed-stream
+```
+
+## Usage
+
+The following example shows how to write a http echo server that delays its
+response by 1000 ms.
+
+``` javascript
+var DelayedStream = require('delayed-stream');
+var http = require('http');
+
+http.createServer(function(req, res) {
+ var delayed = DelayedStream.create(req);
+
+ setTimeout(function() {
+ res.writeHead(200);
+ delayed.pipe(res);
+ }, 1000);
+});
+```
+
+If you are not using `Stream#pipe`, you can also manually release the buffered
+events by calling `delayedStream.resume()`:
+
+``` javascript
+var delayed = DelayedStream.create(req);
+
+setTimeout(function() {
+ // Emit all buffered events and resume underlaying source
+ delayed.resume();
+}, 1000);
+```
+
+## Implementation
+
+In order to use this meta stream properly, here are a few things you should
+know about the implementation.
+
+### Event Buffering / Proxying
+
+All events of the `source` stream are hijacked by overwriting the `source.emit`
+method. Until node implements a catch-all event listener, this is the only way.
+
+However, delayed-stream still continues to emit all events it captures on the
+`source`, regardless of whether you have released the delayed stream yet or
+not.
+
+Upon creation, delayed-stream captures all `source` events and stores them in
+an internal event buffer. Once `delayedStream.release()` is called, all
+buffered events are emitted on the `delayedStream`, and the event buffer is
+cleared. After that, delayed-stream merely acts as a proxy for the underlaying
+source.
+
+### Error handling
+
+Error events on `source` are buffered / proxied just like any other events.
+However, `delayedStream.create` attaches a no-op `'error'` listener to the
+`source`. This way you only have to handle errors on the `delayedStream`
+object, rather than in two places.
+
+### Buffer limits
+
+delayed-stream provides a `maxDataSize` property that can be used to limit
+the amount of data being buffered. In order to protect you from bad `source`
+streams that don't react to `source.pause()`, this feature is enabled by
+default.
+
+## API
+
+### DelayedStream.create(source, [options])
+
+Returns a new `delayedStream`. Available options are:
+
+* `pauseStream`
+* `maxDataSize`
+
+The description for those properties can be found below.
+
+### delayedStream.source
+
+The `source` stream managed by this object. This is useful if you are
+passing your `delayedStream` around, and you still want to access properties
+on the `source` object.
+
+### delayedStream.pauseStream = true
+
+Whether to pause the underlaying `source` when calling
+`DelayedStream.create()`. Modifying this property afterwards has no effect.
+
+### delayedStream.maxDataSize = 1024 * 1024
+
+The amount of data to buffer before emitting an `error`.
+
+If the underlaying source is emitting `Buffer` objects, the `maxDataSize`
+refers to bytes.
+
+If the underlaying source is emitting JavaScript strings, the size refers to
+characters.
+
+If you know what you are doing, you can set this property to `Infinity` to
+disable this feature. You can also modify this property during runtime.
+
+### delayedStream.dataSize = 0
+
+The amount of data buffered so far.
+
+### delayedStream.readable
+
+An ECMA5 getter that returns the value of `source.readable`.
+
+### delayedStream.resume()
+
+If the `delayedStream` has not been released so far, `delayedStream.release()`
+is called.
+
+In either case, `source.resume()` is called.
+
+### delayedStream.pause()
+
+Calls `source.pause()`.
+
+### delayedStream.pipe(dest)
+
+Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.
+
+### delayedStream.release()
+
+Emits and clears all events that have been buffered up so far. This does not
+resume the underlaying source, use `delayedStream.resume()` instead.
+
+## License
+
+delayed-stream is licensed under the MIT license.
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js
new file mode 100644
index 000000000..b38fc85ff
--- /dev/null
+++ b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js
@@ -0,0 +1,107 @@
+var Stream = require('stream').Stream;
+var util = require('util');
+
+module.exports = DelayedStream;
+function DelayedStream() {
+ this.source = null;
+ this.dataSize = 0;
+ this.maxDataSize = 1024 * 1024;
+ this.pauseStream = true;
+
+ this._maxDataSizeExceeded = false;
+ this._released = false;
+ this._bufferedEvents = [];
+}
+util.inherits(DelayedStream, Stream);
+
+DelayedStream.create = function(source, options) {
+ var delayedStream = new this();
+
+ options = options || {};
+ for (var option in options) {
+ delayedStream[option] = options[option];
+ }
+
+ delayedStream.source = source;
+
+ var realEmit = source.emit;
+ source.emit = function() {
+ delayedStream._handleEmit(arguments);
+ return realEmit.apply(source, arguments);
+ };
+
+ source.on('error', function() {});
+ if (delayedStream.pauseStream) {
+ source.pause();
+ }
+
+ return delayedStream;
+};
+
+Object.defineProperty(DelayedStream.prototype, 'readable', {
+ configurable: true,
+ enumerable: true,
+ get: function() {
+ return this.source.readable;
+ }
+});
+
+DelayedStream.prototype.setEncoding = function() {
+ return this.source.setEncoding.apply(this.source, arguments);
+};
+
+DelayedStream.prototype.resume = function() {
+ if (!this._released) {
+ this.release();
+ }
+
+ this.source.resume();
+};
+
+DelayedStream.prototype.pause = function() {
+ this.source.pause();
+};
+
+DelayedStream.prototype.release = function() {
+ this._released = true;
+
+ this._bufferedEvents.forEach(function(args) {
+ this.emit.apply(this, args);
+ }.bind(this));
+ this._bufferedEvents = [];
+};
+
+DelayedStream.prototype.pipe = function() {
+ var r = Stream.prototype.pipe.apply(this, arguments);
+ this.resume();
+ return r;
+};
+
+DelayedStream.prototype._handleEmit = function(args) {
+ if (this._released) {
+ this.emit.apply(this, args);
+ return;
+ }
+
+ if (args[0] === 'data') {
+ this.dataSize += args[1].length;
+ this._checkIfMaxDataSizeExceeded();
+ }
+
+ this._bufferedEvents.push(args);
+};
+
+DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
+ if (this._maxDataSizeExceeded) {
+ return;
+ }
+
+ if (this.dataSize <= this.maxDataSize) {
+ return;
+ }
+
+ this._maxDataSizeExceeded = true;
+ var message =
+ 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
+ this.emit('error', new Error(message));
+};
diff --git a/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json
new file mode 100644
index 000000000..8ac66b814
--- /dev/null
+++ b/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json
@@ -0,0 +1,64 @@
+{
+ "author": {
+ "name": "Felix Geisendörfer",
+ "email": "felix@debuggable.com",
+ "url": "http://debuggable.com/"
+ },
+ "contributors": [
+ {
+ "name": "Mike Atkins",
+ "email": "apeherder@gmail.com"
+ }
+ ],
+ "name": "delayed-stream",
+ "description": "Buffers events from a stream until you are ready to handle them.",
+ "license": "MIT",
+ "version": "1.0.0",
+ "homepage": "https://github.com/felixge/node-delayed-stream",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/felixge/node-delayed-stream.git"
+ },
+ "main": "./lib/delayed_stream",
+ "engines": {
+ "node": ">=0.4.0"
+ },
+ "scripts": {
+ "test": "make test"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "fake": "0.2.0",
+ "far": "0.0.1"
+ },
+ "gitHead": "07a9dc99fb8f1a488160026b9ad77493f766fb84",
+ "bugs": {
+ "url": "https://github.com/felixge/node-delayed-stream/issues"
+ },
+ "_id": "delayed-stream@1.0.0",
+ "_shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619",
+ "_from": "delayed-stream@>=1.0.0 <1.1.0",
+ "_npmVersion": "2.8.3",
+ "_nodeVersion": "1.6.4",
+ "_npmUser": {
+ "name": "apechimp",
+ "email": "apeherder@gmail.com"
+ },
+ "dist": {
+ "shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619",
+ "tarball": "http://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "felixge",
+ "email": "felix@debuggable.com"
+ },
+ {
+ "name": "apechimp",
+ "email": "apeherder@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/combined-stream/package.json b/node_modules/request/node_modules/combined-stream/package.json
new file mode 100644
index 000000000..e0cd160ff
--- /dev/null
+++ b/node_modules/request/node_modules/combined-stream/package.json
@@ -0,0 +1,67 @@
+{
+ "author": {
+ "name": "Felix Geisendörfer",
+ "email": "felix@debuggable.com",
+ "url": "http://debuggable.com/"
+ },
+ "name": "combined-stream",
+ "description": "A stream that emits multiple other streams one after another.",
+ "version": "1.0.5",
+ "homepage": "https://github.com/felixge/node-combined-stream",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/felixge/node-combined-stream.git"
+ },
+ "main": "./lib/combined_stream",
+ "scripts": {
+ "test": "node test/run.js"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "dependencies": {
+ "delayed-stream": "~1.0.0"
+ },
+ "devDependencies": {
+ "far": "~0.0.7"
+ },
+ "license": "MIT",
+ "gitHead": "cfc7b815d090a109bcedb5bb0f6713148d55a6b7",
+ "bugs": {
+ "url": "https://github.com/felixge/node-combined-stream/issues"
+ },
+ "_id": "combined-stream@1.0.5",
+ "_shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009",
+ "_from": "combined-stream@>=1.0.5 <1.1.0",
+ "_npmVersion": "2.10.1",
+ "_nodeVersion": "0.12.4",
+ "_npmUser": {
+ "name": "alexindigo",
+ "email": "iam@alexindigo.com"
+ },
+ "dist": {
+ "shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009",
+ "tarball": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "felixge",
+ "email": "felix@debuggable.com"
+ },
+ {
+ "name": "celer",
+ "email": "dtyree77@gmail.com"
+ },
+ {
+ "name": "alexindigo",
+ "email": "iam@alexindigo.com"
+ },
+ {
+ "name": "apechimp",
+ "email": "apeherder@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/extend/.jscs.json b/node_modules/request/node_modules/extend/.jscs.json
new file mode 100644
index 000000000..7e84b282b
--- /dev/null
+++ b/node_modules/request/node_modules/extend/.jscs.json
@@ -0,0 +1,104 @@
+{
+ "additionalRules": [],
+
+ "requireSemicolons": true,
+
+ "disallowMultipleSpaces": true,
+
+ "disallowIdentifierNames": [],
+
+ "requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
+
+ "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"],
+
+ "disallowSpaceAfterKeywords": [],
+
+ "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true },
+ "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
+ "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
+ "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true },
+ "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true },
+
+ "requireSpaceBetweenArguments": true,
+
+ "disallowSpacesInsideParentheses": true,
+
+ "disallowSpacesInsideArrayBrackets": true,
+
+ "disallowQuotedKeysInObjects": "allButReserved",
+
+ "disallowSpaceAfterObjectKeys": true,
+
+ "requireCommaBeforeLineBreak": true,
+
+ "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
+ "requireSpaceAfterPrefixUnaryOperators": [],
+
+ "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
+ "requireSpaceBeforePostfixUnaryOperators": [],
+
+ "disallowSpaceBeforeBinaryOperators": [],
+ "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
+
+ "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
+ "disallowSpaceAfterBinaryOperators": [],
+
+ "disallowImplicitTypeConversion": ["binary", "string"],
+
+ "disallowKeywords": ["with", "eval"],
+
+ "requireKeywordsOnNewLine": [],
+ "disallowKeywordsOnNewLine": ["else"],
+
+ "requireLineFeedAtFileEnd": true,
+
+ "disallowTrailingWhitespace": true,
+
+ "disallowTrailingComma": true,
+
+ "excludeFiles": ["node_modules/**", "vendor/**"],
+
+ "disallowMultipleLineStrings": true,
+
+ "requireDotNotation": true,
+
+ "requireParenthesesAroundIIFE": true,
+
+ "validateLineBreaks": "LF",
+
+ "validateQuoteMarks": {
+ "escape": true,
+ "mark": "'"
+ },
+
+ "disallowOperatorBeforeLineBreak": [],
+
+ "requireSpaceBeforeKeywords": [
+ "do",
+ "for",
+ "if",
+ "else",
+ "switch",
+ "case",
+ "try",
+ "catch",
+ "finally",
+ "while",
+ "with",
+ "return"
+ ],
+
+ "validateAlignedFunctionParameters": {
+ "lineBreakAfterOpeningBraces": true,
+ "lineBreakBeforeClosingBraces": true
+ },
+
+ "requirePaddingNewLinesBeforeExport": true,
+
+ "validateNewlineAfterArrayElements": {
+ "maximum": 6
+ },
+
+ "requirePaddingNewLinesAfterUseStrict": true
+}
+
diff --git a/node_modules/request/node_modules/extend/.npmignore b/node_modules/request/node_modules/extend/.npmignore
new file mode 100644
index 000000000..30d74d258
--- /dev/null
+++ b/node_modules/request/node_modules/extend/.npmignore
@@ -0,0 +1 @@
+test \ No newline at end of file
diff --git a/node_modules/request/node_modules/extend/.travis.yml b/node_modules/request/node_modules/extend/.travis.yml
new file mode 100644
index 000000000..ebef64499
--- /dev/null
+++ b/node_modules/request/node_modules/extend/.travis.yml
@@ -0,0 +1,44 @@
+language: node_js
+node_js:
+ - "iojs-v2.3"
+ - "iojs-v2.2"
+ - "iojs-v2.1"
+ - "iojs-v2.0"
+ - "iojs-v1.8"
+ - "iojs-v1.7"
+ - "iojs-v1.6"
+ - "iojs-v1.5"
+ - "iojs-v1.4"
+ - "iojs-v1.3"
+ - "iojs-v1.2"
+ - "iojs-v1.1"
+ - "iojs-v1.0"
+ - "0.12"
+ - "0.11"
+ - "0.10"
+ - "0.9"
+ - "0.8"
+ - "0.6"
+ - "0.4"
+before_install:
+ - '[ "${TRAVIS_NODE_VERSION}" = "0.6" ] || npm install -g npm@1.4.28 && npm install -g npm'
+sudo: false
+matrix:
+ fast_finish: true
+ allow_failures:
+ - node_js: "iojs-v2.2"
+ - node_js: "iojs-v2.1"
+ - node_js: "iojs-v2.0"
+ - node_js: "iojs-v1.7"
+ - node_js: "iojs-v1.6"
+ - node_js: "iojs-v1.5"
+ - node_js: "iojs-v1.4"
+ - node_js: "iojs-v1.3"
+ - node_js: "iojs-v1.2"
+ - node_js: "iojs-v1.1"
+ - node_js: "iojs-v1.0"
+ - node_js: "0.11"
+ - node_js: "0.9"
+ - node_js: "0.8"
+ - node_js: "0.6"
+ - node_js: "0.4"
diff --git a/node_modules/request/node_modules/extend/CHANGELOG.md b/node_modules/request/node_modules/extend/CHANGELOG.md
new file mode 100644
index 000000000..ee0cfd6ad
--- /dev/null
+++ b/node_modules/request/node_modules/extend/CHANGELOG.md
@@ -0,0 +1,69 @@
+3.0.0 / 2015-07-01
+==================
+ * [Possible breaking change] Use global "strict" directive (#32)
+ * [Tests] `int` is an ES3 reserved word
+ * [Tests] Test up to `io.js` `v2.3`
+ * [Tests] Add `npm run eslint`
+ * [Dev Deps] Update `covert`, `jscs`
+
+2.0.1 / 2015-04-25
+==================
+ * Use an inline `isArray` check, for ES3 browsers. (#27)
+ * Some old browsers fail when an identifier is `toString`
+ * Test latest `node` and `io.js` versions on `travis-ci`; speed up builds
+ * Add license info to package.json (#25)
+ * Update `tape`, `jscs`
+ * Adding a CHANGELOG
+
+2.0.0 / 2014-10-01
+==================
+ * Increase code coverage to 100%; run code coverage as part of tests
+ * Add `npm run lint`; Run linter as part of tests
+ * Remove nodeType and setInterval checks in isPlainObject
+ * Updating `tape`, `jscs`, `covert`
+ * General style and README cleanup
+
+1.3.0 / 2014-06-20
+==================
+ * Add component.json for browser support (#18)
+ * Use SVG for badges in README (#16)
+ * Updating `tape`, `covert`
+ * Updating travis-ci to work with multiple node versions
+ * Fix `deep === false` bug (returning target as {}) (#14)
+ * Fixing constructor checks in isPlainObject
+ * Adding additional test coverage
+ * Adding `npm run coverage`
+ * Add LICENSE (#13)
+ * Adding a warning about `false`, per #11
+ * General style and whitespace cleanup
+
+1.2.1 / 2013-09-14
+==================
+ * Fixing hasOwnProperty bugs that would only have shown up in specific browsers. Fixes #8
+ * Updating `tape`
+
+1.2.0 / 2013-09-02
+==================
+ * Updating the README: add badges
+ * Adding a missing variable reference.
+ * Using `tape` instead of `buster` for tests; add more tests (#7)
+ * Adding node 0.10 to Travis CI (#6)
+ * Enabling "npm test" and cleaning up package.json (#5)
+ * Add Travis CI.
+
+1.1.3 / 2012-12-06
+==================
+ * Added unit tests.
+ * Ensure extend function is named. (Looks nicer in a stack trace.)
+ * README cleanup.
+
+1.1.1 / 2012-11-07
+==================
+ * README cleanup.
+ * Added installation instructions.
+ * Added a missing semicolon
+
+1.0.0 / 2012-04-08
+==================
+ * Initial commit
+
diff --git a/node_modules/request/node_modules/extend/LICENSE b/node_modules/request/node_modules/extend/LICENSE
new file mode 100644
index 000000000..e16d6a56c
--- /dev/null
+++ b/node_modules/request/node_modules/extend/LICENSE
@@ -0,0 +1,23 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Stefan Thomas
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/node_modules/request/node_modules/extend/README.md b/node_modules/request/node_modules/extend/README.md
new file mode 100644
index 000000000..632fb0f96
--- /dev/null
+++ b/node_modules/request/node_modules/extend/README.md
@@ -0,0 +1,62 @@
+[![Build Status][travis-svg]][travis-url]
+[![dependency status][deps-svg]][deps-url]
+[![dev dependency status][dev-deps-svg]][dev-deps-url]
+
+# extend() for Node.js <sup>[![Version Badge][npm-version-png]][npm-url]</sup>
+
+`node-extend` is a port of the classic extend() method from jQuery. It behaves as you expect. It is simple, tried and true.
+
+## Installation
+
+This package is available on [npm][npm-url] as: `extend`
+
+``` sh
+npm install extend
+```
+
+## Usage
+
+**Syntax:** extend **(** [`deep`], `target`, `object1`, [`objectN`] **)**
+
+*Extend one object with one or more others, returning the modified object.*
+
+Keep in mind that the target object will be modified, and will be returned from extend().
+
+If a boolean true is specified as the first argument, extend performs a deep copy, recursively copying any objects it finds. Otherwise, the copy will share structure with the original object(s).
+Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over.
+Warning: passing `false` as the first argument is not supported.
+
+### Arguments
+
+* `deep` *Boolean* (optional)
+If set, the merge becomes recursive (i.e. deep copy).
+* `target` *Object*
+The object to extend.
+* `object1` *Object*
+The object that will be merged into the first.
+* `objectN` *Object* (Optional)
+More objects to merge into the first.
+
+## License
+
+`node-extend` is licensed under the [MIT License][mit-license-url].
+
+## Acknowledgements
+
+All credit to the jQuery authors for perfecting this amazing utility.
+
+Ported to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jonathan Buchanan][github-insin] and [Jordan Harband][github-ljharb].
+
+[travis-svg]: https://travis-ci.org/justmoon/node-extend.svg
+[travis-url]: https://travis-ci.org/justmoon/node-extend
+[npm-url]: https://npmjs.org/package/extend
+[mit-license-url]: http://opensource.org/licenses/MIT
+[github-justmoon]: https://github.com/justmoon
+[github-insin]: https://github.com/insin
+[github-ljharb]: https://github.com/ljharb
+[npm-version-png]: http://vb.teelaun.ch/justmoon/node-extend.svg
+[deps-svg]: https://david-dm.org/justmoon/node-extend.svg
+[deps-url]: https://david-dm.org/justmoon/node-extend
+[dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg
+[dev-deps-url]: https://david-dm.org/justmoon/node-extend#info=devDependencies
+
diff --git a/node_modules/request/node_modules/extend/component.json b/node_modules/request/node_modules/extend/component.json
new file mode 100644
index 000000000..1500a2f37
--- /dev/null
+++ b/node_modules/request/node_modules/extend/component.json
@@ -0,0 +1,32 @@
+{
+ "name": "extend",
+ "author": "Stefan Thomas <justmoon@members.fsf.org> (http://www.justmoon.net)",
+ "version": "3.0.0",
+ "description": "Port of jQuery.extend for node.js and the browser.",
+ "scripts": [
+ "index.js"
+ ],
+ "contributors": [
+ {
+ "name": "Jordan Harband",
+ "url": "https://github.com/ljharb"
+ }
+ ],
+ "keywords": [
+ "extend",
+ "clone",
+ "merge"
+ ],
+ "repository" : {
+ "type": "git",
+ "url": "https://github.com/justmoon/node-extend.git"
+ },
+ "dependencies": {
+ },
+ "devDependencies": {
+ "tape" : "~3.0.0",
+ "covert": "~0.4.0",
+ "jscs": "~1.6.2"
+ }
+}
+
diff --git a/node_modules/request/node_modules/extend/index.js b/node_modules/request/node_modules/extend/index.js
new file mode 100644
index 000000000..f5ec75d52
--- /dev/null
+++ b/node_modules/request/node_modules/extend/index.js
@@ -0,0 +1,86 @@
+'use strict';
+
+var hasOwn = Object.prototype.hasOwnProperty;
+var toStr = Object.prototype.toString;
+
+var isArray = function isArray(arr) {
+ if (typeof Array.isArray === 'function') {
+ return Array.isArray(arr);
+ }
+
+ return toStr.call(arr) === '[object Array]';
+};
+
+var isPlainObject = function isPlainObject(obj) {
+ if (!obj || toStr.call(obj) !== '[object Object]') {
+ return false;
+ }
+
+ var hasOwnConstructor = hasOwn.call(obj, 'constructor');
+ var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
+ // Not own constructor property must be Object
+ if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+ var key;
+ for (key in obj) {/**/}
+
+ return typeof key === 'undefined' || hasOwn.call(obj, key);
+};
+
+module.exports = function extend() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[0],
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if (typeof target === 'boolean') {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ } else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) {
+ target = {};
+ }
+
+ for (; i < length; ++i) {
+ options = arguments[i];
+ // Only deal with non-null/undefined values
+ if (options != null) {
+ // Extend the base object
+ for (name in options) {
+ src = target[name];
+ copy = options[name];
+
+ // Prevent never-ending loop
+ if (target !== copy) {
+ // Recurse if we're merging plain objects or arrays
+ if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
+ if (copyIsArray) {
+ copyIsArray = false;
+ clone = src && isArray(src) ? src : [];
+ } else {
+ clone = src && isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[name] = extend(deep, clone, copy);
+
+ // Don't bring in undefined values
+ } else if (typeof copy !== 'undefined') {
+ target[name] = copy;
+ }
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
diff --git a/node_modules/request/node_modules/extend/package.json b/node_modules/request/node_modules/extend/package.json
new file mode 100644
index 000000000..c8c7cac99
--- /dev/null
+++ b/node_modules/request/node_modules/extend/package.json
@@ -0,0 +1,73 @@
+{
+ "name": "extend",
+ "author": {
+ "name": "Stefan Thomas",
+ "email": "justmoon@members.fsf.org",
+ "url": "http://www.justmoon.net"
+ },
+ "version": "3.0.0",
+ "description": "Port of jQuery.extend for node.js and the browser",
+ "main": "index",
+ "scripts": {
+ "test": "npm run lint && node test/index.js && npm run coverage-quiet",
+ "coverage": "covert test/index.js",
+ "coverage-quiet": "covert test/index.js --quiet",
+ "lint": "npm run jscs && npm run eslint",
+ "jscs": "jscs *.js */*.js",
+ "eslint": "eslint *.js */*.js"
+ },
+ "contributors": [
+ {
+ "name": "Jordan Harband",
+ "url": "https://github.com/ljharb"
+ }
+ ],
+ "keywords": [
+ "extend",
+ "clone",
+ "merge"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/justmoon/node-extend.git"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "tape": "^4.0.0",
+ "covert": "^1.1.0",
+ "jscs": "^1.13.1",
+ "eslint": "^0.24.0"
+ },
+ "license": "MIT",
+ "gitHead": "148e7270cab2e9413af2cd0cab147070d755ed6d",
+ "bugs": {
+ "url": "https://github.com/justmoon/node-extend/issues"
+ },
+ "homepage": "https://github.com/justmoon/node-extend#readme",
+ "_id": "extend@3.0.0",
+ "_shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4",
+ "_from": "extend@>=3.0.0 <3.1.0",
+ "_npmVersion": "2.11.3",
+ "_nodeVersion": "2.3.1",
+ "_npmUser": {
+ "name": "ljharb",
+ "email": "ljharb@gmail.com"
+ },
+ "dist": {
+ "shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4",
+ "tarball": "http://registry.npmjs.org/extend/-/extend-3.0.0.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "justmoon",
+ "email": "justmoon@members.fsf.org"
+ },
+ {
+ "name": "ljharb",
+ "email": "ljharb@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/forever-agent/LICENSE b/node_modules/request/node_modules/forever-agent/LICENSE
new file mode 100644
index 000000000..a4a9aee0c
--- /dev/null
+++ b/node_modules/request/node_modules/forever-agent/LICENSE
@@ -0,0 +1,55 @@
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS \ No newline at end of file
diff --git a/node_modules/request/node_modules/forever-agent/README.md b/node_modules/request/node_modules/forever-agent/README.md
new file mode 100644
index 000000000..9d5b66343
--- /dev/null
+++ b/node_modules/request/node_modules/forever-agent/README.md
@@ -0,0 +1,4 @@
+forever-agent
+=============
+
+HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.
diff --git a/node_modules/request/node_modules/forever-agent/index.js b/node_modules/request/node_modules/forever-agent/index.js
new file mode 100644
index 000000000..416c7abd7
--- /dev/null
+++ b/node_modules/request/node_modules/forever-agent/index.js
@@ -0,0 +1,138 @@
+module.exports = ForeverAgent
+ForeverAgent.SSL = ForeverAgentSSL
+
+var util = require('util')
+ , Agent = require('http').Agent
+ , net = require('net')
+ , tls = require('tls')
+ , AgentSSL = require('https').Agent
+
+function getConnectionName(host, port) {
+ var name = ''
+ if (typeof host === 'string') {
+ name = host + ':' + port
+ } else {
+ // For node.js v012.0 and iojs-v1.5.1, host is an object. And any existing localAddress is part of the connection name.
+ name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':')
+ }
+ return name
+}
+
+function ForeverAgent(options) {
+ var self = this
+ self.options = options || {}
+ self.requests = {}
+ self.sockets = {}
+ self.freeSockets = {}
+ self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets
+ self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets
+ self.on('free', function(socket, host, port) {
+ var name = getConnectionName(host, port)
+
+ if (self.requests[name] && self.requests[name].length) {
+ self.requests[name].shift().onSocket(socket)
+ } else if (self.sockets[name].length < self.minSockets) {
+ if (!self.freeSockets[name]) self.freeSockets[name] = []
+ self.freeSockets[name].push(socket)
+
+ // if an error happens while we don't use the socket anyway, meh, throw the socket away
+ var onIdleError = function() {
+ socket.destroy()
+ }
+ socket._onIdleError = onIdleError
+ socket.on('error', onIdleError)
+ } else {
+ // If there are no pending requests just destroy the
+ // socket and it will get removed from the pool. This
+ // gets us out of timeout issues and allows us to
+ // default to Connection:keep-alive.
+ socket.destroy()
+ }
+ })
+
+}
+util.inherits(ForeverAgent, Agent)
+
+ForeverAgent.defaultMinSockets = 5
+
+
+ForeverAgent.prototype.createConnection = net.createConnection
+ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest
+ForeverAgent.prototype.addRequest = function(req, host, port) {
+ var name = getConnectionName(host, port)
+
+ if (typeof host !== 'string') {
+ var options = host
+ port = options.port
+ host = options.host
+ }
+
+ if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) {
+ var idleSocket = this.freeSockets[name].pop()
+ idleSocket.removeListener('error', idleSocket._onIdleError)
+ delete idleSocket._onIdleError
+ req._reusedSocket = true
+ req.onSocket(idleSocket)
+ } else {
+ this.addRequestNoreuse(req, host, port)
+ }
+}
+
+ForeverAgent.prototype.removeSocket = function(s, name, host, port) {
+ if (this.sockets[name]) {
+ var index = this.sockets[name].indexOf(s)
+ if (index !== -1) {
+ this.sockets[name].splice(index, 1)
+ }
+ } else if (this.sockets[name] && this.sockets[name].length === 0) {
+ // don't leak
+ delete this.sockets[name]
+ delete this.requests[name]
+ }
+
+ if (this.freeSockets[name]) {
+ var index = this.freeSockets[name].indexOf(s)
+ if (index !== -1) {
+ this.freeSockets[name].splice(index, 1)
+ if (this.freeSockets[name].length === 0) {
+ delete this.freeSockets[name]
+ }
+ }
+ }
+
+ if (this.requests[name] && this.requests[name].length) {
+ // If we have pending requests and a socket gets closed a new one
+ // needs to be created to take over in the pool for the one that closed.
+ this.createSocket(name, host, port).emit('free')
+ }
+}
+
+function ForeverAgentSSL (options) {
+ ForeverAgent.call(this, options)
+}
+util.inherits(ForeverAgentSSL, ForeverAgent)
+
+ForeverAgentSSL.prototype.createConnection = createConnectionSSL
+ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest
+
+function createConnectionSSL (port, host, options) {
+ if (typeof port === 'object') {
+ options = port;
+ } else if (typeof host === 'object') {
+ options = host;
+ } else if (typeof options === 'object') {
+ options = options;
+ } else {
+ options = {};
+ }
+
+ if (typeof port === 'number') {
+ options.port = port;
+ }
+
+ if (typeof host === 'string') {
+ options.host = host;
+ }
+
+ return tls.connect(options);
+}
diff --git a/node_modules/request/node_modules/forever-agent/package.json b/node_modules/request/node_modules/forever-agent/package.json
new file mode 100644
index 000000000..1d672c1c9
--- /dev/null
+++ b/node_modules/request/node_modules/forever-agent/package.json
@@ -0,0 +1,31 @@
+{
+ "author": {
+ "name": "Mikeal Rogers",
+ "email": "mikeal.rogers@gmail.com",
+ "url": "http://www.futurealoof.com"
+ },
+ "name": "forever-agent",
+ "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.",
+ "version": "0.6.1",
+ "license": "Apache-2.0",
+ "repository": {
+ "url": "git+https://github.com/mikeal/forever-agent.git"
+ },
+ "main": "index.js",
+ "dependencies": {},
+ "devDependencies": {},
+ "optionalDependencies": {},
+ "engines": {
+ "node": "*"
+ },
+ "readme": "forever-agent\n=============\n\nHTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/mikeal/forever-agent/issues"
+ },
+ "homepage": "https://github.com/mikeal/forever-agent#readme",
+ "_id": "forever-agent@0.6.1",
+ "_shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91",
+ "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
+ "_from": "forever-agent@>=0.6.1 <0.7.0"
+}
diff --git a/node_modules/request/node_modules/form-data/License b/node_modules/request/node_modules/form-data/License
new file mode 100644
index 000000000..c7ff12a2f
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/License
@@ -0,0 +1,19 @@
+Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
diff --git a/node_modules/request/node_modules/form-data/Readme.md b/node_modules/request/node_modules/form-data/Readme.md
new file mode 100644
index 000000000..492773231
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/Readme.md
@@ -0,0 +1,210 @@
+# Form-Data [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data) [![Build Status](https://img.shields.io/travis/form-data/form-data/master.svg)](https://travis-ci.org/form-data/form-data) [![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data)
+
+A library to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications.
+
+The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].
+
+[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface
+[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions
+
+## Install
+
+```
+npm install form-data
+```
+
+## Usage
+
+In this example we are constructing a form with 3 fields that contain a string,
+a buffer and a file stream.
+
+``` javascript
+var FormData = require('form-data');
+var fs = require('fs');
+
+var form = new FormData();
+form.append('my_field', 'my value');
+form.append('my_buffer', new Buffer(10));
+form.append('my_file', fs.createReadStream('/foo/bar.jpg'));
+```
+
+Also you can use http-response stream:
+
+``` javascript
+var FormData = require('form-data');
+var http = require('http');
+
+var form = new FormData();
+
+http.request('http://nodejs.org/images/logo.png', function(response) {
+ form.append('my_field', 'my value');
+ form.append('my_buffer', new Buffer(10));
+ form.append('my_logo', response);
+});
+```
+
+Or @mikeal's [request](https://github.com/request/request) stream:
+
+``` javascript
+var FormData = require('form-data');
+var request = require('request');
+
+var form = new FormData();
+
+form.append('my_field', 'my value');
+form.append('my_buffer', new Buffer(10));
+form.append('my_logo', request('http://nodejs.org/images/logo.png'));
+```
+
+In order to submit this form to a web application, call ```submit(url, [callback])``` method:
+
+``` javascript
+form.submit('http://example.org/', function(err, res) {
+ // res – response object (http.IncomingMessage) //
+ res.resume();
+});
+
+```
+
+For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.
+
+### Alternative submission methods
+
+You can use node's http client interface:
+
+``` javascript
+var http = require('http');
+
+var request = http.request({
+ method: 'post',
+ host: 'example.org',
+ path: '/upload',
+ headers: form.getHeaders()
+});
+
+form.pipe(request);
+
+request.on('response', function(res) {
+ console.log(res.statusCode);
+});
+```
+
+Or if you would prefer the `'Content-Length'` header to be set for you:
+
+``` javascript
+form.submit('example.org/upload', function(err, res) {
+ console.log(res.statusCode);
+});
+```
+
+To use custom headers and pre-known length in parts:
+
+``` javascript
+var CRLF = '\r\n';
+var form = new FormData();
+
+var options = {
+ header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,
+ knownLength: 1
+};
+
+form.append('my_buffer', buffer, options);
+
+form.submit('http://example.com/', function(err, res) {
+ if (err) throw err;
+ console.log('Done');
+});
+```
+
+Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually:
+
+``` javascript
+someModule.stream(function(err, stdout, stderr) {
+ if (err) throw err;
+
+ var form = new FormData();
+
+ form.append('file', stdout, {
+ filename: 'unicycle.jpg',
+ contentType: 'image/jpg',
+ knownLength: 19806
+ });
+
+ form.submit('http://example.com/', function(err, res) {
+ if (err) throw err;
+ console.log('Done');
+ });
+});
+```
+
+For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:
+
+``` javascript
+form.submit({
+ host: 'example.com',
+ path: '/probably.php?extra=params',
+ auth: 'username:password'
+}, function(err, res) {
+ console.log(res.statusCode);
+});
+```
+
+In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`:
+
+``` javascript
+form.submit({
+ host: 'example.com',
+ path: '/surelynot.php',
+ headers: {'x-test-header': 'test-header-value'}
+}, function(err, res) {
+ console.log(res.statusCode);
+});
+```
+
+### Integration with other libraries
+
+#### Request
+
+Form submission using [request](https://github.com/request/request):
+
+```javascript
+var formData = {
+ my_field: 'my_value',
+ my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),
+};
+
+request.post({url:'http://service.com/upload', formData: formData}, function(err, httpResponse, body) {
+ if (err) {
+ return console.error('upload failed:', err);
+ }
+ console.log('Upload successful! Server responded with:', body);
+});
+```
+
+For more details see [request readme](https://github.com/request/request#multipartform-data-multipart-form-uploads).
+
+#### node-fetch
+
+You can also submit a form using [node-fetch](https://github.com/bitinn/node-fetch):
+
+```javascript
+var form = new FormData();
+
+form.append('a', 1);
+
+fetch('http://example.com', { method: 'POST', body: form })
+ .then(function(res) {
+ return res.json();
+ }).then(function(json) {
+ console.log(json);
+ });
+```
+
+## Notes
+
+- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.
+- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing]
+
+## License
+
+Form-Data is licensed under the MIT license.
diff --git a/node_modules/request/node_modules/form-data/lib/browser.js b/node_modules/request/node_modules/form-data/lib/browser.js
new file mode 100644
index 000000000..1e7717d56
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/lib/browser.js
@@ -0,0 +1 @@
+module.exports = FormData; \ No newline at end of file
diff --git a/node_modules/request/node_modules/form-data/lib/form_data.js b/node_modules/request/node_modules/form-data/lib/form_data.js
new file mode 100644
index 000000000..524f392b4
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/lib/form_data.js
@@ -0,0 +1,374 @@
+var CombinedStream = require('combined-stream');
+var util = require('util');
+var path = require('path');
+var http = require('http');
+var https = require('https');
+var parseUrl = require('url').parse;
+var fs = require('fs');
+var mime = require('mime-types');
+var async = require('async');
+
+module.exports = FormData;
+function FormData() {
+ this._overheadLength = 0;
+ this._valueLength = 0;
+ this._lengthRetrievers = [];
+
+ CombinedStream.call(this);
+}
+util.inherits(FormData, CombinedStream);
+
+FormData.LINE_BREAK = '\r\n';
+FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
+
+FormData.prototype.append = function(field, value, options) {
+ options = (typeof options === 'string')
+ ? { filename: options }
+ : options || {};
+
+ var append = CombinedStream.prototype.append.bind(this);
+
+ // all that streamy business can't handle numbers
+ if (typeof value == 'number') value = ''+value;
+
+ // https://github.com/felixge/node-form-data/issues/38
+ if (util.isArray(value)) {
+ // Please convert your array into string
+ // the way web server expects it
+ this._error(new Error('Arrays are not supported.'));
+ return;
+ }
+
+ var header = this._multiPartHeader(field, value, options);
+ var footer = this._multiPartFooter(field, value, options);
+
+ append(header);
+ append(value);
+ append(footer);
+
+ // pass along options.knownLength
+ this._trackLength(header, value, options);
+};
+
+FormData.prototype._trackLength = function(header, value, options) {
+ var valueLength = 0;
+
+ // used w/ getLengthSync(), when length is known.
+ // e.g. for streaming directly from a remote server,
+ // w/ a known file a size, and not wanting to wait for
+ // incoming file to finish to get its size.
+ if (options.knownLength != null) {
+ valueLength += +options.knownLength;
+ } else if (Buffer.isBuffer(value)) {
+ valueLength = value.length;
+ } else if (typeof value === 'string') {
+ valueLength = Buffer.byteLength(value);
+ }
+
+ this._valueLength += valueLength;
+
+ // @check why add CRLF? does this account for custom/multiple CRLFs?
+ this._overheadLength +=
+ Buffer.byteLength(header) +
+ FormData.LINE_BREAK.length;
+
+ // empty or either doesn't have path or not an http response
+ if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) {
+ return;
+ }
+
+ // no need to bother with the length
+ if (!options.knownLength)
+ this._lengthRetrievers.push(function(next) {
+
+ if (value.hasOwnProperty('fd')) {
+
+ // take read range into a account
+ // `end` = Infinity –> read file till the end
+ //
+ // TODO: Looks like there is bug in Node fs.createReadStream
+ // it doesn't respect `end` options without `start` options
+ // Fix it when node fixes it.
+ // https://github.com/joyent/node/issues/7819
+ if (value.end != undefined && value.end != Infinity && value.start != undefined) {
+
+ // when end specified
+ // no need to calculate range
+ // inclusive, starts with 0
+ next(null, value.end+1 - (value.start ? value.start : 0));
+
+ // not that fast snoopy
+ } else {
+ // still need to fetch file size from fs
+ fs.stat(value.path, function(err, stat) {
+
+ var fileSize;
+
+ if (err) {
+ next(err);
+ return;
+ }
+
+ // update final size based on the range options
+ fileSize = stat.size - (value.start ? value.start : 0);
+ next(null, fileSize);
+ });
+ }
+
+ // or http response
+ } else if (value.hasOwnProperty('httpVersion')) {
+ next(null, +value.headers['content-length']);
+
+ // or request stream http://github.com/mikeal/request
+ } else if (value.hasOwnProperty('httpModule')) {
+ // wait till response come back
+ value.on('response', function(response) {
+ value.pause();
+ next(null, +response.headers['content-length']);
+ });
+ value.resume();
+
+ // something else
+ } else {
+ next('Unknown stream');
+ }
+ });
+};
+
+FormData.prototype._multiPartHeader = function(field, value, options) {
+ // custom header specified (as string)?
+ // it becomes responsible for boundary
+ // (e.g. to handle extra CRLFs on .NET servers)
+ if (options.header != null) {
+ return options.header;
+ }
+
+ var contents = '';
+ var headers = {
+ 'Content-Disposition': ['form-data', 'name="' + field + '"'],
+ 'Content-Type': []
+ };
+
+ // fs- and request- streams have path property
+ // or use custom filename and/or contentType
+ // TODO: Use request's response mime-type
+ if (options.filename || value.path) {
+ headers['Content-Disposition'].push(
+ 'filename="' + path.basename(options.filename || value.path) + '"'
+ );
+ headers['Content-Type'].push(
+ options.contentType ||
+ mime.lookup(options.filename || value.path) ||
+ FormData.DEFAULT_CONTENT_TYPE
+ );
+ // http response has not
+ } else if (value.readable && value.hasOwnProperty('httpVersion')) {
+ headers['Content-Disposition'].push(
+ 'filename="' + path.basename(value.client._httpMessage.path) + '"'
+ );
+ headers['Content-Type'].push(
+ options.contentType ||
+ value.headers['content-type'] ||
+ FormData.DEFAULT_CONTENT_TYPE
+ );
+ } else if (Buffer.isBuffer(value)) {
+ headers['Content-Type'].push(
+ options.contentType ||
+ FormData.DEFAULT_CONTENT_TYPE
+ );
+ } else if (options.contentType) {
+ headers['Content-Type'].push(options.contentType);
+ }
+
+ for (var prop in headers) {
+ if (headers[prop].length) {
+ contents += prop + ': ' + headers[prop].join('; ') + FormData.LINE_BREAK;
+ }
+ }
+
+ return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
+};
+
+FormData.prototype._multiPartFooter = function(field, value, options) {
+ return function(next) {
+ var footer = FormData.LINE_BREAK;
+
+ var lastPart = (this._streams.length === 0);
+ if (lastPart) {
+ footer += this._lastBoundary();
+ }
+
+ next(footer);
+ }.bind(this);
+};
+
+FormData.prototype._lastBoundary = function() {
+ return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
+};
+
+FormData.prototype.getHeaders = function(userHeaders) {
+ var formHeaders = {
+ 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
+ };
+
+ for (var header in userHeaders) {
+ formHeaders[header.toLowerCase()] = userHeaders[header];
+ }
+
+ return formHeaders;
+}
+
+FormData.prototype.getCustomHeaders = function(contentType) {
+ contentType = contentType ? contentType : 'multipart/form-data';
+
+ var formHeaders = {
+ 'content-type': contentType + '; boundary=' + this.getBoundary(),
+ 'content-length': this.getLengthSync()
+ };
+
+ return formHeaders;
+}
+
+FormData.prototype.getBoundary = function() {
+ if (!this._boundary) {
+ this._generateBoundary();
+ }
+
+ return this._boundary;
+};
+
+FormData.prototype._generateBoundary = function() {
+ // This generates a 50 character boundary similar to those used by Firefox.
+ // They are optimized for boyer-moore parsing.
+ var boundary = '--------------------------';
+ for (var i = 0; i < 24; i++) {
+ boundary += Math.floor(Math.random() * 10).toString(16);
+ }
+
+ this._boundary = boundary;
+};
+
+// Note: getLengthSync DOESN'T calculate streams length
+// As workaround one can calculate file size manually
+// and add it as knownLength option
+FormData.prototype.getLengthSync = function(debug) {
+ var knownLength = this._overheadLength + this._valueLength;
+
+ // Don't get confused, there are 3 "internal" streams for each keyval pair
+ // so it basically checks if there is any value added to the form
+ if (this._streams.length) {
+ knownLength += this._lastBoundary().length;
+ }
+
+ // https://github.com/felixge/node-form-data/issues/40
+ if (this._lengthRetrievers.length) {
+ // Some async length retrivers are present
+ // therefore synchronous length calculation is false.
+ // Please use getLength(callback) to get proper length
+ this._error(new Error('Cannot calculate proper length in synchronous way.'));
+ }
+
+ return knownLength;
+};
+
+FormData.prototype.getLength = function(cb) {
+ var knownLength = this._overheadLength + this._valueLength;
+
+ if (this._streams.length) {
+ knownLength += this._lastBoundary().length;
+ }
+
+ if (!this._lengthRetrievers.length) {
+ process.nextTick(cb.bind(this, null, knownLength));
+ return;
+ }
+
+ async.parallel(this._lengthRetrievers, function(err, values) {
+ if (err) {
+ cb(err);
+ return;
+ }
+
+ values.forEach(function(length) {
+ knownLength += length;
+ });
+
+ cb(null, knownLength);
+ });
+};
+
+FormData.prototype.submit = function(params, cb) {
+
+ var request
+ , options
+ , defaults = {
+ method : 'post'
+ };
+
+ // parse provided url if it's string
+ // or treat it as options object
+ if (typeof params == 'string') {
+ params = parseUrl(params);
+
+ options = populate({
+ port: params.port,
+ path: params.pathname,
+ host: params.hostname
+ }, defaults);
+ }
+ else // use custom params
+ {
+ options = populate(params, defaults);
+ // if no port provided use default one
+ if (!options.port) {
+ options.port = options.protocol == 'https:' ? 443 : 80;
+ }
+ }
+
+ // put that good code in getHeaders to some use
+ options.headers = this.getHeaders(params.headers);
+
+ // https if specified, fallback to http in any other case
+ if (options.protocol == 'https:') {
+ request = https.request(options);
+ } else {
+ request = http.request(options);
+ }
+
+ // get content length and fire away
+ this.getLength(function(err, length) {
+
+ // TODO: Add chunked encoding when no length (if err)
+
+ // add content length
+ request.setHeader('Content-Length', length);
+
+ this.pipe(request);
+ if (cb) {
+ request.on('error', cb);
+ request.on('response', cb.bind(this, null));
+ }
+ }.bind(this));
+
+ return request;
+};
+
+FormData.prototype._error = function(err) {
+ if (this.error) return;
+
+ this.error = err;
+ this.pause();
+ this.emit('error', err);
+};
+
+/*
+ * Santa's little helpers
+ */
+
+// populates missing values
+function populate(dst, src) {
+ for (var prop in src) {
+ if (!dst[prop]) dst[prop] = src[prop];
+ }
+ return dst;
+}
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md b/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md
new file mode 100644
index 000000000..3f8eb69aa
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md
@@ -0,0 +1,104 @@
+# v1.4.2
+
+- Ensure coverage files don't get published on npm (#879)
+
+# v1.4.1
+
+- Add in overlooked `detectLimit` method (#866)
+- Removed unnecessary files from npm releases (#861)
+- Removed usage of a reserved word to prevent :boom: in older environments (#870)
+
+# v1.4.0
+
+- `asyncify` now supports promises (#840)
+- Added `Limit` versions of `filter` and `reject` (#836)
+- Add `Limit` versions of `detect`, `some` and `every` (#828, #829)
+- `some`, `every` and `detect` now short circuit early (#828, #829)
+- Improve detection of the global object (#804), enabling use in WebWorkers
+- `whilst` now called with arguments from iterator (#823)
+- `during` now gets called with arguments from iterator (#824)
+- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0))
+
+
+# v1.3.0
+
+New Features:
+- Added `constant`
+- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. (#671, #806)
+- Added `during` and `doDuring`, which are like `whilst` with an async truth test. (#800)
+- `retry` now accepts an `interval` parameter to specify a delay between retries. (#793)
+- `async` should work better in Web Workers due to better `root` detection (#804)
+- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` (#642)
+- Various internal updates (#786, #801, #802, #803)
+- Various doc fixes (#790, #794)
+
+Bug Fixes:
+- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. (#740, #744, #783)
+
+
+# v1.2.1
+
+Bug Fix:
+
+- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782)
+
+
+# v1.2.0
+
+New Features:
+
+- Added `timesLimit` (#743)
+- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. (#747, #772)
+
+Bug Fixes:
+
+- Fixed a regression in `each` and family with empty arrays that have additional properties. (#775, #777)
+
+
+# v1.1.1
+
+Bug Fix:
+
+- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782)
+
+
+# v1.1.0
+
+New Features:
+
+- `cargo` now supports all of the same methods and event callbacks as `queue`.
+- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. (#769)
+- Optimized `map`, `eachOf`, and `waterfall` families of functions
+- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array (#667).
+- The callback is now optional for the composed results of `compose` and `seq`. (#618)
+- Reduced file size by 4kb, (minified version by 1kb)
+- Added code coverage through `nyc` and `coveralls` (#768)
+
+Bug Fixes:
+
+- `forever` will no longer stack overflow with a synchronous iterator (#622)
+- `eachLimit` and other limit functions will stop iterating once an error occurs (#754)
+- Always pass `null` in callbacks when there is no error (#439)
+- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue (#668)
+- `each` and family will properly handle an empty array (#578)
+- `eachSeries` and family will finish if the underlying array is modified during execution (#557)
+- `queue` will throw if a non-function is passed to `q.push()` (#593)
+- Doc fixes (#629, #766)
+
+
+# v1.0.0
+
+No known breaking changes, we are simply complying with semver from here on out.
+
+Changes:
+
+- Start using a changelog!
+- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) (#168 #704 #321)
+- Detect deadlocks in `auto` (#663)
+- Better support for require.js (#527)
+- Throw if queue created with concurrency `0` (#714)
+- Fix unneeded iteration in `queue.resume()` (#758)
+- Guard against timer mocking overriding `setImmediate` (#609 #611)
+- Miscellaneous doc fixes (#542 #596 #615 #628 #631 #690 #729)
+- Use single noop function internally (#546)
+- Optimize internal `_each`, `_map` and `_keys` functions.
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/LICENSE b/node_modules/request/node_modules/form-data/node_modules/async/LICENSE
new file mode 100644
index 000000000..8f2969858
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/node_modules/async/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2010-2014 Caolan McMahon
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js b/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
new file mode 100644
index 000000000..1f1e0effa
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
@@ -0,0 +1,1222 @@
+/*!
+ * async
+ * https://github.com/caolan/async
+ *
+ * Copyright 2010-2014 Caolan McMahon
+ * Released under the MIT license
+ */
+(function () {
+
+ var async = {};
+ function noop() {}
+ function identity(v) {
+ return v;
+ }
+ function toBool(v) {
+ return !!v;
+ }
+ function notId(v) {
+ return !v;
+ }
+
+ // global on the server, window in the browser
+ var previous_async;
+
+ // Establish the root object, `window` (`self`) in the browser, `global`
+ // on the server, or `this` in some virtual machines. We use `self`
+ // instead of `window` for `WebWorker` support.
+ var root = typeof self === 'object' && self.self === self && self ||
+ typeof global === 'object' && global.global === global && global ||
+ this;
+
+ if (root != null) {
+ previous_async = root.async;
+ }
+
+ async.noConflict = function () {
+ root.async = previous_async;
+ return async;
+ };
+
+ function only_once(fn) {
+ return function() {
+ if (fn === null) throw new Error("Callback was already called.");
+ fn.apply(this, arguments);
+ fn = null;
+ };
+ }
+
+ function _once(fn) {
+ return function() {
+ if (fn === null) return;
+ fn.apply(this, arguments);
+ fn = null;
+ };
+ }
+
+ //// cross-browser compatiblity functions ////
+
+ var _toString = Object.prototype.toString;
+
+ var _isArray = Array.isArray || function (obj) {
+ return _toString.call(obj) === '[object Array]';
+ };
+
+ // Ported from underscore.js isObject
+ var _isObject = function(obj) {
+ var type = typeof obj;
+ return type === 'function' || type === 'object' && !!obj;
+ };
+
+ function _isArrayLike(arr) {
+ return _isArray(arr) || (
+ // has a positive integer length property
+ typeof arr.length === "number" &&
+ arr.length >= 0 &&
+ arr.length % 1 === 0
+ );
+ }
+
+ function _each(coll, iterator) {
+ return _isArrayLike(coll) ?
+ _arrayEach(coll, iterator) :
+ _forEachOf(coll, iterator);
+ }
+
+ function _arrayEach(arr, iterator) {
+ var index = -1,
+ length = arr.length;
+
+ while (++index < length) {
+ iterator(arr[index], index, arr);
+ }
+ }
+
+ function _map(arr, iterator) {
+ var index = -1,
+ length = arr.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iterator(arr[index], index, arr);
+ }
+ return result;
+ }
+
+ function _range(count) {
+ return _map(Array(count), function (v, i) { return i; });
+ }
+
+ function _reduce(arr, iterator, memo) {
+ _arrayEach(arr, function (x, i, a) {
+ memo = iterator(memo, x, i, a);
+ });
+ return memo;
+ }
+
+ function _forEachOf(object, iterator) {
+ _arrayEach(_keys(object), function (key) {
+ iterator(object[key], key);
+ });
+ }
+
+ function _indexOf(arr, item) {
+ for (var i = 0; i < arr.length; i++) {
+ if (arr[i] === item) return i;
+ }
+ return -1;
+ }
+
+ var _keys = Object.keys || function (obj) {
+ var keys = [];
+ for (var k in obj) {
+ if (obj.hasOwnProperty(k)) {
+ keys.push(k);
+ }
+ }
+ return keys;
+ };
+
+ function _keyIterator(coll) {
+ var i = -1;
+ var len;
+ var keys;
+ if (_isArrayLike(coll)) {
+ len = coll.length;
+ return function next() {
+ i++;
+ return i < len ? i : null;
+ };
+ } else {
+ keys = _keys(coll);
+ len = keys.length;
+ return function next() {
+ i++;
+ return i < len ? keys[i] : null;
+ };
+ }
+ }
+
+ // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html)
+ // This accumulates the arguments passed into an array, after a given index.
+ // From underscore.js (https://github.com/jashkenas/underscore/pull/2140).
+ function _restParam(func, startIndex) {
+ startIndex = startIndex == null ? func.length - 1 : +startIndex;
+ return function() {
+ var length = Math.max(arguments.length - startIndex, 0);
+ var rest = Array(length);
+ for (var index = 0; index < length; index++) {
+ rest[index] = arguments[index + startIndex];
+ }
+ switch (startIndex) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, arguments[0], rest);
+ }
+ // Currently unused but handle cases outside of the switch statement:
+ // var args = Array(startIndex + 1);
+ // for (index = 0; index < startIndex; index++) {
+ // args[index] = arguments[index];
+ // }
+ // args[startIndex] = rest;
+ // return func.apply(this, args);
+ };
+ }
+
+ function _withoutIndex(iterator) {
+ return function (value, index, callback) {
+ return iterator(value, callback);
+ };
+ }
+
+ //// exported async module functions ////
+
+ //// nextTick implementation with browser-compatible fallback ////
+
+ // capture the global reference to guard against fakeTimer mocks
+ var _setImmediate = typeof setImmediate === 'function' && setImmediate;
+
+ var _delay = _setImmediate ? function(fn) {
+ // not a direct alias for IE10 compatibility
+ _setImmediate(fn);
+ } : function(fn) {
+ setTimeout(fn, 0);
+ };
+
+ if (typeof process === 'object' && typeof process.nextTick === 'function') {
+ async.nextTick = process.nextTick;
+ } else {
+ async.nextTick = _delay;
+ }
+ async.setImmediate = _setImmediate ? _delay : async.nextTick;
+
+
+ async.forEach =
+ async.each = function (arr, iterator, callback) {
+ return async.eachOf(arr, _withoutIndex(iterator), callback);
+ };
+
+ async.forEachSeries =
+ async.eachSeries = function (arr, iterator, callback) {
+ return async.eachOfSeries(arr, _withoutIndex(iterator), callback);
+ };
+
+
+ async.forEachLimit =
+ async.eachLimit = function (arr, limit, iterator, callback) {
+ return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback);
+ };
+
+ async.forEachOf =
+ async.eachOf = function (object, iterator, callback) {
+ callback = _once(callback || noop);
+ object = object || [];
+ var size = _isArrayLike(object) ? object.length : _keys(object).length;
+ var completed = 0;
+ if (!size) {
+ return callback(null);
+ }
+ _each(object, function (value, key) {
+ iterator(object[key], key, only_once(done));
+ });
+ function done(err) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ completed += 1;
+ if (completed >= size) {
+ callback(null);
+ }
+ }
+ }
+ };
+
+ async.forEachOfSeries =
+ async.eachOfSeries = function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ var key = nextKey();
+ function iterate() {
+ var sync = true;
+ if (key === null) {
+ return callback(null);
+ }
+ iterator(obj[key], key, only_once(function (err) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ key = nextKey();
+ if (key === null) {
+ return callback(null);
+ } else {
+ if (sync) {
+ async.nextTick(iterate);
+ } else {
+ iterate();
+ }
+ }
+ }
+ }));
+ sync = false;
+ }
+ iterate();
+ };
+
+
+
+ async.forEachOfLimit =
+ async.eachOfLimit = function (obj, limit, iterator, callback) {
+ _eachOfLimit(limit)(obj, iterator, callback);
+ };
+
+ function _eachOfLimit(limit) {
+
+ return function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ if (limit <= 0) {
+ return callback(null);
+ }
+ var done = false;
+ var running = 0;
+ var errored = false;
+
+ (function replenish () {
+ if (done && running <= 0) {
+ return callback(null);
+ }
+
+ while (running < limit && !errored) {
+ var key = nextKey();
+ if (key === null) {
+ done = true;
+ if (running <= 0) {
+ callback(null);
+ }
+ return;
+ }
+ running += 1;
+ iterator(obj[key], key, only_once(function (err) {
+ running -= 1;
+ if (err) {
+ callback(err);
+ errored = true;
+ }
+ else {
+ replenish();
+ }
+ }));
+ }
+ })();
+ };
+ }
+
+
+ function doParallel(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOf, obj, iterator, callback);
+ };
+ }
+ function doParallelLimit(fn) {
+ return function (obj, limit, iterator, callback) {
+ return fn(_eachOfLimit(limit), obj, iterator, callback);
+ };
+ }
+ function doSeries(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOfSeries, obj, iterator, callback);
+ };
+ }
+
+ function _asyncMap(eachfn, arr, iterator, callback) {
+ callback = _once(callback || noop);
+ var results = [];
+ eachfn(arr, function (value, index, callback) {
+ iterator(value, function (err, v) {
+ results[index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+
+ async.map = doParallel(_asyncMap);
+ async.mapSeries = doSeries(_asyncMap);
+ async.mapLimit = doParallelLimit(_asyncMap);
+
+ // reduce only has a series version, as doing reduce in parallel won't
+ // work in many situations.
+ async.inject =
+ async.foldl =
+ async.reduce = function (arr, memo, iterator, callback) {
+ async.eachOfSeries(arr, function (x, i, callback) {
+ iterator(memo, x, function (err, v) {
+ memo = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err || null, memo);
+ });
+ };
+
+ async.foldr =
+ async.reduceRight = function (arr, memo, iterator, callback) {
+ var reversed = _map(arr, identity).reverse();
+ async.reduce(reversed, memo, iterator, callback);
+ };
+
+ function _filter(eachfn, arr, iterator, callback) {
+ var results = [];
+ eachfn(arr, function (x, index, callback) {
+ iterator(x, function (v) {
+ if (v) {
+ results.push({index: index, value: x});
+ }
+ callback();
+ });
+ }, function () {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ }
+
+ async.select =
+ async.filter = doParallel(_filter);
+
+ async.selectLimit =
+ async.filterLimit = doParallelLimit(_filter);
+
+ async.selectSeries =
+ async.filterSeries = doSeries(_filter);
+
+ function _reject(eachfn, arr, iterator, callback) {
+ _filter(eachfn, arr, function(value, cb) {
+ iterator(value, function(v) {
+ cb(!v);
+ });
+ }, callback);
+ }
+ async.reject = doParallel(_reject);
+ async.rejectLimit = doParallelLimit(_reject);
+ async.rejectSeries = doSeries(_reject);
+
+ function _createTester(eachfn, check, getResult) {
+ return function(arr, limit, iterator, cb) {
+ function done() {
+ if (cb) cb(getResult(false, void 0));
+ }
+ function iteratee(x, _, callback) {
+ if (!cb) return callback();
+ iterator(x, function (v) {
+ if (cb && check(v)) {
+ cb(getResult(true, x));
+ cb = iterator = false;
+ }
+ callback();
+ });
+ }
+ if (arguments.length > 3) {
+ eachfn(arr, limit, iteratee, done);
+ } else {
+ cb = iterator;
+ iterator = limit;
+ eachfn(arr, iteratee, done);
+ }
+ };
+ }
+
+ async.any =
+ async.some = _createTester(async.eachOf, toBool, identity);
+
+ async.someLimit = _createTester(async.eachOfLimit, toBool, identity);
+
+ async.all =
+ async.every = _createTester(async.eachOf, notId, notId);
+
+ async.everyLimit = _createTester(async.eachOfLimit, notId, notId);
+
+ function _findGetResult(v, x) {
+ return x;
+ }
+ async.detect = _createTester(async.eachOf, identity, _findGetResult);
+ async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult);
+ async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult);
+
+ async.sortBy = function (arr, iterator, callback) {
+ async.map(arr, function (x, callback) {
+ iterator(x, function (err, criteria) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ callback(null, {value: x, criteria: criteria});
+ }
+ });
+ }, function (err, results) {
+ if (err) {
+ return callback(err);
+ }
+ else {
+ callback(null, _map(results.sort(comparator), function (x) {
+ return x.value;
+ }));
+ }
+
+ });
+
+ function comparator(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }
+ };
+
+ async.auto = function (tasks, callback) {
+ callback = _once(callback || noop);
+ var keys = _keys(tasks);
+ var remainingTasks = keys.length;
+ if (!remainingTasks) {
+ return callback(null);
+ }
+
+ var results = {};
+
+ var listeners = [];
+ function addListener(fn) {
+ listeners.unshift(fn);
+ }
+ function removeListener(fn) {
+ var idx = _indexOf(listeners, fn);
+ if (idx >= 0) listeners.splice(idx, 1);
+ }
+ function taskComplete() {
+ remainingTasks--;
+ _arrayEach(listeners.slice(0), function (fn) {
+ fn();
+ });
+ }
+
+ addListener(function () {
+ if (!remainingTasks) {
+ callback(null, results);
+ }
+ });
+
+ _arrayEach(keys, function (k) {
+ var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
+ var taskCallback = _restParam(function(err, args) {
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ if (err) {
+ var safeResults = {};
+ _forEachOf(results, function(val, rkey) {
+ safeResults[rkey] = val;
+ });
+ safeResults[k] = args;
+ callback(err, safeResults);
+ }
+ else {
+ results[k] = args;
+ async.setImmediate(taskComplete);
+ }
+ });
+ var requires = task.slice(0, task.length - 1);
+ // prevent dead-locks
+ var len = requires.length;
+ var dep;
+ while (len--) {
+ if (!(dep = tasks[requires[len]])) {
+ throw new Error('Has inexistant dependency');
+ }
+ if (_isArray(dep) && _indexOf(dep, k) >= 0) {
+ throw new Error('Has cyclic dependencies');
+ }
+ }
+ function ready() {
+ return _reduce(requires, function (a, x) {
+ return (a && results.hasOwnProperty(x));
+ }, true) && !results.hasOwnProperty(k);
+ }
+ if (ready()) {
+ task[task.length - 1](taskCallback, results);
+ }
+ else {
+ addListener(listener);
+ }
+ function listener() {
+ if (ready()) {
+ removeListener(listener);
+ task[task.length - 1](taskCallback, results);
+ }
+ }
+ });
+ };
+
+
+
+ async.retry = function(times, task, callback) {
+ var DEFAULT_TIMES = 5;
+ var DEFAULT_INTERVAL = 0;
+
+ var attempts = [];
+
+ var opts = {
+ times: DEFAULT_TIMES,
+ interval: DEFAULT_INTERVAL
+ };
+
+ function parseTimes(acc, t){
+ if(typeof t === 'number'){
+ acc.times = parseInt(t, 10) || DEFAULT_TIMES;
+ } else if(typeof t === 'object'){
+ acc.times = parseInt(t.times, 10) || DEFAULT_TIMES;
+ acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL;
+ } else {
+ throw new Error('Unsupported argument type for \'times\': ' + typeof t);
+ }
+ }
+
+ var length = arguments.length;
+ if (length < 1 || length > 3) {
+ throw new Error('Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)');
+ } else if (length <= 2 && typeof times === 'function') {
+ callback = task;
+ task = times;
+ }
+ if (typeof times !== 'function') {
+ parseTimes(opts, times);
+ }
+ opts.callback = callback;
+ opts.task = task;
+
+ function wrappedTask(wrappedCallback, wrappedResults) {
+ function retryAttempt(task, finalAttempt) {
+ return function(seriesCallback) {
+ task(function(err, result){
+ seriesCallback(!err || finalAttempt, {err: err, result: result});
+ }, wrappedResults);
+ };
+ }
+
+ function retryInterval(interval){
+ return function(seriesCallback){
+ setTimeout(function(){
+ seriesCallback(null);
+ }, interval);
+ };
+ }
+
+ while (opts.times) {
+
+ var finalAttempt = !(opts.times-=1);
+ attempts.push(retryAttempt(opts.task, finalAttempt));
+ if(!finalAttempt && opts.interval > 0){
+ attempts.push(retryInterval(opts.interval));
+ }
+ }
+
+ async.series(attempts, function(done, data){
+ data = data[data.length - 1];
+ (wrappedCallback || opts.callback)(data.err, data.result);
+ });
+ }
+
+ // If a callback is passed, run this as a controll flow
+ return opts.callback ? wrappedTask() : wrappedTask;
+ };
+
+ async.waterfall = function (tasks, callback) {
+ callback = _once(callback || noop);
+ if (!_isArray(tasks)) {
+ var err = new Error('First argument to waterfall must be an array of functions');
+ return callback(err);
+ }
+ if (!tasks.length) {
+ return callback();
+ }
+ function wrapIterator(iterator) {
+ return _restParam(function (err, args) {
+ if (err) {
+ callback.apply(null, [err].concat(args));
+ }
+ else {
+ var next = iterator.next();
+ if (next) {
+ args.push(wrapIterator(next));
+ }
+ else {
+ args.push(callback);
+ }
+ ensureAsync(iterator).apply(null, args);
+ }
+ });
+ }
+ wrapIterator(async.iterator(tasks))();
+ };
+
+ function _parallel(eachfn, tasks, callback) {
+ callback = callback || noop;
+ var results = _isArrayLike(tasks) ? [] : {};
+
+ eachfn(tasks, function (task, key, callback) {
+ task(_restParam(function (err, args) {
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ results[key] = args;
+ callback(err);
+ }));
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+
+ async.parallel = function (tasks, callback) {
+ _parallel(async.eachOf, tasks, callback);
+ };
+
+ async.parallelLimit = function(tasks, limit, callback) {
+ _parallel(_eachOfLimit(limit), tasks, callback);
+ };
+
+ async.series = function(tasks, callback) {
+ _parallel(async.eachOfSeries, tasks, callback);
+ };
+
+ async.iterator = function (tasks) {
+ function makeCallback(index) {
+ function fn() {
+ if (tasks.length) {
+ tasks[index].apply(null, arguments);
+ }
+ return fn.next();
+ }
+ fn.next = function () {
+ return (index < tasks.length - 1) ? makeCallback(index + 1): null;
+ };
+ return fn;
+ }
+ return makeCallback(0);
+ };
+
+ async.apply = _restParam(function (fn, args) {
+ return _restParam(function (callArgs) {
+ return fn.apply(
+ null, args.concat(callArgs)
+ );
+ });
+ });
+
+ function _concat(eachfn, arr, fn, callback) {
+ var result = [];
+ eachfn(arr, function (x, index, cb) {
+ fn(x, function (err, y) {
+ result = result.concat(y || []);
+ cb(err);
+ });
+ }, function (err) {
+ callback(err, result);
+ });
+ }
+ async.concat = doParallel(_concat);
+ async.concatSeries = doSeries(_concat);
+
+ async.whilst = function (test, iterator, callback) {
+ callback = callback || noop;
+ if (test()) {
+ var next = _restParam(function(err, args) {
+ if (err) {
+ callback(err);
+ } else if (test.apply(this, args)) {
+ iterator(next);
+ } else {
+ callback(null);
+ }
+ });
+ iterator(next);
+ } else {
+ callback(null);
+ }
+ };
+
+ async.doWhilst = function (iterator, test, callback) {
+ var calls = 0;
+ return async.whilst(function() {
+ return ++calls <= 1 || test.apply(this, arguments);
+ }, iterator, callback);
+ };
+
+ async.until = function (test, iterator, callback) {
+ return async.whilst(function() {
+ return !test.apply(this, arguments);
+ }, iterator, callback);
+ };
+
+ async.doUntil = function (iterator, test, callback) {
+ return async.doWhilst(iterator, function() {
+ return !test.apply(this, arguments);
+ }, callback);
+ };
+
+ async.during = function (test, iterator, callback) {
+ callback = callback || noop;
+
+ var next = _restParam(function(err, args) {
+ if (err) {
+ callback(err);
+ } else {
+ args.push(check);
+ test.apply(this, args);
+ }
+ });
+
+ var check = function(err, truth) {
+ if (err) {
+ callback(err);
+ } else if (truth) {
+ iterator(next);
+ } else {
+ callback(null);
+ }
+ };
+
+ test(check);
+ };
+
+ async.doDuring = function (iterator, test, callback) {
+ var calls = 0;
+ async.during(function(next) {
+ if (calls++ < 1) {
+ next(null, true);
+ } else {
+ test.apply(this, arguments);
+ }
+ }, iterator, callback);
+ };
+
+ function _queue(worker, concurrency, payload) {
+ if (concurrency == null) {
+ concurrency = 1;
+ }
+ else if(concurrency === 0) {
+ throw new Error('Concurrency must not be zero');
+ }
+ function _insert(q, data, pos, callback) {
+ if (callback != null && typeof callback !== "function") {
+ throw new Error("task callback must be a function");
+ }
+ q.started = true;
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0 && q.idle()) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ q.drain();
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ callback: callback || noop
+ };
+
+ if (pos) {
+ q.tasks.unshift(item);
+ } else {
+ q.tasks.push(item);
+ }
+
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ });
+ async.setImmediate(q.process);
+ }
+ function _next(q, tasks) {
+ return function(){
+ workers -= 1;
+ var args = arguments;
+ _arrayEach(tasks, function (task) {
+ task.callback.apply(task, args);
+ });
+ if (q.tasks.length + workers === 0) {
+ q.drain();
+ }
+ q.process();
+ };
+ }
+
+ var workers = 0;
+ var q = {
+ tasks: [],
+ concurrency: concurrency,
+ payload: payload,
+ saturated: noop,
+ empty: noop,
+ drain: noop,
+ started: false,
+ paused: false,
+ push: function (data, callback) {
+ _insert(q, data, false, callback);
+ },
+ kill: function () {
+ q.drain = noop;
+ q.tasks = [];
+ },
+ unshift: function (data, callback) {
+ _insert(q, data, true, callback);
+ },
+ process: function () {
+ if (!q.paused && workers < q.concurrency && q.tasks.length) {
+ while(workers < q.concurrency && q.tasks.length){
+ var tasks = q.payload ?
+ q.tasks.splice(0, q.payload) :
+ q.tasks.splice(0, q.tasks.length);
+
+ var data = _map(tasks, function (task) {
+ return task.data;
+ });
+
+ if (q.tasks.length === 0) {
+ q.empty();
+ }
+ workers += 1;
+ var cb = only_once(_next(q, tasks));
+ worker(data, cb);
+ }
+ }
+ },
+ length: function () {
+ return q.tasks.length;
+ },
+ running: function () {
+ return workers;
+ },
+ idle: function() {
+ return q.tasks.length + workers === 0;
+ },
+ pause: function () {
+ q.paused = true;
+ },
+ resume: function () {
+ if (q.paused === false) { return; }
+ q.paused = false;
+ var resumeCount = Math.min(q.concurrency, q.tasks.length);
+ // Need to call q.process once per concurrent
+ // worker to preserve full concurrency after pause
+ for (var w = 1; w <= resumeCount; w++) {
+ async.setImmediate(q.process);
+ }
+ }
+ };
+ return q;
+ }
+
+ async.queue = function (worker, concurrency) {
+ var q = _queue(function (items, cb) {
+ worker(items[0], cb);
+ }, concurrency, 1);
+
+ return q;
+ };
+
+ async.priorityQueue = function (worker, concurrency) {
+
+ function _compareTasks(a, b){
+ return a.priority - b.priority;
+ }
+
+ function _binarySearch(sequence, item, compare) {
+ var beg = -1,
+ end = sequence.length - 1;
+ while (beg < end) {
+ var mid = beg + ((end - beg + 1) >>> 1);
+ if (compare(item, sequence[mid]) >= 0) {
+ beg = mid;
+ } else {
+ end = mid - 1;
+ }
+ }
+ return beg;
+ }
+
+ function _insert(q, data, priority, callback) {
+ if (callback != null && typeof callback !== "function") {
+ throw new Error("task callback must be a function");
+ }
+ q.started = true;
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ q.drain();
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ priority: priority,
+ callback: typeof callback === 'function' ? callback : noop
+ };
+
+ q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
+
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ async.setImmediate(q.process);
+ });
+ }
+
+ // Start with a normal queue
+ var q = async.queue(worker, concurrency);
+
+ // Override push to accept second parameter representing priority
+ q.push = function (data, priority, callback) {
+ _insert(q, data, priority, callback);
+ };
+
+ // Remove unshift function
+ delete q.unshift;
+
+ return q;
+ };
+
+ async.cargo = function (worker, payload) {
+ return _queue(worker, 1, payload);
+ };
+
+ function _console_fn(name) {
+ return _restParam(function (fn, args) {
+ fn.apply(null, args.concat([_restParam(function (err, args) {
+ if (typeof console === 'object') {
+ if (err) {
+ if (console.error) {
+ console.error(err);
+ }
+ }
+ else if (console[name]) {
+ _arrayEach(args, function (x) {
+ console[name](x);
+ });
+ }
+ }
+ })]));
+ });
+ }
+ async.log = _console_fn('log');
+ async.dir = _console_fn('dir');
+ /*async.info = _console_fn('info');
+ async.warn = _console_fn('warn');
+ async.error = _console_fn('error');*/
+
+ async.memoize = function (fn, hasher) {
+ var memo = {};
+ var queues = {};
+ hasher = hasher || identity;
+ var memoized = _restParam(function memoized(args) {
+ var callback = args.pop();
+ var key = hasher.apply(null, args);
+ if (key in memo) {
+ async.nextTick(function () {
+ callback.apply(null, memo[key]);
+ });
+ }
+ else if (key in queues) {
+ queues[key].push(callback);
+ }
+ else {
+ queues[key] = [callback];
+ fn.apply(null, args.concat([_restParam(function (args) {
+ memo[key] = args;
+ var q = queues[key];
+ delete queues[key];
+ for (var i = 0, l = q.length; i < l; i++) {
+ q[i].apply(null, args);
+ }
+ })]));
+ }
+ });
+ memoized.memo = memo;
+ memoized.unmemoized = fn;
+ return memoized;
+ };
+
+ async.unmemoize = function (fn) {
+ return function () {
+ return (fn.unmemoized || fn).apply(null, arguments);
+ };
+ };
+
+ function _times(mapper) {
+ return function (count, iterator, callback) {
+ mapper(_range(count), iterator, callback);
+ };
+ }
+
+ async.times = _times(async.map);
+ async.timesSeries = _times(async.mapSeries);
+ async.timesLimit = function (count, limit, iterator, callback) {
+ return async.mapLimit(_range(count), limit, iterator, callback);
+ };
+
+ async.seq = function (/* functions... */) {
+ var fns = arguments;
+ return _restParam(function (args) {
+ var that = this;
+
+ var callback = args[args.length - 1];
+ if (typeof callback == 'function') {
+ args.pop();
+ } else {
+ callback = noop;
+ }
+
+ async.reduce(fns, args, function (newargs, fn, cb) {
+ fn.apply(that, newargs.concat([_restParam(function (err, nextargs) {
+ cb(err, nextargs);
+ })]));
+ },
+ function (err, results) {
+ callback.apply(that, [err].concat(results));
+ });
+ });
+ };
+
+ async.compose = function (/* functions... */) {
+ return async.seq.apply(null, Array.prototype.reverse.call(arguments));
+ };
+
+
+ function _applyEach(eachfn) {
+ return _restParam(function(fns, args) {
+ var go = _restParam(function(args) {
+ var that = this;
+ var callback = args.pop();
+ return eachfn(fns, function (fn, _, cb) {
+ fn.apply(that, args.concat([cb]));
+ },
+ callback);
+ });
+ if (args.length) {
+ return go.apply(this, args);
+ }
+ else {
+ return go;
+ }
+ });
+ }
+
+ async.applyEach = _applyEach(async.eachOf);
+ async.applyEachSeries = _applyEach(async.eachOfSeries);
+
+
+ async.forever = function (fn, callback) {
+ var done = only_once(callback || noop);
+ var task = ensureAsync(fn);
+ function next(err) {
+ if (err) {
+ return done(err);
+ }
+ task(next);
+ }
+ next();
+ };
+
+ function ensureAsync(fn) {
+ return _restParam(function (args) {
+ var callback = args.pop();
+ args.push(function () {
+ var innerArgs = arguments;
+ if (sync) {
+ async.setImmediate(function () {
+ callback.apply(null, innerArgs);
+ });
+ } else {
+ callback.apply(null, innerArgs);
+ }
+ });
+ var sync = true;
+ fn.apply(this, args);
+ sync = false;
+ });
+ }
+
+ async.ensureAsync = ensureAsync;
+
+ async.constant = _restParam(function(values) {
+ var args = [null].concat(values);
+ return function (callback) {
+ return callback.apply(this, args);
+ };
+ });
+
+ async.wrapSync =
+ async.asyncify = function asyncify(func) {
+ return _restParam(function (args) {
+ var callback = args.pop();
+ var result;
+ try {
+ result = func.apply(this, args);
+ } catch (e) {
+ return callback(e);
+ }
+ // if result is Promise object
+ if (_isObject(result) && typeof result.then === "function") {
+ result.then(function(value) {
+ callback(null, value);
+ })["catch"](function(err) {
+ callback(err.message ? err : new Error(err));
+ });
+ } else {
+ callback(null, result);
+ }
+ });
+ };
+
+ // Node.js
+ if (typeof module === 'object' && module.exports) {
+ module.exports = async;
+ }
+ // AMD / RequireJS
+ else if (typeof define === 'function' && define.amd) {
+ define([], function () {
+ return async;
+ });
+ }
+ // included directly via <script> tag
+ else {
+ root.async = async;
+ }
+
+}());
diff --git a/node_modules/request/node_modules/form-data/node_modules/async/package.json b/node_modules/request/node_modules/form-data/node_modules/async/package.json
new file mode 100644
index 000000000..cdc0f8ccc
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/node_modules/async/package.json
@@ -0,0 +1,90 @@
+{
+ "name": "async",
+ "description": "Higher-order functions and common patterns for asynchronous code",
+ "main": "lib/async.js",
+ "files": [
+ "lib"
+ ],
+ "author": {
+ "name": "Caolan McMahon"
+ },
+ "version": "1.4.2",
+ "keywords": [
+ "async",
+ "callback",
+ "utility",
+ "module"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/caolan/async.git"
+ },
+ "bugs": {
+ "url": "https://github.com/caolan/async/issues"
+ },
+ "license": "MIT",
+ "devDependencies": {
+ "benchmark": "github:bestiejs/benchmark.js",
+ "bluebird": "^2.9.32",
+ "chai": "^3.1.0",
+ "coveralls": "^2.11.2",
+ "es6-promise": "^2.3.0",
+ "jscs": "^1.13.1",
+ "jshint": "~2.8.0",
+ "karma": "^0.13.2",
+ "karma-browserify": "^4.2.1",
+ "karma-firefox-launcher": "^0.1.6",
+ "karma-mocha": "^0.2.0",
+ "karma-mocha-reporter": "^1.0.2",
+ "lodash": "^3.9.0",
+ "mkdirp": "~0.5.1",
+ "mocha": "^2.2.5",
+ "native-promise-only": "^0.8.0-a",
+ "nodeunit": ">0.0.0",
+ "nyc": "^2.1.0",
+ "rsvp": "^3.0.18",
+ "uglify-js": "~2.4.0",
+ "xyz": "^0.5.0",
+ "yargs": "~3.9.1"
+ },
+ "jam": {
+ "main": "lib/async.js",
+ "include": [
+ "lib/async.js",
+ "README.md",
+ "LICENSE"
+ ],
+ "categories": [
+ "Utilities"
+ ]
+ },
+ "scripts": {
+ "mocha-node-test": "mocha mocha_test/",
+ "mocha-browser-test": "karma start",
+ "mocha-test": "npm run mocha-node-test && npm run mocha-browser-test",
+ "nodeunit-test": "nodeunit test/test-async.js",
+ "test": "npm run-script lint && npm run nodeunit-test && npm run mocha-test",
+ "lint": "jshint lib/*.js test/*.js perf/*.js && jscs lib/*.js test/*.js perf/*.js",
+ "coverage": "nyc npm test && nyc report",
+ "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls"
+ },
+ "spm": {
+ "main": "lib/async.js"
+ },
+ "volo": {
+ "main": "lib/async.js",
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "test",
+ "tests"
+ ]
+ },
+ "readme": "ERROR: No README data found!",
+ "homepage": "https://github.com/caolan/async#readme",
+ "_id": "async@1.4.2",
+ "_shasum": "6c9edcb11ced4f0dd2f2d40db0d49a109c088aab",
+ "_resolved": "https://registry.npmjs.org/async/-/async-1.4.2.tgz",
+ "_from": "async@>=1.4.0 <2.0.0"
+}
diff --git a/node_modules/request/node_modules/form-data/package.json b/node_modules/request/node_modules/form-data/package.json
new file mode 100644
index 000000000..662e628b2
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/package.json
@@ -0,0 +1,85 @@
+{
+ "author": {
+ "name": "Felix Geisendörfer",
+ "email": "felix@debuggable.com",
+ "url": "http://debuggable.com/"
+ },
+ "name": "form-data",
+ "description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.",
+ "version": "1.0.0-rc3",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/form-data/form-data.git"
+ },
+ "main": "./lib/form_data",
+ "browser": "./lib/browser",
+ "scripts": {
+ "test": "./test/run.js"
+ },
+ "pre-commit": [
+ "test"
+ ],
+ "engines": {
+ "node": ">= 0.10"
+ },
+ "dependencies": {
+ "async": "^1.4.0",
+ "combined-stream": "^1.0.5",
+ "mime-types": "^2.1.3"
+ },
+ "license": "MIT",
+ "devDependencies": {
+ "fake": "^0.2.2",
+ "far": "^0.0.7",
+ "formidable": "^1.0.17",
+ "pre-commit": "^1.0.10",
+ "request": "^2.60.0"
+ },
+ "gitHead": "c174f1b7f3a78a00ec5af0360469280445e37804",
+ "bugs": {
+ "url": "https://github.com/form-data/form-data/issues"
+ },
+ "homepage": "https://github.com/form-data/form-data#readme",
+ "_id": "form-data@1.0.0-rc3",
+ "_shasum": "d35bc62e7fbc2937ae78f948aaa0d38d90607577",
+ "_from": "form-data@>=1.0.0-rc3 <1.1.0",
+ "_npmVersion": "2.11.0",
+ "_nodeVersion": "2.2.1",
+ "_npmUser": {
+ "name": "dylanpiercey",
+ "email": "pierceydylan@gmail.com"
+ },
+ "dist": {
+ "shasum": "d35bc62e7fbc2937ae78f948aaa0d38d90607577",
+ "tarball": "http://registry.npmjs.org/form-data/-/form-data-1.0.0-rc3.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "felixge",
+ "email": "felix@debuggable.com"
+ },
+ {
+ "name": "idralyuk",
+ "email": "igor@buran.us"
+ },
+ {
+ "name": "alexindigo",
+ "email": "iam@alexindigo.com"
+ },
+ {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ {
+ "name": "celer",
+ "email": "dtyree77@gmail.com"
+ },
+ {
+ "name": "dylanpiercey",
+ "email": "pierceydylan@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc3.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/har-validator/LICENSE b/node_modules/request/node_modules/har-validator/LICENSE
new file mode 100644
index 000000000..ca55c91af
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/LICENSE
@@ -0,0 +1,13 @@
+Copyright (c) 2015, Ahmad Nassri <ahmad@ahmadnassri.com>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/request/node_modules/har-validator/README.md b/node_modules/request/node_modules/har-validator/README.md
new file mode 100644
index 000000000..2399b316e
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/README.md
@@ -0,0 +1,386 @@
+# HAR Validator [![version][npm-version]][npm-url] [![License][npm-license]][license-url]
+
+Extremely fast HTTP Archive ([HAR](http://www.softwareishard.com/blog/har-12-spec/)) validator using JSON Schema.
+
+[![Build Status][travis-image]][travis-url]
+[![Downloads][npm-downloads]][npm-url]
+[![Code Climate][codeclimate-quality]][codeclimate-url]
+[![Coverage Status][codeclimate-coverage]][codeclimate-url]
+[![Dependencies][david-image]][david-url]
+
+## Install
+
+```shell
+# to use in cli
+npm install --global har-validator
+
+# to use as a module
+npm install --save har-validator
+```
+
+## Usage
+
+```
+
+ Usage: har-validator [options] <files ...>
+
+ Options:
+
+ -h, --help output usage information
+ -V, --version output the version number
+ -s, --schema [name] validate schema name (log, request, response, etc ...)
+
+```
+
+###### Example
+
+```shell
+har-validator har.json
+
+har-validator --schema request request.json
+```
+
+## API
+
+**Note**: as of [`v2.0.0`](https://github.com/ahmadnassri/har-validator/releases/tag/v2.0.0) this module defaults to Promise based API. *For backward comptability with `v1.x` an [async/callback API](#callback-api) is provided*
+
+### Validate(data)
+
+> Returns a promise that resolves to the valid object.
+
+- **data**: `Object` *(Required)*
+ a full [HAR](http://www.softwareishard.com/blog/har-12-spec/) object
+
+```js
+var HAR = require('./har.json')
+var validate = require('har-validator')
+
+validate(HAR)
+ .then(function (HAR) {
+ console.log('horray!')
+ })
+ .catch(function (error) {
+ console.error(error)
+ })
+```
+
+### Validate.log(data)
+
+> Returns a promise that resolves to the valid object.
+
+- **data**: `Object` *(Required)*
+ a [log](http://www.softwareishard.com/blog/har-12-spec/#log) object
+
+```js
+var validate = require('har-validator')
+
+validate.log(data.then(function (HAR) {
+ console.log('horray!')
+ })
+ .catch(function (error) {
+ console.error(error)
+ })
+```
+
+### Validate.cache(data)
+
+> Returns a promise that resolves to the valid object.
+
+- **data**: `Object` *(Required)*
+ a [cache](http://www.softwareishard.com/blog/har-12-spec/#cache) object
+
+```js
+var validate = require('har-validator')
+
+validate.cache(data.then(function (HAR) {
+ console.log('horray!')
+ })
+ .catch(function (error) {
+ console.error(error)
+ })
+```
+
+### Validate.cacheEntry(data)
+
+> Returns a promise that resolves to the valid object.
+
+- **data**: `Object` *(Required)*
+ a ["beforeRequest" or "afterRequest"](http://www.softwareishard.com/blog/har-12-spec/#cache) objects
+
+```js
+var validate = require('har-validator')
+
+validate.cacheEntry(data.then(function (HAR) {
+ console.log('horray!')
+ })
+ .catch(function (error) {
+ console.error(error)
+ })
+```
+
+### Validate.content(data)
+
+> Returns a promise that resolves to the valid object.
+
+- **data**: `Object` *(Required)*
+ a [content](http://www.softwareishard.com/blog/har-12-spec/#content) object
+
+```js
+var validate = require('har-validator')
+
+validate.content(data.then(function (HAR) {
+ console.log('horray!')
+ })
+ .catch(function (error) {
+ console.error(error)
+ })
+```
+
+### Validate.cookie(data)
+
+> Returns a promise that resolves to the valid object.
+
+- **data**: `Object` *(Required)*
+ a [cookie](http://www.softwareishard.com/blog/har-12-spec/#cookies) object
+
+```js
+var validate = require('har-validator')
+
+validate.cookie(data.then(function (HAR) {
+ console.log('horray!')
+ })
+ .catch(function (error) {
+ console.error(error)
+ })
+```
+
+### Validate.creator(data)
+
+> Returns a promise that resolves to the valid object.
+
+- **data**: `Object` *(Required)*
+ a [creator](http://www.softwareishard.com/blog/har-12-spec/#creator) object
+
+```js
+var validate = require('har-validator')
+
+validate.creator(data.then(function (HAR) {
+ console.log('horray!')
+ })
+ .catch(function (error) {
+ console.error(error)
+ })
+```
+
+### Validate.entry(data)
+
+> Returns a promise that resolves to the valid object.
+
+- **data**: `Object` *(Required)*
+ an [entry](http://www.softwareishard.com/blog/har-12-spec/#entries) object
+
+```js
+var validate = require('har-validator')
+
+validate.entry(data.then(function (HAR) {
+ console.log('horray!')
+ })
+ .catch(function (error) {
+ console.error(error)
+ })
+```
+
+### Validate.log(data)
+
+alias of [`Validate(data)`](#validate-data-callback-)
+
+### Validate.page(data)
+
+> Returns a promise that resolves to the valid object.
+
+- **data**: `Object` *(Required)*
+ a [page](http://www.softwareishard.com/blog/har-12-spec/#pages) object
+
+```js
+var validate = require('har-validator')
+
+validate.page(data.then(function (HAR) {
+ console.log('horray!')
+ })
+ .catch(function (error) {
+ console.error(error)
+ })
+```
+
+### Validate.pageTimings(data)
+
+> Returns a promise that resolves to the valid object.
+
+- **data**: `Object` *(Required)*
+ a [pageTimings](http://www.softwareishard.com/blog/har-12-spec/#pageTimings) object
+
+```js
+var validate = require('har-validator')
+
+validate.pageTimings(data.then(function (HAR) {
+ console.log('horray!')
+ })
+ .catch(function (error) {
+ console.error(error)
+ })
+```
+
+### Validate.postData(data)
+
+> Returns a promise that resolves to the valid object.
+
+- **data**: `Object` *(Required)*
+ a [postData](http://www.softwareishard.com/blog/har-12-spec/#postData) object
+
+```js
+var validate = require('har-validator')
+
+validate.postData(data.then(function (HAR) {
+ console.log('horray!')
+ })
+ .catch(function (error) {
+ console.error(error)
+ })
+```
+
+### Validate.record(data)
+
+> Returns a promise that resolves to the valid object.
+
+- **data**: `Object` *(Required)*
+ a [record](http://www.softwareishard.com/blog/har-12-spec/#headers) object
+
+```js
+var validate = require('har-validator')
+
+validate.record(data.then(function (HAR) {
+ console.log('horray!')
+ })
+ .catch(function (error) {
+ console.error(error)
+ })
+```
+
+### Validate.request(data)
+
+> Returns a promise that resolves to the valid object.
+
+- **data**: `Object` *(Required)*
+ a [request](http://www.softwareishard.com/blog/har-12-spec/#request) object
+
+```js
+var validate = require('har-validator')
+
+validate.request(data.then(function (HAR) {
+ console.log('horray!')
+ })
+ .catch(function (error) {
+ console.error(error)
+ })
+```
+
+### Validate.response(data)
+
+> Returns a promise that resolves to the valid object.
+
+- **data**: `Object` *(Required)*
+ a [response](http://www.softwareishard.com/blog/har-12-spec/#response) object
+
+```js
+var validate = require('har-validator')
+
+validate.cacheEntry(data.then(function (HAR) {
+ console.log('horray!')
+ })
+ .catch(function (error) {
+ console.error(error)
+ })
+```
+
+### Validate.timings(data)
+
+> Returns a promise that resolves to the valid object.
+
+- **data**: `Object` *(Required)*
+ a [timings](http://www.softwareishard.com/blog/har-12-spec/#timings) object
+
+```js
+var validate = require('har-validator')
+
+validate.timings(data.then(function (HAR) {
+ console.log('horray!')
+ })
+ .catch(function (error) {
+ console.error(error)
+ })
+```
+
+----
+
+## Callback API
+
+### Validate(data [, callback])
+
+> Returns `true` or `false`.
+
+```js
+var HAR = require('./har.json');
+var validate = require('har-validator/lib/async');
+
+validate(HAR, function (e, valid) {
+ if (e) console.log(e.errors)
+
+ if (valid) console.log('horray!');
+});
+
+```
+The async API provides exactly the same methods as the [Promise API](#promise-api)
+
+----
+
+## Support
+
+Donations are welcome to help support the continuous development of this project.
+
+[![Gratipay][gratipay-image]][gratipay-url]
+[![PayPal][paypal-image]][paypal-url]
+[![Flattr][flattr-image]][flattr-url]
+[![Bitcoin][bitcoin-image]][bitcoin-url]
+
+## License
+
+[ISC License](LICENSE) &copy; [Ahmad Nassri](https://www.ahmadnassri.com/)
+
+[license-url]: https://github.com/ahmadnassri/har-validator/blob/master/LICENSE
+
+[travis-url]: https://travis-ci.org/ahmadnassri/har-validator
+[travis-image]: https://img.shields.io/travis/ahmadnassri/har-validator.svg?style=flat-square
+
+[npm-url]: https://www.npmjs.com/package/har-validator
+[npm-license]: https://img.shields.io/npm/l/har-validator.svg?style=flat-square
+[npm-version]: https://img.shields.io/npm/v/har-validator.svg?style=flat-square
+[npm-downloads]: https://img.shields.io/npm/dm/har-validator.svg?style=flat-square
+
+[codeclimate-url]: https://codeclimate.com/github/ahmadnassri/har-validator
+[codeclimate-quality]: https://img.shields.io/codeclimate/github/ahmadnassri/har-validator.svg?style=flat-square
+[codeclimate-coverage]: https://img.shields.io/codeclimate/coverage/github/ahmadnassri/har-validator.svg?style=flat-square
+
+[david-url]: https://david-dm.org/ahmadnassri/har-validator
+[david-image]: https://img.shields.io/david/ahmadnassri/har-validator.svg?style=flat-square
+
+[gratipay-url]: https://www.gratipay.com/ahmadnassri/
+[gratipay-image]: https://img.shields.io/gratipay/ahmadnassri.svg?style=flat-square
+
+[paypal-url]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UJ2B2BTK9VLRS&on0=project&os0=har-validator
+[paypal-image]: http://img.shields.io/badge/paypal-donate-green.svg?style=flat-square
+
+[flattr-url]: https://flattr.com/submit/auto?user_id=ahmadnassri&url=https://github.com/ahmadnassri/har-validator&title=har-validator&language=&tags=github&category=software
+[flattr-image]: http://img.shields.io/badge/flattr-donate-green.svg?style=flat-square
+
+[bitcoin-image]: http://img.shields.io/badge/bitcoin-1Nb46sZRVG3or7pNaDjthcGJpWhvoPpCxy-green.svg?style=flat-square
+[bitcoin-url]: https://www.coinbase.com/checkouts/ae383ae6bb931a2fa5ad11cec115191e?name=har-validator
diff --git a/node_modules/request/node_modules/har-validator/bin/har-validator b/node_modules/request/node_modules/har-validator/bin/har-validator
new file mode 100755
index 000000000..fd7cc0d34
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/bin/har-validator
@@ -0,0 +1,56 @@
+#!/usr/bin/env node
+
+'use strict'
+
+var chalk = require('chalk')
+var cmd = require('commander')
+var fs = require('fs')
+var path = require('path')
+var pkg = require('../package.json')
+var Promise = require('pinkie-promise')
+var validate = require('..')
+var ValidationError = require('../lib/error')
+
+cmd
+ .version(pkg.version)
+ .usage('[options] <files ...>')
+ .option('-s, --schema [name]', 'validate schema name (log, request, response, etc ...)')
+ .parse(process.argv)
+
+if (!cmd.args.length) {
+ cmd.help()
+}
+
+cmd.args.map(function (fileName) {
+ var file = chalk.yellow.italic(path.basename(fileName))
+
+ new Promise(function (resolve, reject) {
+ fs.readFile(fileName, function (err, data) {
+ return err === null ? resolve(data) : reject(err)
+ })
+ })
+
+ .then(JSON.parse)
+
+ .then(cmd.schema ? validate[cmd.schema] : validate)
+
+ .then(function (data) {
+ console.log('%s [%s] is valid', chalk.green('✓'), file)
+ })
+
+ .catch(function (err) {
+ if (err instanceof SyntaxError) {
+ return console.error('%s [%s] failed to read JSON: %s', chalk.red('✖'), file, chalk.red(err.message))
+ }
+
+ if (err instanceof ValidationError) {
+ err.errors.forEach(function (details) {
+ console.error('%s [%s] failed validation: (%s: %s) %s', chalk.red('✖'), file, chalk.cyan.italic(details.field), chalk.magenta.italic(details.value), chalk.red(details.message))
+ })
+
+ return
+ }
+
+ console.error('%s [%s] an unknown error has occured: %s', chalk.red('✖'), file, chalk.red(err.message))
+ })
+})
diff --git a/node_modules/request/node_modules/har-validator/lib/async.js b/node_modules/request/node_modules/har-validator/lib/async.js
new file mode 100644
index 000000000..77b99a7db
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/async.js
@@ -0,0 +1,14 @@
+'use strict'
+
+var runner = require('./runner')
+var schemas = require('./schemas')
+
+module.exports = function (data, cb) {
+ return runner(schemas.har, data, cb)
+}
+
+Object.keys(schemas).map(function (name) {
+ module.exports[name] = function (data, cb) {
+ return runner(schemas[name], data, cb)
+ }
+})
diff --git a/node_modules/request/node_modules/har-validator/lib/error.js b/node_modules/request/node_modules/har-validator/lib/error.js
new file mode 100644
index 000000000..fc08a8721
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/error.js
@@ -0,0 +1,10 @@
+'use strict'
+
+function ValidationError (errors) {
+ this.name = 'ValidationError'
+ this.errors = errors
+}
+
+ValidationError.prototype = Error.prototype
+
+module.exports = ValidationError
diff --git a/node_modules/request/node_modules/har-validator/lib/index.js b/node_modules/request/node_modules/har-validator/lib/index.js
new file mode 100644
index 000000000..e8351b8d5
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/index.js
@@ -0,0 +1,22 @@
+'use strict'
+
+var Promise = require('pinkie-promise')
+var runner = require('./runner')
+var schemas = require('./schemas')
+
+var promisify = function (schema) {
+ return function (data) {
+ return new Promise(function (resolve, reject) {
+ runner(schema, data, function (err, valid) {
+ return err === null ? resolve(data) : reject(err)
+ })
+ })
+ }
+}
+
+module.exports = promisify(schemas.har)
+
+// utility methods for all parts of the schema
+Object.keys(schemas).map(function (name) {
+ module.exports[name] = promisify(schemas[name])
+})
diff --git a/node_modules/request/node_modules/har-validator/lib/runner.js b/node_modules/request/node_modules/har-validator/lib/runner.js
new file mode 100644
index 000000000..f0ed484e1
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/runner.js
@@ -0,0 +1,29 @@
+'use strict'
+
+var schemas = require('./schemas')
+var ValidationError = require('./error')
+var validator = require('is-my-json-valid')
+
+module.exports = function (schema, data, cb) {
+ // default value
+ var valid = false
+
+ // validator config
+ var validate = validator(schema, {
+ greedy: true,
+ verbose: true,
+ schemas: schemas
+ })
+
+ // execute is-my-json-valid
+ if (data !== undefined) {
+ valid = validate(data)
+ }
+
+ // callback?
+ if (typeof cb === 'function') {
+ return cb(validate.errors ? new ValidationError(validate.errors) : null, valid)
+ }
+
+ return valid
+}
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/cache.json b/node_modules/request/node_modules/har-validator/lib/schemas/cache.json
new file mode 100644
index 000000000..a3ab682d5
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/cache.json
@@ -0,0 +1,13 @@
+{
+ "properties": {
+ "beforeRequest": {
+ "$ref": "#cacheEntry"
+ },
+ "afterRequest": {
+ "$ref": "#cacheEntry"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/cacheEntry.json b/node_modules/request/node_modules/har-validator/lib/schemas/cacheEntry.json
new file mode 100644
index 000000000..a397439fd
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/cacheEntry.json
@@ -0,0 +1,31 @@
+{
+ "oneOf": [{
+ "type": "object",
+ "optional": true,
+ "required": [
+ "lastAccess",
+ "eTag",
+ "hitCount"
+ ],
+ "properties": {
+ "expires": {
+ "type": "string"
+ },
+ "lastAccess": {
+ "type": "string"
+ },
+ "eTag": {
+ "type": "string"
+ },
+ "hitCount": {
+ "type": "integer"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+ }, {
+ "type": null,
+ "additionalProperties": false
+ }]
+}
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/content.json b/node_modules/request/node_modules/har-validator/lib/schemas/content.json
new file mode 100644
index 000000000..3710d7939
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/content.json
@@ -0,0 +1,27 @@
+{
+ "type": "object",
+ "required": [
+ "size",
+ "mimeType"
+ ],
+ "properties": {
+ "size": {
+ "type": "integer"
+ },
+ "compression": {
+ "type": "integer"
+ },
+ "mimeType": {
+ "type": "string"
+ },
+ "text": {
+ "type": "string"
+ },
+ "encoding": {
+ "type": "string"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/cookie.json b/node_modules/request/node_modules/har-validator/lib/schemas/cookie.json
new file mode 100644
index 000000000..576818183
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/cookie.json
@@ -0,0 +1,34 @@
+{
+ "type": "object",
+ "required": [
+ "name",
+ "value"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "domain": {
+ "type": "string"
+ },
+ "expires": {
+ "type": ["string", "null"],
+ "format": "date-time"
+ },
+ "httpOnly": {
+ "type": "boolean"
+ },
+ "secure": {
+ "type": "boolean"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/creator.json b/node_modules/request/node_modules/har-validator/lib/schemas/creator.json
new file mode 100644
index 000000000..505860064
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/creator.json
@@ -0,0 +1,18 @@
+{
+ "type": "object",
+ "required": [
+ "name",
+ "version"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "version": {
+ "type": "string"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/entry.json b/node_modules/request/node_modules/har-validator/lib/schemas/entry.json
new file mode 100644
index 000000000..8a9c022bd
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/entry.json
@@ -0,0 +1,51 @@
+{
+ "type": "object",
+ "optional": true,
+ "required": [
+ "startedDateTime",
+ "time",
+ "request",
+ "response",
+ "cache",
+ "timings"
+ ],
+ "properties": {
+ "pageref": {
+ "type": "string"
+ },
+ "startedDateTime": {
+ "type": "string",
+ "format": "date-time",
+ "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"
+ },
+ "time": {
+ "type": "number",
+ "min": 0
+ },
+ "request": {
+ "$ref": "#request"
+ },
+ "response": {
+ "$ref": "#response"
+ },
+ "cache": {
+ "$ref": "#cache"
+ },
+ "timings": {
+ "$ref": "#timings"
+ },
+ "serverIPAddress": {
+ "type": "string",
+ "oneOf": [
+ { "format": "ipv4" },
+ { "format": "ipv6" }
+ ]
+ },
+ "connection": {
+ "type": "string"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/har.json b/node_modules/request/node_modules/har-validator/lib/schemas/har.json
new file mode 100644
index 000000000..b542782db
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/har.json
@@ -0,0 +1,11 @@
+{
+ "type": "object",
+ "required": [
+ "log"
+ ],
+ "properties": {
+ "log": {
+ "$ref": "#log"
+ }
+ }
+}
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/index.js b/node_modules/request/node_modules/har-validator/lib/schemas/index.js
new file mode 100644
index 000000000..7b6db7dab
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/index.js
@@ -0,0 +1,49 @@
+'use strict'
+
+var schemas = {
+ cache: require('./cache.json'),
+ cacheEntry: require('./cacheEntry.json'),
+ content: require('./content.json'),
+ cookie: require('./cookie.json'),
+ creator: require('./creator.json'),
+ entry: require('./entry.json'),
+ har: require('./har.json'),
+ log: require('./log.json'),
+ page: require('./page.json'),
+ pageTimings: require('./pageTimings.json'),
+ postData: require('./postData.json'),
+ record: require('./record.json'),
+ request: require('./request.json'),
+ response: require('./response.json'),
+ timings: require('./timings.json')
+}
+
+// is-my-json-valid does not provide meaningful error messages for external schemas
+// this is a workaround
+schemas.cache.properties.beforeRequest = schemas.cacheEntry
+schemas.cache.properties.afterRequest = schemas.cacheEntry
+
+schemas.page.properties.pageTimings = schemas.pageTimings
+
+schemas.request.properties.cookies.items = schemas.cookie
+schemas.request.properties.headers.items = schemas.record
+schemas.request.properties.queryString.items = schemas.record
+schemas.request.properties.postData = schemas.postData
+
+schemas.response.properties.cookies.items = schemas.cookie
+schemas.response.properties.headers.items = schemas.record
+schemas.response.properties.content = schemas.content
+
+schemas.entry.properties.request = schemas.request
+schemas.entry.properties.response = schemas.response
+schemas.entry.properties.cache = schemas.cache
+schemas.entry.properties.timings = schemas.timings
+
+schemas.log.properties.creator = schemas.creator
+schemas.log.properties.browser = schemas.creator
+schemas.log.properties.pages.items = schemas.page
+schemas.log.properties.entries.items = schemas.entry
+
+schemas.har.properties.log = schemas.log
+
+module.exports = schemas
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/log.json b/node_modules/request/node_modules/har-validator/lib/schemas/log.json
new file mode 100644
index 000000000..0c91d38bf
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/log.json
@@ -0,0 +1,34 @@
+{
+ "type": "object",
+ "required": [
+ "version",
+ "creator",
+ "entries"
+ ],
+ "properties": {
+ "version": {
+ "type": "string"
+ },
+ "creator": {
+ "$ref": "#creator"
+ },
+ "browser": {
+ "$ref": "#creator"
+ },
+ "pages": {
+ "type": "array",
+ "items": {
+ "$ref": "#page"
+ }
+ },
+ "entries": {
+ "type": "array",
+ "items": {
+ "$ref": "#entry"
+ }
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/page.json b/node_modules/request/node_modules/har-validator/lib/schemas/page.json
new file mode 100644
index 000000000..ef64abe5c
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/page.json
@@ -0,0 +1,30 @@
+{
+ "type": "object",
+ "optional": true,
+ "required": [
+ "startedDateTime",
+ "id",
+ "title",
+ "pageTimings"
+ ],
+ "properties": {
+ "startedDateTime": {
+ "type": "string",
+ "format": "date-time",
+ "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"
+ },
+ "id": {
+ "type": "string",
+ "unique": true
+ },
+ "title": {
+ "type": "string"
+ },
+ "pageTimings": {
+ "$ref": "#pageTimings"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/pageTimings.json b/node_modules/request/node_modules/har-validator/lib/schemas/pageTimings.json
new file mode 100644
index 000000000..adc83cccd
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/pageTimings.json
@@ -0,0 +1,16 @@
+{
+ "type": "object",
+ "properties": {
+ "onContentLoad": {
+ "type": "number",
+ "min": -1
+ },
+ "onLoad": {
+ "type": "number",
+ "min": -1
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/postData.json b/node_modules/request/node_modules/har-validator/lib/schemas/postData.json
new file mode 100644
index 000000000..91958b64a
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/postData.json
@@ -0,0 +1,41 @@
+{
+ "type": "object",
+ "optional": true,
+ "required": [
+ "mimeType"
+ ],
+ "properties": {
+ "mimeType": {
+ "type": "string"
+ },
+ "text": {
+ "type": "string"
+ },
+ "params": {
+ "type": "array",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "fileName": {
+ "type": "string"
+ },
+ "contentType": {
+ "type": "string"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/record.json b/node_modules/request/node_modules/har-validator/lib/schemas/record.json
new file mode 100644
index 000000000..04acd5194
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/record.json
@@ -0,0 +1,18 @@
+{
+ "type": "object",
+ "required": [
+ "name",
+ "value"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/request.json b/node_modules/request/node_modules/har-validator/lib/schemas/request.json
new file mode 100644
index 000000000..639af06dc
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/request.json
@@ -0,0 +1,55 @@
+{
+ "type": "object",
+ "required": [
+ "method",
+ "url",
+ "httpVersion",
+ "cookies",
+ "headers",
+ "queryString",
+ "headersSize",
+ "bodySize"
+ ],
+ "properties": {
+ "method": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string",
+ "format": "uri"
+ },
+ "httpVersion": {
+ "type": "string"
+ },
+ "cookies": {
+ "type": "array",
+ "items": {
+ "$ref": "#cookie"
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "$ref": "#record"
+ }
+ },
+ "queryString": {
+ "type": "array",
+ "items": {
+ "$ref": "#record"
+ }
+ },
+ "postData": {
+ "$ref": "#postData"
+ },
+ "headersSize": {
+ "type": "integer"
+ },
+ "bodySize": {
+ "type": "integer"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/response.json b/node_modules/request/node_modules/har-validator/lib/schemas/response.json
new file mode 100644
index 000000000..de99c55bb
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/response.json
@@ -0,0 +1,52 @@
+{
+ "type": "object",
+ "required": [
+ "status",
+ "statusText",
+ "httpVersion",
+ "cookies",
+ "headers",
+ "content",
+ "redirectURL",
+ "headersSize",
+ "bodySize"
+ ],
+ "properties": {
+ "status": {
+ "type": "integer"
+ },
+ "statusText": {
+ "type": "string"
+ },
+ "httpVersion": {
+ "type": "string"
+ },
+ "cookies": {
+ "type": "array",
+ "items": {
+ "$ref": "#cookie"
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "$ref": "#record"
+ }
+ },
+ "content": {
+ "$ref": "#content"
+ },
+ "redirectURL": {
+ "type": "string"
+ },
+ "headersSize": {
+ "type": "integer"
+ },
+ "bodySize": {
+ "type": "integer"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
diff --git a/node_modules/request/node_modules/har-validator/lib/schemas/timings.json b/node_modules/request/node_modules/har-validator/lib/schemas/timings.json
new file mode 100644
index 000000000..066ef71a1
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/lib/schemas/timings.json
@@ -0,0 +1,40 @@
+{
+ "required": [
+ "send",
+ "wait",
+ "receive"
+ ],
+ "properties": {
+ "dns": {
+ "type": "number",
+ "min": -1
+ },
+ "connect": {
+ "type": "number",
+ "min": -1
+ },
+ "blocked": {
+ "type": "number",
+ "min": -1
+ },
+ "send": {
+ "type": "number",
+ "min": -1
+ },
+ "wait": {
+ "type": "number",
+ "min": -1
+ },
+ "receive": {
+ "type": "number",
+ "min": -1
+ },
+ "ssl": {
+ "type": "number",
+ "min": -1
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js
new file mode 100644
index 000000000..2d85a9174
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js
@@ -0,0 +1,116 @@
+'use strict';
+var escapeStringRegexp = require('escape-string-regexp');
+var ansiStyles = require('ansi-styles');
+var stripAnsi = require('strip-ansi');
+var hasAnsi = require('has-ansi');
+var supportsColor = require('supports-color');
+var defineProps = Object.defineProperties;
+var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM);
+
+function Chalk(options) {
+ // detect mode if not set manually
+ this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled;
+}
+
+// use bright blue on Windows as the normal blue color is illegible
+if (isSimpleWindowsTerm) {
+ ansiStyles.blue.open = '\u001b[94m';
+}
+
+var styles = (function () {
+ var ret = {};
+
+ Object.keys(ansiStyles).forEach(function (key) {
+ ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
+
+ ret[key] = {
+ get: function () {
+ return build.call(this, this._styles.concat(key));
+ }
+ };
+ });
+
+ return ret;
+})();
+
+var proto = defineProps(function chalk() {}, styles);
+
+function build(_styles) {
+ var builder = function () {
+ return applyStyle.apply(builder, arguments);
+ };
+
+ builder._styles = _styles;
+ builder.enabled = this.enabled;
+ // __proto__ is used because we must return a function, but there is
+ // no way to create a function with a different prototype.
+ /* eslint-disable no-proto */
+ builder.__proto__ = proto;
+
+ return builder;
+}
+
+function applyStyle() {
+ // support varags, but simply cast to string in case there's only one arg
+ var args = arguments;
+ var argsLen = args.length;
+ var str = argsLen !== 0 && String(arguments[0]);
+
+ if (argsLen > 1) {
+ // don't slice `arguments`, it prevents v8 optimizations
+ for (var a = 1; a < argsLen; a++) {
+ str += ' ' + args[a];
+ }
+ }
+
+ if (!this.enabled || !str) {
+ return str;
+ }
+
+ var nestedStyles = this._styles;
+ var i = nestedStyles.length;
+
+ // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
+ // see https://github.com/chalk/chalk/issues/58
+ // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
+ var originalDim = ansiStyles.dim.open;
+ if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) {
+ ansiStyles.dim.open = '';
+ }
+
+ while (i--) {
+ var code = ansiStyles[nestedStyles[i]];
+
+ // Replace any instances already present with a re-opening code
+ // otherwise only the part of the string until said closing code
+ // will be colored, and the rest will simply be 'plain'.
+ str = code.open + str.replace(code.closeRe, code.open) + code.close;
+ }
+
+ // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue.
+ ansiStyles.dim.open = originalDim;
+
+ return str;
+}
+
+function init() {
+ var ret = {};
+
+ Object.keys(styles).forEach(function (name) {
+ ret[name] = {
+ get: function () {
+ return build.call(this, [name]);
+ }
+ };
+ });
+
+ return ret;
+}
+
+defineProps(Chalk.prototype, init());
+
+module.exports = new Chalk();
+module.exports.styles = ansiStyles;
+module.exports.hasColor = hasAnsi;
+module.exports.stripColor = stripAnsi;
+module.exports.supportsColor = supportsColor;
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/license b/node_modules/request/node_modules/har-validator/node_modules/chalk/license
new file mode 100644
index 000000000..654d0bfe9
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/index.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/index.js
new file mode 100644
index 000000000..78945278f
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/index.js
@@ -0,0 +1,65 @@
+'use strict';
+
+function assembleStyles () {
+ var styles = {
+ modifiers: {
+ reset: [0, 0],
+ bold: [1, 22], // 21 isn't widely supported and 22 does the same thing
+ dim: [2, 22],
+ italic: [3, 23],
+ underline: [4, 24],
+ inverse: [7, 27],
+ hidden: [8, 28],
+ strikethrough: [9, 29]
+ },
+ colors: {
+ black: [30, 39],
+ red: [31, 39],
+ green: [32, 39],
+ yellow: [33, 39],
+ blue: [34, 39],
+ magenta: [35, 39],
+ cyan: [36, 39],
+ white: [37, 39],
+ gray: [90, 39]
+ },
+ bgColors: {
+ bgBlack: [40, 49],
+ bgRed: [41, 49],
+ bgGreen: [42, 49],
+ bgYellow: [43, 49],
+ bgBlue: [44, 49],
+ bgMagenta: [45, 49],
+ bgCyan: [46, 49],
+ bgWhite: [47, 49]
+ }
+ };
+
+ // fix humans
+ styles.colors.grey = styles.colors.gray;
+
+ Object.keys(styles).forEach(function (groupName) {
+ var group = styles[groupName];
+
+ Object.keys(group).forEach(function (styleName) {
+ var style = group[styleName];
+
+ styles[styleName] = group[styleName] = {
+ open: '\u001b[' + style[0] + 'm',
+ close: '\u001b[' + style[1] + 'm'
+ };
+ });
+
+ Object.defineProperty(styles, groupName, {
+ value: group,
+ enumerable: false
+ });
+ });
+
+ return styles;
+}
+
+Object.defineProperty(module, 'exports', {
+ enumerable: true,
+ get: assembleStyles
+});
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/license b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/license
new file mode 100644
index 000000000..654d0bfe9
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json
new file mode 100644
index 000000000..f2e9595b8
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json
@@ -0,0 +1,71 @@
+{
+ "name": "ansi-styles",
+ "version": "2.1.0",
+ "description": "ANSI escape codes for styling strings in the terminal",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/chalk/ansi-styles.git"
+ },
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "maintainers": [
+ {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ {
+ "name": "Joshua Appelman",
+ "email": "jappelman@xebia.com",
+ "url": "jbnicolai.com"
+ }
+ ],
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "tty",
+ "escape",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "log",
+ "logging",
+ "command-line",
+ "text"
+ ],
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "readme": "# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)\n\n> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal\n\nYou probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.\n\n![](screenshot.png)\n\n\n## Install\n\n```\n$ npm install --save ansi-styles\n```\n\n\n## Usage\n\n```js\nvar ansi = require('ansi-styles');\n\nconsole.log(ansi.green.open + 'Hello world!' + ansi.green.close);\n```\n\n\n## API\n\nEach style has an `open` and `close` property.\n\n\n## Styles\n\n### Modifiers\n\n- `reset`\n- `bold`\n- `dim`\n- `italic` *(not widely supported)*\n- `underline`\n- `inverse`\n- `hidden`\n- `strikethrough` *(not widely supported)*\n\n### Colors\n\n- `black`\n- `red`\n- `green`\n- `yellow`\n- `blue`\n- `magenta`\n- `cyan`\n- `white`\n- `gray`\n\n### Background colors\n\n- `bgBlack`\n- `bgRed`\n- `bgGreen`\n- `bgYellow`\n- `bgBlue`\n- `bgMagenta`\n- `bgCyan`\n- `bgWhite`\n\n\n## Advanced usage\n\nBy default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.\n\n- `ansi.modifiers`\n- `ansi.colors`\n- `ansi.bgColors`\n\n\n###### Example\n\n```js\nconsole.log(ansi.colors.green.open);\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
+ "readmeFilename": "readme.md",
+ "bugs": {
+ "url": "https://github.com/chalk/ansi-styles/issues"
+ },
+ "homepage": "https://github.com/chalk/ansi-styles#readme",
+ "_id": "ansi-styles@2.1.0",
+ "_shasum": "990f747146927b559a932bf92959163d60c0d0e2",
+ "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz",
+ "_from": "ansi-styles@>=2.1.0 <3.0.0"
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/readme.md b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/readme.md
new file mode 100644
index 000000000..3f933f616
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/readme.md
@@ -0,0 +1,86 @@
+# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)
+
+> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
+
+You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
+
+![](screenshot.png)
+
+
+## Install
+
+```
+$ npm install --save ansi-styles
+```
+
+
+## Usage
+
+```js
+var ansi = require('ansi-styles');
+
+console.log(ansi.green.open + 'Hello world!' + ansi.green.close);
+```
+
+
+## API
+
+Each style has an `open` and `close` property.
+
+
+## Styles
+
+### Modifiers
+
+- `reset`
+- `bold`
+- `dim`
+- `italic` *(not widely supported)*
+- `underline`
+- `inverse`
+- `hidden`
+- `strikethrough` *(not widely supported)*
+
+### Colors
+
+- `black`
+- `red`
+- `green`
+- `yellow`
+- `blue`
+- `magenta`
+- `cyan`
+- `white`
+- `gray`
+
+### Background colors
+
+- `bgBlack`
+- `bgRed`
+- `bgGreen`
+- `bgYellow`
+- `bgBlue`
+- `bgMagenta`
+- `bgCyan`
+- `bgWhite`
+
+
+## Advanced usage
+
+By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
+
+- `ansi.modifiers`
+- `ansi.colors`
+- `ansi.bgColors`
+
+
+###### Example
+
+```js
+console.log(ansi.colors.green.open);
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js
new file mode 100644
index 000000000..ac6572cab
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js
@@ -0,0 +1,11 @@
+'use strict';
+
+var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
+
+module.exports = function (str) {
+ if (typeof str !== 'string') {
+ throw new TypeError('Expected a string');
+ }
+
+ return str.replace(matchOperatorsRe, '\\$&');
+};
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/license b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/license
new file mode 100644
index 000000000..654d0bfe9
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json
new file mode 100644
index 000000000..b2bafb26a
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json
@@ -0,0 +1,61 @@
+{
+ "name": "escape-string-regexp",
+ "version": "1.0.3",
+ "description": "Escape RegExp special characters",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/escape-string-regexp.git"
+ },
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "http://sindresorhus.com"
+ },
+ "maintainers": [
+ {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "http://sindresorhus.com"
+ },
+ {
+ "name": "Joshua Appelman",
+ "email": "jappelman@xebia.com",
+ "url": "http://jbnicolai.com"
+ }
+ ],
+ "engines": {
+ "node": ">=0.8.0"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "regex",
+ "regexp",
+ "re",
+ "regular",
+ "expression",
+ "escape",
+ "string",
+ "str",
+ "special",
+ "characters"
+ ],
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "readme": "# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp)\n\n> Escape RegExp special characters\n\n\n## Install\n\n```sh\n$ npm install --save escape-string-regexp\n```\n\n\n## Usage\n\n```js\nvar escapeStringRegexp = require('escape-string-regexp');\n\nvar escapedString = escapeStringRegexp('how much $ for a unicorn?');\n//=> how much \\$ for a unicorn\\?\n\nnew RegExp(escapedString);\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
+ "readmeFilename": "readme.md",
+ "bugs": {
+ "url": "https://github.com/sindresorhus/escape-string-regexp/issues"
+ },
+ "homepage": "https://github.com/sindresorhus/escape-string-regexp#readme",
+ "_id": "escape-string-regexp@1.0.3",
+ "_shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5",
+ "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz",
+ "_from": "escape-string-regexp@>=1.0.2 <2.0.0"
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md
new file mode 100644
index 000000000..808a963a8
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md
@@ -0,0 +1,27 @@
+# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp)
+
+> Escape RegExp special characters
+
+
+## Install
+
+```sh
+$ npm install --save escape-string-regexp
+```
+
+
+## Usage
+
+```js
+var escapeStringRegexp = require('escape-string-regexp');
+
+var escapedString = escapeStringRegexp('how much $ for a unicorn?');
+//=> how much \$ for a unicorn\?
+
+new RegExp(escapedString);
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/index.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/index.js
new file mode 100644
index 000000000..98fae0676
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/index.js
@@ -0,0 +1,4 @@
+'use strict';
+var ansiRegex = require('ansi-regex');
+var re = new RegExp(ansiRegex().source); // remove the `g` flag
+module.exports = re.test.bind(re);
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/license b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/license
new file mode 100644
index 000000000..654d0bfe9
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json
new file mode 100644
index 000000000..15f623780
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json
@@ -0,0 +1,76 @@
+{
+ "name": "has-ansi",
+ "version": "2.0.0",
+ "description": "Check if a string has ANSI escape codes",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/has-ansi.git"
+ },
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "maintainers": [
+ {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ {
+ "name": "Joshua Appelman",
+ "email": "jappelman@xebia.com",
+ "url": "jbnicolai.com"
+ }
+ ],
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "string",
+ "tty",
+ "escape",
+ "shell",
+ "xterm",
+ "command-line",
+ "text",
+ "regex",
+ "regexp",
+ "re",
+ "match",
+ "test",
+ "find",
+ "pattern",
+ "has"
+ ],
+ "dependencies": {
+ "ansi-regex": "^2.0.0"
+ },
+ "devDependencies": {
+ "ava": "0.0.4"
+ },
+ "readme": "# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi)\n\n> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)\n\n\n## Install\n\n```\n$ npm install --save has-ansi\n```\n\n\n## Usage\n\n```js\nvar hasAnsi = require('has-ansi');\n\nhasAnsi('\\u001b[4mcake\\u001b[0m');\n//=> true\n\nhasAnsi('cake');\n//=> false\n```\n\n\n## Related\n\n- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module\n- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes\n- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes\n- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
+ "readmeFilename": "readme.md",
+ "bugs": {
+ "url": "https://github.com/sindresorhus/has-ansi/issues"
+ },
+ "homepage": "https://github.com/sindresorhus/has-ansi#readme",
+ "_id": "has-ansi@2.0.0",
+ "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91",
+ "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
+ "_from": "has-ansi@>=2.0.0 <3.0.0"
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/readme.md b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/readme.md
new file mode 100644
index 000000000..02bc7c230
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/readme.md
@@ -0,0 +1,36 @@
+# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi)
+
+> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
+
+
+## Install
+
+```
+$ npm install --save has-ansi
+```
+
+
+## Usage
+
+```js
+var hasAnsi = require('has-ansi');
+
+hasAnsi('\u001b[4mcake\u001b[0m');
+//=> true
+
+hasAnsi('cake');
+//=> false
+```
+
+
+## Related
+
+- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module
+- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes
+- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes
+- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/index.js b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/index.js
new file mode 100644
index 000000000..4346e272e
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/index.js
@@ -0,0 +1,50 @@
+'use strict';
+var argv = process.argv;
+
+var terminator = argv.indexOf('--');
+var hasFlag = function (flag) {
+ flag = '--' + flag;
+ var pos = argv.indexOf(flag);
+ return pos !== -1 && (terminator !== -1 ? pos < terminator : true);
+};
+
+module.exports = (function () {
+ if ('FORCE_COLOR' in process.env) {
+ return true;
+ }
+
+ if (hasFlag('no-color') ||
+ hasFlag('no-colors') ||
+ hasFlag('color=false')) {
+ return false;
+ }
+
+ if (hasFlag('color') ||
+ hasFlag('colors') ||
+ hasFlag('color=true') ||
+ hasFlag('color=always')) {
+ return true;
+ }
+
+ if (process.stdout && !process.stdout.isTTY) {
+ return false;
+ }
+
+ if (process.platform === 'win32') {
+ return true;
+ }
+
+ if ('COLORTERM' in process.env) {
+ return true;
+ }
+
+ if (process.env.TERM === 'dumb') {
+ return false;
+ }
+
+ if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
+ return true;
+ }
+
+ return false;
+})();
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/license b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/license
new file mode 100644
index 000000000..654d0bfe9
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json
new file mode 100644
index 000000000..c43b7aa8c
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json
@@ -0,0 +1,70 @@
+{
+ "name": "supports-color",
+ "version": "2.0.0",
+ "description": "Detect whether a terminal supports color",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/chalk/supports-color.git"
+ },
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "maintainers": [
+ {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ {
+ "name": "Joshua Appelman",
+ "email": "jappelman@xebia.com",
+ "url": "jbnicolai.com"
+ }
+ ],
+ "engines": {
+ "node": ">=0.8.0"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "ansi",
+ "styles",
+ "tty",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "command-line",
+ "support",
+ "supports",
+ "capability",
+ "detect"
+ ],
+ "devDependencies": {
+ "mocha": "*",
+ "require-uncached": "^1.0.2"
+ },
+ "readme": "# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)\n\n> Detect whether a terminal supports color\n\n\n## Install\n\n```\n$ npm install --save supports-color\n```\n\n\n## Usage\n\n```js\nvar supportsColor = require('supports-color');\n\nif (supportsColor) {\n\tconsole.log('Terminal supports color');\n}\n```\n\nIt obeys the `--color` and `--no-color` CLI flags.\n\nFor situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.\n\n\n## Related\n\n- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module\n- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
+ "readmeFilename": "readme.md",
+ "bugs": {
+ "url": "https://github.com/chalk/supports-color/issues"
+ },
+ "homepage": "https://github.com/chalk/supports-color#readme",
+ "_id": "supports-color@2.0.0",
+ "_shasum": "535d045ce6b6363fa40117084629995e9df324c7",
+ "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "_from": "supports-color@>=2.0.0 <3.0.0"
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/readme.md b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/readme.md
new file mode 100644
index 000000000..b4761f1ec
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/readme.md
@@ -0,0 +1,36 @@
+# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)
+
+> Detect whether a terminal supports color
+
+
+## Install
+
+```
+$ npm install --save supports-color
+```
+
+
+## Usage
+
+```js
+var supportsColor = require('supports-color');
+
+if (supportsColor) {
+ console.log('Terminal supports color');
+}
+```
+
+It obeys the `--color` and `--no-color` CLI flags.
+
+For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.
+
+
+## Related
+
+- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
+- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json
new file mode 100644
index 000000000..2ad36d4d9
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json
@@ -0,0 +1,95 @@
+{
+ "name": "chalk",
+ "version": "1.1.1",
+ "description": "Terminal string styling done right. Much color.",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/chalk/chalk.git"
+ },
+ "maintainers": [
+ {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ {
+ "name": "Joshua Appelman",
+ "email": "jappelman@xebia.com",
+ "url": "jbnicolai.com"
+ },
+ {
+ "name": "JD Ballard",
+ "email": "i.am.qix@gmail.com",
+ "url": "github.com/qix-"
+ }
+ ],
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "xo && mocha",
+ "bench": "matcha benchmark.js",
+ "coverage": "nyc npm test && nyc report",
+ "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "str",
+ "ansi",
+ "style",
+ "styles",
+ "tty",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "log",
+ "logging",
+ "command-line",
+ "text"
+ ],
+ "dependencies": {
+ "ansi-styles": "^2.1.0",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ },
+ "devDependencies": {
+ "coveralls": "^2.11.2",
+ "matcha": "^0.6.0",
+ "mocha": "*",
+ "nyc": "^3.0.0",
+ "require-uncached": "^1.0.2",
+ "resolve-from": "^1.0.0",
+ "semver": "^4.3.3",
+ "xo": "*"
+ },
+ "xo": {
+ "envs": [
+ "node",
+ "mocha"
+ ]
+ },
+ "readme": "<h1 align=\"center\">\n\t<br>\n\t<br>\n\t<img width=\"360\" src=\"https://cdn.rawgit.com/chalk/chalk/19935d6484811c5e468817f846b7b3d417d7bf4a/logo.svg\" alt=\"chalk\">\n\t<br>\n\t<br>\n\t<br>\n</h1>\n\n> Terminal string styling done right\n\n[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk)\n[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master)\n[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4)\n\n\n[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough.\n\n**Chalk is a clean and focused alternative.**\n\n![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png)\n\n\n## Why\n\n- Highly performant\n- Doesn't extend `String.prototype`\n- Expressive API\n- Ability to nest styles\n- Clean and focused\n- Auto-detects color support\n- Actively maintained\n- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015\n\n\n## Install\n\n```\n$ npm install --save chalk\n```\n\n\n## Usage\n\nChalk comes with an easy to use composable API where you just chain and nest the styles you want.\n\n```js\nvar chalk = require('chalk');\n\n// style a string\nchalk.blue('Hello world!');\n\n// combine styled and normal strings\nchalk.blue('Hello') + 'World' + chalk.red('!');\n\n// compose multiple styles using the chainable API\nchalk.blue.bgRed.bold('Hello world!');\n\n// pass in multiple arguments\nchalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz');\n\n// nest styles\nchalk.red('Hello', chalk.underline.bgBlue('world') + '!');\n\n// nest styles of the same type even (color, underline, background)\nchalk.green(\n\t'I am a green line ' +\n\tchalk.blue.underline.bold('with a blue substring') +\n\t' that becomes green again!'\n);\n```\n\nEasily define your own themes.\n\n```js\nvar chalk = require('chalk');\nvar error = chalk.bold.red;\nconsole.log(error('Error!'));\n```\n\nTake advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data).\n\n```js\nvar name = 'Sindre';\nconsole.log(chalk.green('Hello %s'), name);\n//=> Hello Sindre\n```\n\n\n## API\n\n### chalk.`<style>[.<style>...](string, [string...])`\n\nExample: `chalk.red.bold.underline('Hello', 'world');`\n\nChain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `Chalk.red.yellow.green` is equivalent to `Chalk.green`.\n\nMultiple arguments will be separated by space.\n\n### chalk.enabled\n\nColor support is automatically detected, but you can override it by setting the `enabled` property. You should however only do this in your own code as it applies globally to all chalk consumers.\n\nIf you need to change this in a reusable module create a new instance:\n\n```js\nvar ctx = new chalk.constructor({enabled: false});\n```\n\n### chalk.supportsColor\n\nDetect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.\n\nCan be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.\n\n### chalk.styles\n\nExposes the styles as [ANSI escape codes](https://github.com/chalk/ansi-styles).\n\nGenerally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with your own.\n\n```js\nvar chalk = require('chalk');\n\nconsole.log(chalk.styles.red);\n//=> {open: '\\u001b[31m', close: '\\u001b[39m'}\n\nconsole.log(chalk.styles.red.open + 'Hello' + chalk.styles.red.close);\n```\n\n### chalk.hasColor(string)\n\nCheck whether a string [has color](https://github.com/chalk/has-ansi).\n\n### chalk.stripColor(string)\n\n[Strip color](https://github.com/chalk/strip-ansi) from a string.\n\nCan be useful in combination with `.supportsColor` to strip color on externally styled text when it's not supported.\n\nExample:\n\n```js\nvar chalk = require('chalk');\nvar styledString = getText();\n\nif (!chalk.supportsColor) {\n\tstyledString = chalk.stripColor(styledString);\n}\n```\n\n\n## Styles\n\n### Modifiers\n\n- `reset`\n- `bold`\n- `dim`\n- `italic` *(not widely supported)*\n- `underline`\n- `inverse`\n- `hidden`\n- `strikethrough` *(not widely supported)*\n\n### Colors\n\n- `black`\n- `red`\n- `green`\n- `yellow`\n- `blue` *(on Windows the bright version is used as normal blue is illegible)*\n- `magenta`\n- `cyan`\n- `white`\n- `gray`\n\n### Background colors\n\n- `bgBlack`\n- `bgRed`\n- `bgGreen`\n- `bgYellow`\n- `bgBlue`\n- `bgMagenta`\n- `bgCyan`\n- `bgWhite`\n\n\n## 256-colors\n\nChalk does not support anything other than the base eight colors, which guarantees it will work on all terminals and systems. Some terminals, specifically `xterm` compliant ones, will support the full range of 8-bit colors. For this the lower level [ansi-256-colors](https://github.com/jbnicolai/ansi-256-colors) package can be used.\n\n\n## Windows\n\nIf you're on Windows, do yourself a favor and use [`cmder`](http://bliker.github.io/cmder/) instead of `cmd.exe`.\n\n\n## Related\n\n- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module\n- [ansi-styles](https://github.com/chalk/ansi-styles/) - ANSI escape codes for styling strings in the terminal\n- [supports-color](https://github.com/chalk/supports-color/) - Detect whether a terminal supports color\n- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes\n- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes\n- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes\n- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
+ "readmeFilename": "readme.md",
+ "bugs": {
+ "url": "https://github.com/chalk/chalk/issues"
+ },
+ "homepage": "https://github.com/chalk/chalk#readme",
+ "_id": "chalk@1.1.1",
+ "_shasum": "509afb67066e7499f7eb3535c77445772ae2d019",
+ "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz",
+ "_from": "chalk@>=1.1.1 <2.0.0"
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md b/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md
new file mode 100644
index 000000000..5cf111e35
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md
@@ -0,0 +1,213 @@
+<h1 align="center">
+ <br>
+ <br>
+ <img width="360" src="https://cdn.rawgit.com/chalk/chalk/19935d6484811c5e468817f846b7b3d417d7bf4a/logo.svg" alt="chalk">
+ <br>
+ <br>
+ <br>
+</h1>
+
+> Terminal string styling done right
+
+[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk)
+[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master)
+[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4)
+
+
+[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough.
+
+**Chalk is a clean and focused alternative.**
+
+![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png)
+
+
+## Why
+
+- Highly performant
+- Doesn't extend `String.prototype`
+- Expressive API
+- Ability to nest styles
+- Clean and focused
+- Auto-detects color support
+- Actively maintained
+- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015
+
+
+## Install
+
+```
+$ npm install --save chalk
+```
+
+
+## Usage
+
+Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
+
+```js
+var chalk = require('chalk');
+
+// style a string
+chalk.blue('Hello world!');
+
+// combine styled and normal strings
+chalk.blue('Hello') + 'World' + chalk.red('!');
+
+// compose multiple styles using the chainable API
+chalk.blue.bgRed.bold('Hello world!');
+
+// pass in multiple arguments
+chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz');
+
+// nest styles
+chalk.red('Hello', chalk.underline.bgBlue('world') + '!');
+
+// nest styles of the same type even (color, underline, background)
+chalk.green(
+ 'I am a green line ' +
+ chalk.blue.underline.bold('with a blue substring') +
+ ' that becomes green again!'
+);
+```
+
+Easily define your own themes.
+
+```js
+var chalk = require('chalk');
+var error = chalk.bold.red;
+console.log(error('Error!'));
+```
+
+Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data).
+
+```js
+var name = 'Sindre';
+console.log(chalk.green('Hello %s'), name);
+//=> Hello Sindre
+```
+
+
+## API
+
+### chalk.`<style>[.<style>...](string, [string...])`
+
+Example: `chalk.red.bold.underline('Hello', 'world');`
+
+Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `Chalk.red.yellow.green` is equivalent to `Chalk.green`.
+
+Multiple arguments will be separated by space.
+
+### chalk.enabled
+
+Color support is automatically detected, but you can override it by setting the `enabled` property. You should however only do this in your own code as it applies globally to all chalk consumers.
+
+If you need to change this in a reusable module create a new instance:
+
+```js
+var ctx = new chalk.constructor({enabled: false});
+```
+
+### chalk.supportsColor
+
+Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
+
+Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.
+
+### chalk.styles
+
+Exposes the styles as [ANSI escape codes](https://github.com/chalk/ansi-styles).
+
+Generally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with your own.
+
+```js
+var chalk = require('chalk');
+
+console.log(chalk.styles.red);
+//=> {open: '\u001b[31m', close: '\u001b[39m'}
+
+console.log(chalk.styles.red.open + 'Hello' + chalk.styles.red.close);
+```
+
+### chalk.hasColor(string)
+
+Check whether a string [has color](https://github.com/chalk/has-ansi).
+
+### chalk.stripColor(string)
+
+[Strip color](https://github.com/chalk/strip-ansi) from a string.
+
+Can be useful in combination with `.supportsColor` to strip color on externally styled text when it's not supported.
+
+Example:
+
+```js
+var chalk = require('chalk');
+var styledString = getText();
+
+if (!chalk.supportsColor) {
+ styledString = chalk.stripColor(styledString);
+}
+```
+
+
+## Styles
+
+### Modifiers
+
+- `reset`
+- `bold`
+- `dim`
+- `italic` *(not widely supported)*
+- `underline`
+- `inverse`
+- `hidden`
+- `strikethrough` *(not widely supported)*
+
+### Colors
+
+- `black`
+- `red`
+- `green`
+- `yellow`
+- `blue` *(on Windows the bright version is used as normal blue is illegible)*
+- `magenta`
+- `cyan`
+- `white`
+- `gray`
+
+### Background colors
+
+- `bgBlack`
+- `bgRed`
+- `bgGreen`
+- `bgYellow`
+- `bgBlue`
+- `bgMagenta`
+- `bgCyan`
+- `bgWhite`
+
+
+## 256-colors
+
+Chalk does not support anything other than the base eight colors, which guarantees it will work on all terminals and systems. Some terminals, specifically `xterm` compliant ones, will support the full range of 8-bit colors. For this the lower level [ansi-256-colors](https://github.com/jbnicolai/ansi-256-colors) package can be used.
+
+
+## Windows
+
+If you're on Windows, do yourself a favor and use [`cmder`](http://bliker.github.io/cmder/) instead of `cmd.exe`.
+
+
+## Related
+
+- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
+- [ansi-styles](https://github.com/chalk/ansi-styles/) - ANSI escape codes for styling strings in the terminal
+- [supports-color](https://github.com/chalk/supports-color/) - Detect whether a terminal supports color
+- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
+- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
+- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
+- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/History.md b/node_modules/request/node_modules/har-validator/node_modules/commander/History.md
new file mode 100644
index 000000000..1b47439cb
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/commander/History.md
@@ -0,0 +1,261 @@
+
+2.9.0 / 2015-10-13
+==================
+
+ * Add option `isDefault` to set default subcommand #415 @Qix-
+ * Add callback to allow filtering or post-processing of help text #434 @djulien
+ * Fix `undefined` text in help information close #414 #416 @zhiyelee
+
+2.8.1 / 2015-04-22
+==================
+
+ * Back out `support multiline description` Close #396 #397
+
+2.8.0 / 2015-04-07
+==================
+
+ * Add `process.execArg` support, execution args like `--harmony` will be passed to sub-commands #387 @DigitalIO @zhiyelee
+ * Fix bug in Git-style sub-commands #372 @zhiyelee
+ * Allow commands to be hidden from help #383 @tonylukasavage
+ * When git-style sub-commands are in use, yet none are called, display help #382 @claylo
+ * Add ability to specify arguments syntax for top-level command #258 @rrthomas
+ * Support multiline descriptions #208 @zxqfox
+
+2.7.1 / 2015-03-11
+==================
+
+ * Revert #347 (fix collisions when option and first arg have same name) which causes a bug in #367.
+
+2.7.0 / 2015-03-09
+==================
+
+ * Fix git-style bug when installed globally. Close #335 #349 @zhiyelee
+ * Fix collisions when option and first arg have same name. Close #346 #347 @tonylukasavage
+ * Add support for camelCase on `opts()`. Close #353 @nkzawa
+ * Add node.js 0.12 and io.js to travis.yml
+ * Allow RegEx options. #337 @palanik
+ * Fixes exit code when sub-command failing. Close #260 #332 @pirelenito
+ * git-style `bin` files in $PATH make sense. Close #196 #327 @zhiyelee
+
+2.6.0 / 2014-12-30
+==================
+
+ * added `Command#allowUnknownOption` method. Close #138 #318 @doozr @zhiyelee
+ * Add application description to the help msg. Close #112 @dalssoft
+
+2.5.1 / 2014-12-15
+==================
+
+ * fixed two bugs incurred by variadic arguments. Close #291 @Quentin01 #302 @zhiyelee
+
+2.5.0 / 2014-10-24
+==================
+
+ * add support for variadic arguments. Closes #277 @whitlockjc
+
+2.4.0 / 2014-10-17
+==================
+
+ * fixed a bug on executing the coercion function of subcommands option. Closes #270
+ * added `Command.prototype.name` to retrieve command name. Closes #264 #266 @tonylukasavage
+ * added `Command.prototype.opts` to retrieve all the options as a simple object of key-value pairs. Closes #262 @tonylukasavage
+ * fixed a bug on subcommand name. Closes #248 @jonathandelgado
+ * fixed function normalize doesn’t honor option terminator. Closes #216 @abbr
+
+2.3.0 / 2014-07-16
+==================
+
+ * add command alias'. Closes PR #210
+ * fix: Typos. Closes #99
+ * fix: Unused fs module. Closes #217
+
+2.2.0 / 2014-03-29
+==================
+
+ * add passing of previous option value
+ * fix: support subcommands on windows. Closes #142
+ * Now the defaultValue passed as the second argument of the coercion function.
+
+2.1.0 / 2013-11-21
+==================
+
+ * add: allow cflag style option params, unit test, fixes #174
+
+2.0.0 / 2013-07-18
+==================
+
+ * remove input methods (.prompt, .confirm, etc)
+
+1.3.2 / 2013-07-18
+==================
+
+ * add support for sub-commands to co-exist with the original command
+
+1.3.1 / 2013-07-18
+==================
+
+ * add quick .runningCommand hack so you can opt-out of other logic when running a sub command
+
+1.3.0 / 2013-07-09
+==================
+
+ * add EACCES error handling
+ * fix sub-command --help
+
+1.2.0 / 2013-06-13
+==================
+
+ * allow "-" hyphen as an option argument
+ * support for RegExp coercion
+
+1.1.1 / 2012-11-20
+==================
+
+ * add more sub-command padding
+ * fix .usage() when args are present. Closes #106
+
+1.1.0 / 2012-11-16
+==================
+
+ * add git-style executable subcommand support. Closes #94
+
+1.0.5 / 2012-10-09
+==================
+
+ * fix `--name` clobbering. Closes #92
+ * fix examples/help. Closes #89
+
+1.0.4 / 2012-09-03
+==================
+
+ * add `outputHelp()` method.
+
+1.0.3 / 2012-08-30
+==================
+
+ * remove invalid .version() defaulting
+
+1.0.2 / 2012-08-24
+==================
+
+ * add `--foo=bar` support [arv]
+ * fix password on node 0.8.8. Make backward compatible with 0.6 [focusaurus]
+
+1.0.1 / 2012-08-03
+==================
+
+ * fix issue #56
+ * fix tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode())
+
+1.0.0 / 2012-07-05
+==================
+
+ * add support for optional option descriptions
+ * add defaulting of `.version()` to package.json's version
+
+0.6.1 / 2012-06-01
+==================
+
+ * Added: append (yes or no) on confirmation
+ * Added: allow node.js v0.7.x
+
+0.6.0 / 2012-04-10
+==================
+
+ * Added `.prompt(obj, callback)` support. Closes #49
+ * Added default support to .choose(). Closes #41
+ * Fixed the choice example
+
+0.5.1 / 2011-12-20
+==================
+
+ * Fixed `password()` for recent nodes. Closes #36
+
+0.5.0 / 2011-12-04
+==================
+
+ * Added sub-command option support [itay]
+
+0.4.3 / 2011-12-04
+==================
+
+ * Fixed custom help ordering. Closes #32
+
+0.4.2 / 2011-11-24
+==================
+
+ * Added travis support
+ * Fixed: line-buffered input automatically trimmed. Closes #31
+
+0.4.1 / 2011-11-18
+==================
+
+ * Removed listening for "close" on --help
+
+0.4.0 / 2011-11-15
+==================
+
+ * Added support for `--`. Closes #24
+
+0.3.3 / 2011-11-14
+==================
+
+ * Fixed: wait for close event when writing help info [Jerry Hamlet]
+
+0.3.2 / 2011-11-01
+==================
+
+ * Fixed long flag definitions with values [felixge]
+
+0.3.1 / 2011-10-31
+==================
+
+ * Changed `--version` short flag to `-V` from `-v`
+ * Changed `.version()` so it's configurable [felixge]
+
+0.3.0 / 2011-10-31
+==================
+
+ * Added support for long flags only. Closes #18
+
+0.2.1 / 2011-10-24
+==================
+
+ * "node": ">= 0.4.x < 0.7.0". Closes #20
+
+0.2.0 / 2011-09-26
+==================
+
+ * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs]
+
+0.1.0 / 2011-08-24
+==================
+
+ * Added support for custom `--help` output
+
+0.0.5 / 2011-08-18
+==================
+
+ * Changed: when the user enters nothing prompt for password again
+ * Fixed issue with passwords beginning with numbers [NuckChorris]
+
+0.0.4 / 2011-08-15
+==================
+
+ * Fixed `Commander#args`
+
+0.0.3 / 2011-08-15
+==================
+
+ * Added default option value support
+
+0.0.2 / 2011-08-15
+==================
+
+ * Added mask support to `Command#password(str[, mask], fn)`
+ * Added `Command#password(str, fn)`
+
+0.0.1 / 2010-01-03
+==================
+
+ * Initial release
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/LICENSE b/node_modules/request/node_modules/har-validator/node_modules/commander/LICENSE
new file mode 100644
index 000000000..10f997ab1
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/commander/LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md b/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md
new file mode 100644
index 000000000..08b9e4cb9
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md
@@ -0,0 +1,351 @@
+# Commander.js
+
+
+[![Build Status](https://api.travis-ci.org/tj/commander.js.svg)](http://travis-ci.org/tj/commander.js)
+[![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander)
+[![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://www.npmjs.org/package/commander)
+[![Join the chat at https://gitter.im/tj/commander.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+ The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/tj/commander).
+ [API documentation](http://tj.github.com/commander.js/)
+
+
+## Installation
+
+ $ npm install commander
+
+## Option parsing
+
+ Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+ .version('0.0.1')
+ .option('-p, --peppers', 'Add peppers')
+ .option('-P, --pineapple', 'Add pineapple')
+ .option('-b, --bbq-sauce', 'Add bbq sauce')
+ .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')
+ .parse(process.argv);
+
+console.log('you ordered a pizza with:');
+if (program.peppers) console.log(' - peppers');
+if (program.pineapple) console.log(' - pineapple');
+if (program.bbqSauce) console.log(' - bbq');
+console.log(' - %s cheese', program.cheese);
+```
+
+ Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc.
+
+
+## Coercion
+
+```js
+function range(val) {
+ return val.split('..').map(Number);
+}
+
+function list(val) {
+ return val.split(',');
+}
+
+function collect(val, memo) {
+ memo.push(val);
+ return memo;
+}
+
+function increaseVerbosity(v, total) {
+ return total + 1;
+}
+
+program
+ .version('0.0.1')
+ .usage('[options] <file ...>')
+ .option('-i, --integer <n>', 'An integer argument', parseInt)
+ .option('-f, --float <n>', 'A float argument', parseFloat)
+ .option('-r, --range <a>..<b>', 'A range', range)
+ .option('-l, --list <items>', 'A list', list)
+ .option('-o, --optional [value]', 'An optional value')
+ .option('-c, --collect [value]', 'A repeatable value', collect, [])
+ .option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0)
+ .parse(process.argv);
+
+console.log(' int: %j', program.integer);
+console.log(' float: %j', program.float);
+console.log(' optional: %j', program.optional);
+program.range = program.range || [];
+console.log(' range: %j..%j', program.range[0], program.range[1]);
+console.log(' list: %j', program.list);
+console.log(' collect: %j', program.collect);
+console.log(' verbosity: %j', program.verbose);
+console.log(' args: %j', program.args);
+```
+
+## Regular Expression
+```js
+program
+ .version('0.0.1')
+ .option('-s --size <size>', 'Pizza size', /^(large|medium|small)$/i, 'medium')
+ .option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i)
+ .parse(process.argv);
+
+console.log(' size: %j', program.size);
+console.log(' drink: %j', program.drink);
+```
+
+## Variadic arguments
+
+ The last argument of a command can be variadic, and only the last argument. To make an argument variadic you have to
+ append `...` to the argument name. Here is an example:
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+ .version('0.0.1')
+ .command('rmdir <dir> [otherDirs...]')
+ .action(function (dir, otherDirs) {
+ console.log('rmdir %s', dir);
+ if (otherDirs) {
+ otherDirs.forEach(function (oDir) {
+ console.log('rmdir %s', oDir);
+ });
+ }
+ });
+
+program.parse(process.argv);
+```
+
+ An `Array` is used for the value of a variadic argument. This applies to `program.args` as well as the argument passed
+ to your action as demonstrated above.
+
+## Specify the argument syntax
+
+```js
+#!/usr/bin/env node
+
+var program = require('../');
+
+program
+ .version('0.0.1')
+ .arguments('<cmd> [env]')
+ .action(function (cmd, env) {
+ cmdValue = cmd;
+ envValue = env;
+ });
+
+program.parse(process.argv);
+
+if (typeof cmdValue === 'undefined') {
+ console.error('no command given!');
+ process.exit(1);
+}
+console.log('command:', cmdValue);
+console.log('environment:', envValue || "no environment given");
+```
+
+## Git-style sub-commands
+
+```js
+// file: ./examples/pm
+var program = require('..');
+
+program
+ .version('0.0.1')
+ .command('install [name]', 'install one or more packages')
+ .command('search [query]', 'search with optional query')
+ .command('list', 'list packages installed', {isDefault: true})
+ .parse(process.argv);
+```
+
+When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools.
+The commander will try to search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-command`, like `pm-install`, `pm-search`.
+
+Options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the option from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified.
+
+If the program is designed to be installed globally, make sure the executables have proper modes, like `755`.
+
+### `--harmony`
+
+You can enable `--harmony` option in two ways:
+* Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. Note some os version don’t support this pattern.
+* Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process.
+
+## Automated --help
+
+ The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
+
+```
+ $ ./examples/pizza --help
+
+ Usage: pizza [options]
+
+ An application for pizzas ordering
+
+ Options:
+
+ -h, --help output usage information
+ -V, --version output the version number
+ -p, --peppers Add peppers
+ -P, --pineapple Add pineapple
+ -b, --bbq Add bbq sauce
+ -c, --cheese <type> Add the specified type of cheese [marble]
+ -C, --no-cheese You do not want any cheese
+
+```
+
+## Custom help
+
+ You can display arbitrary `-h, --help` information
+ by listening for "--help". Commander will automatically
+ exit once you are done so that the remainder of your program
+ does not execute causing undesired behaviours, for example
+ in the following executable "stuff" will not output when
+ `--help` is used.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+ .version('0.0.1')
+ .option('-f, --foo', 'enable some foo')
+ .option('-b, --bar', 'enable some bar')
+ .option('-B, --baz', 'enable some baz');
+
+// must be before .parse() since
+// node's emit() is immediate
+
+program.on('--help', function(){
+ console.log(' Examples:');
+ console.log('');
+ console.log(' $ custom-help --help');
+ console.log(' $ custom-help -h');
+ console.log('');
+});
+
+program.parse(process.argv);
+
+console.log('stuff');
+```
+
+Yields the following help output when `node script-name.js -h` or `node script-name.js --help` are run:
+
+```
+
+Usage: custom-help [options]
+
+Options:
+
+ -h, --help output usage information
+ -V, --version output the version number
+ -f, --foo enable some foo
+ -b, --bar enable some bar
+ -B, --baz enable some baz
+
+Examples:
+
+ $ custom-help --help
+ $ custom-help -h
+
+```
+
+## .outputHelp(cb)
+
+Output help information without exiting.
+Optional callback cb allows post-processing of help text before it is displayed.
+
+If you want to display help by default (e.g. if no command was provided), you can use something like:
+
+```js
+var program = require('commander');
+var colors = require('colors');
+
+program
+ .version('0.0.1')
+ .command('getstream [url]', 'get stream URL')
+ .parse(process.argv);
+
+ if (!process.argv.slice(2).length) {
+ program.outputHelp(make_red);
+ }
+
+function make_red(txt) {
+ return colors.red(txt); //display the help text in red on the console
+}
+```
+
+## .help(cb)
+
+ Output help information and exit immediately.
+ Optional callback cb allows post-processing of help text before it is displayed.
+
+## Examples
+
+```js
+var program = require('commander');
+
+program
+ .version('0.0.1')
+ .option('-C, --chdir <path>', 'change the working directory')
+ .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
+ .option('-T, --no-tests', 'ignore test hook')
+
+program
+ .command('setup [env]')
+ .description('run setup commands for all envs')
+ .option("-s, --setup_mode [mode]", "Which setup mode to use")
+ .action(function(env, options){
+ var mode = options.setup_mode || "normal";
+ env = env || 'all';
+ console.log('setup for %s env(s) with %s mode', env, mode);
+ });
+
+program
+ .command('exec <cmd>')
+ .alias('ex')
+ .description('execute the given remote cmd')
+ .option("-e, --exec_mode <mode>", "Which exec mode to use")
+ .action(function(cmd, options){
+ console.log('exec "%s" using %s mode', cmd, options.exec_mode);
+ }).on('--help', function() {
+ console.log(' Examples:');
+ console.log();
+ console.log(' $ deploy exec sequential');
+ console.log(' $ deploy exec async');
+ console.log();
+ });
+
+program
+ .command('*')
+ .action(function(env){
+ console.log('deploying "%s"', env);
+ });
+
+program.parse(process.argv);
+```
+
+More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory.
+
+## License
+
+MIT
+
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/index.js b/node_modules/request/node_modules/har-validator/node_modules/commander/index.js
new file mode 100644
index 000000000..a19c05d2e
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/commander/index.js
@@ -0,0 +1,1110 @@
+/**
+ * Module dependencies.
+ */
+
+var EventEmitter = require('events').EventEmitter;
+var spawn = require('child_process').spawn;
+var readlink = require('graceful-readlink').readlinkSync;
+var path = require('path');
+var dirname = path.dirname;
+var basename = path.basename;
+var fs = require('fs');
+
+/**
+ * Expose the root command.
+ */
+
+exports = module.exports = new Command();
+
+/**
+ * Expose `Command`.
+ */
+
+exports.Command = Command;
+
+/**
+ * Expose `Option`.
+ */
+
+exports.Option = Option;
+
+/**
+ * Initialize a new `Option` with the given `flags` and `description`.
+ *
+ * @param {String} flags
+ * @param {String} description
+ * @api public
+ */
+
+function Option(flags, description) {
+ this.flags = flags;
+ this.required = ~flags.indexOf('<');
+ this.optional = ~flags.indexOf('[');
+ this.bool = !~flags.indexOf('-no-');
+ flags = flags.split(/[ ,|]+/);
+ if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
+ this.long = flags.shift();
+ this.description = description || '';
+}
+
+/**
+ * Return option name.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Option.prototype.name = function() {
+ return this.long
+ .replace('--', '')
+ .replace('no-', '');
+};
+
+/**
+ * Check if `arg` matches the short or long flag.
+ *
+ * @param {String} arg
+ * @return {Boolean}
+ * @api private
+ */
+
+Option.prototype.is = function(arg) {
+ return arg == this.short || arg == this.long;
+};
+
+/**
+ * Initialize a new `Command`.
+ *
+ * @param {String} name
+ * @api public
+ */
+
+function Command(name) {
+ this.commands = [];
+ this.options = [];
+ this._execs = {};
+ this._allowUnknownOption = false;
+ this._args = [];
+ this._name = name || '';
+}
+
+/**
+ * Inherit from `EventEmitter.prototype`.
+ */
+
+Command.prototype.__proto__ = EventEmitter.prototype;
+
+/**
+ * Add command `name`.
+ *
+ * The `.action()` callback is invoked when the
+ * command `name` is specified via __ARGV__,
+ * and the remaining arguments are applied to the
+ * function for access.
+ *
+ * When the `name` is "*" an un-matched command
+ * will be passed as the first arg, followed by
+ * the rest of __ARGV__ remaining.
+ *
+ * Examples:
+ *
+ * program
+ * .version('0.0.1')
+ * .option('-C, --chdir <path>', 'change the working directory')
+ * .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
+ * .option('-T, --no-tests', 'ignore test hook')
+ *
+ * program
+ * .command('setup')
+ * .description('run remote setup commands')
+ * .action(function() {
+ * console.log('setup');
+ * });
+ *
+ * program
+ * .command('exec <cmd>')
+ * .description('run the given remote command')
+ * .action(function(cmd) {
+ * console.log('exec "%s"', cmd);
+ * });
+ *
+ * program
+ * .command('teardown <dir> [otherDirs...]')
+ * .description('run teardown commands')
+ * .action(function(dir, otherDirs) {
+ * console.log('dir "%s"', dir);
+ * if (otherDirs) {
+ * otherDirs.forEach(function (oDir) {
+ * console.log('dir "%s"', oDir);
+ * });
+ * }
+ * });
+ *
+ * program
+ * .command('*')
+ * .description('deploy the given env')
+ * .action(function(env) {
+ * console.log('deploying "%s"', env);
+ * });
+ *
+ * program.parse(process.argv);
+ *
+ * @param {String} name
+ * @param {String} [desc] for git-style sub-commands
+ * @return {Command} the new command
+ * @api public
+ */
+
+Command.prototype.command = function(name, desc, opts) {
+ opts = opts || {};
+ var args = name.split(/ +/);
+ var cmd = new Command(args.shift());
+
+ if (desc) {
+ cmd.description(desc);
+ this.executables = true;
+ this._execs[cmd._name] = true;
+ if (opts.isDefault) this.defaultExecutable = cmd._name;
+ }
+
+ cmd._noHelp = !!opts.noHelp;
+ this.commands.push(cmd);
+ cmd.parseExpectedArgs(args);
+ cmd.parent = this;
+
+ if (desc) return this;
+ return cmd;
+};
+
+/**
+ * Define argument syntax for the top-level command.
+ *
+ * @api public
+ */
+
+Command.prototype.arguments = function (desc) {
+ return this.parseExpectedArgs(desc.split(/ +/));
+};
+
+/**
+ * Add an implicit `help [cmd]` subcommand
+ * which invokes `--help` for the given command.
+ *
+ * @api private
+ */
+
+Command.prototype.addImplicitHelpCommand = function() {
+ this.command('help [cmd]', 'display help for [cmd]');
+};
+
+/**
+ * Parse expected `args`.
+ *
+ * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
+ *
+ * @param {Array} args
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.parseExpectedArgs = function(args) {
+ if (!args.length) return;
+ var self = this;
+ args.forEach(function(arg) {
+ var argDetails = {
+ required: false,
+ name: '',
+ variadic: false
+ };
+
+ switch (arg[0]) {
+ case '<':
+ argDetails.required = true;
+ argDetails.name = arg.slice(1, -1);
+ break;
+ case '[':
+ argDetails.name = arg.slice(1, -1);
+ break;
+ }
+
+ if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') {
+ argDetails.variadic = true;
+ argDetails.name = argDetails.name.slice(0, -3);
+ }
+ if (argDetails.name) {
+ self._args.push(argDetails);
+ }
+ });
+ return this;
+};
+
+/**
+ * Register callback `fn` for the command.
+ *
+ * Examples:
+ *
+ * program
+ * .command('help')
+ * .description('display verbose help')
+ * .action(function() {
+ * // output help here
+ * });
+ *
+ * @param {Function} fn
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.action = function(fn) {
+ var self = this;
+ var listener = function(args, unknown) {
+ // Parse any so-far unknown options
+ args = args || [];
+ unknown = unknown || [];
+
+ var parsed = self.parseOptions(unknown);
+
+ // Output help if necessary
+ outputHelpIfNecessary(self, parsed.unknown);
+
+ // If there are still any unknown options, then we simply
+ // die, unless someone asked for help, in which case we give it
+ // to them, and then we die.
+ if (parsed.unknown.length > 0) {
+ self.unknownOption(parsed.unknown[0]);
+ }
+
+ // Leftover arguments need to be pushed back. Fixes issue #56
+ if (parsed.args.length) args = parsed.args.concat(args);
+
+ self._args.forEach(function(arg, i) {
+ if (arg.required && null == args[i]) {
+ self.missingArgument(arg.name);
+ } else if (arg.variadic) {
+ if (i !== self._args.length - 1) {
+ self.variadicArgNotLast(arg.name);
+ }
+
+ args[i] = args.splice(i);
+ }
+ });
+
+ // Always append ourselves to the end of the arguments,
+ // to make sure we match the number of arguments the user
+ // expects
+ if (self._args.length) {
+ args[self._args.length] = self;
+ } else {
+ args.push(self);
+ }
+
+ fn.apply(self, args);
+ };
+ var parent = this.parent || this;
+ var name = parent === this ? '*' : this._name;
+ parent.on(name, listener);
+ if (this._alias) parent.on(this._alias, listener);
+ return this;
+};
+
+/**
+ * Define option with `flags`, `description` and optional
+ * coercion `fn`.
+ *
+ * The `flags` string should contain both the short and long flags,
+ * separated by comma, a pipe or space. The following are all valid
+ * all will output this way when `--help` is used.
+ *
+ * "-p, --pepper"
+ * "-p|--pepper"
+ * "-p --pepper"
+ *
+ * Examples:
+ *
+ * // simple boolean defaulting to false
+ * program.option('-p, --pepper', 'add pepper');
+ *
+ * --pepper
+ * program.pepper
+ * // => Boolean
+ *
+ * // simple boolean defaulting to true
+ * program.option('-C, --no-cheese', 'remove cheese');
+ *
+ * program.cheese
+ * // => true
+ *
+ * --no-cheese
+ * program.cheese
+ * // => false
+ *
+ * // required argument
+ * program.option('-C, --chdir <path>', 'change the working directory');
+ *
+ * --chdir /tmp
+ * program.chdir
+ * // => "/tmp"
+ *
+ * // optional argument
+ * program.option('-c, --cheese [type]', 'add cheese [marble]');
+ *
+ * @param {String} flags
+ * @param {String} description
+ * @param {Function|Mixed} fn or default
+ * @param {Mixed} defaultValue
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.option = function(flags, description, fn, defaultValue) {
+ var self = this
+ , option = new Option(flags, description)
+ , oname = option.name()
+ , name = camelcase(oname);
+
+ // default as 3rd arg
+ if (typeof fn != 'function') {
+ if (fn instanceof RegExp) {
+ var regex = fn;
+ fn = function(val, def) {
+ var m = regex.exec(val);
+ return m ? m[0] : def;
+ }
+ }
+ else {
+ defaultValue = fn;
+ fn = null;
+ }
+ }
+
+ // preassign default value only for --no-*, [optional], or <required>
+ if (false == option.bool || option.optional || option.required) {
+ // when --no-* we make sure default is true
+ if (false == option.bool) defaultValue = true;
+ // preassign only if we have a default
+ if (undefined !== defaultValue) self[name] = defaultValue;
+ }
+
+ // register the option
+ this.options.push(option);
+
+ // when it's passed assign the value
+ // and conditionally invoke the callback
+ this.on(oname, function(val) {
+ // coercion
+ if (null !== val && fn) val = fn(val, undefined === self[name]
+ ? defaultValue
+ : self[name]);
+
+ // unassigned or bool
+ if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) {
+ // if no value, bool true, and we have a default, then use it!
+ if (null == val) {
+ self[name] = option.bool
+ ? defaultValue || true
+ : false;
+ } else {
+ self[name] = val;
+ }
+ } else if (null !== val) {
+ // reassign
+ self[name] = val;
+ }
+ });
+
+ return this;
+};
+
+/**
+ * Allow unknown options on the command line.
+ *
+ * @param {Boolean} arg if `true` or omitted, no error will be thrown
+ * for unknown options.
+ * @api public
+ */
+Command.prototype.allowUnknownOption = function(arg) {
+ this._allowUnknownOption = arguments.length === 0 || arg;
+ return this;
+};
+
+/**
+ * Parse `argv`, settings options and invoking commands when defined.
+ *
+ * @param {Array} argv
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.parse = function(argv) {
+ // implicit help
+ if (this.executables) this.addImplicitHelpCommand();
+
+ // store raw args
+ this.rawArgs = argv;
+
+ // guess name
+ this._name = this._name || basename(argv[1], '.js');
+
+ // github-style sub-commands with no sub-command
+ if (this.executables && argv.length < 3 && !this.defaultExecutable) {
+ // this user needs help
+ argv.push('--help');
+ }
+
+ // process argv
+ var parsed = this.parseOptions(this.normalize(argv.slice(2)));
+ var args = this.args = parsed.args;
+
+ var result = this.parseArgs(this.args, parsed.unknown);
+
+ // executable sub-commands
+ var name = result.args[0];
+ if (this._execs[name] && typeof this._execs[name] != "function") {
+ return this.executeSubCommand(argv, args, parsed.unknown);
+ } else if (this.defaultExecutable) {
+ // use the default subcommand
+ args.unshift(name = this.defaultExecutable);
+ return this.executeSubCommand(argv, args, parsed.unknown);
+ }
+
+ return result;
+};
+
+/**
+ * Execute a sub-command executable.
+ *
+ * @param {Array} argv
+ * @param {Array} args
+ * @param {Array} unknown
+ * @api private
+ */
+
+Command.prototype.executeSubCommand = function(argv, args, unknown) {
+ args = args.concat(unknown);
+
+ if (!args.length) this.help();
+ if ('help' == args[0] && 1 == args.length) this.help();
+
+ // <cmd> --help
+ if ('help' == args[0]) {
+ args[0] = args[1];
+ args[1] = '--help';
+ }
+
+ // executable
+ var f = argv[1];
+ // name of the subcommand, link `pm-install`
+ var bin = basename(f, '.js') + '-' + args[0];
+
+
+ // In case of globally installed, get the base dir where executable
+ // subcommand file should be located at
+ var baseDir
+ , link = readlink(f);
+
+ // when symbolink is relative path
+ if (link !== f && link.charAt(0) !== '/') {
+ link = path.join(dirname(f), link)
+ }
+ baseDir = dirname(link);
+
+ // prefer local `./<bin>` to bin in the $PATH
+ var localBin = path.join(baseDir, bin);
+
+ // whether bin file is a js script with explicit `.js` extension
+ var isExplicitJS = false;
+ if (exists(localBin + '.js')) {
+ bin = localBin + '.js';
+ isExplicitJS = true;
+ } else if (exists(localBin)) {
+ bin = localBin;
+ }
+
+ args = args.slice(1);
+
+ var proc;
+ if (process.platform !== 'win32') {
+ if (isExplicitJS) {
+ args.unshift(localBin);
+ // add executable arguments to spawn
+ args = (process.execArgv || []).concat(args);
+
+ proc = spawn('node', args, { stdio: 'inherit', customFds: [0, 1, 2] });
+ } else {
+ proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] });
+ }
+ } else {
+ args.unshift(localBin);
+ proc = spawn(process.execPath, args, { stdio: 'inherit'});
+ }
+
+ proc.on('close', process.exit.bind(process));
+ proc.on('error', function(err) {
+ if (err.code == "ENOENT") {
+ console.error('\n %s(1) does not exist, try --help\n', bin);
+ } else if (err.code == "EACCES") {
+ console.error('\n %s(1) not executable. try chmod or run with root\n', bin);
+ }
+ process.exit(1);
+ });
+
+ // Store the reference to the child process
+ this.runningCommand = proc;
+};
+
+/**
+ * Normalize `args`, splitting joined short flags. For example
+ * the arg "-abc" is equivalent to "-a -b -c".
+ * This also normalizes equal sign and splits "--abc=def" into "--abc def".
+ *
+ * @param {Array} args
+ * @return {Array}
+ * @api private
+ */
+
+Command.prototype.normalize = function(args) {
+ var ret = []
+ , arg
+ , lastOpt
+ , index;
+
+ for (var i = 0, len = args.length; i < len; ++i) {
+ arg = args[i];
+ if (i > 0) {
+ lastOpt = this.optionFor(args[i-1]);
+ }
+
+ if (arg === '--') {
+ // Honor option terminator
+ ret = ret.concat(args.slice(i));
+ break;
+ } else if (lastOpt && lastOpt.required) {
+ ret.push(arg);
+ } else if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) {
+ arg.slice(1).split('').forEach(function(c) {
+ ret.push('-' + c);
+ });
+ } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) {
+ ret.push(arg.slice(0, index), arg.slice(index + 1));
+ } else {
+ ret.push(arg);
+ }
+ }
+
+ return ret;
+};
+
+/**
+ * Parse command `args`.
+ *
+ * When listener(s) are available those
+ * callbacks are invoked, otherwise the "*"
+ * event is emitted and those actions are invoked.
+ *
+ * @param {Array} args
+ * @return {Command} for chaining
+ * @api private
+ */
+
+Command.prototype.parseArgs = function(args, unknown) {
+ var name;
+
+ if (args.length) {
+ name = args[0];
+ if (this.listeners(name).length) {
+ this.emit(args.shift(), args, unknown);
+ } else {
+ this.emit('*', args);
+ }
+ } else {
+ outputHelpIfNecessary(this, unknown);
+
+ // If there were no args and we have unknown options,
+ // then they are extraneous and we need to error.
+ if (unknown.length > 0) {
+ this.unknownOption(unknown[0]);
+ }
+ }
+
+ return this;
+};
+
+/**
+ * Return an option matching `arg` if any.
+ *
+ * @param {String} arg
+ * @return {Option}
+ * @api private
+ */
+
+Command.prototype.optionFor = function(arg) {
+ for (var i = 0, len = this.options.length; i < len; ++i) {
+ if (this.options[i].is(arg)) {
+ return this.options[i];
+ }
+ }
+};
+
+/**
+ * Parse options from `argv` returning `argv`
+ * void of these options.
+ *
+ * @param {Array} argv
+ * @return {Array}
+ * @api public
+ */
+
+Command.prototype.parseOptions = function(argv) {
+ var args = []
+ , len = argv.length
+ , literal
+ , option
+ , arg;
+
+ var unknownOptions = [];
+
+ // parse options
+ for (var i = 0; i < len; ++i) {
+ arg = argv[i];
+
+ // literal args after --
+ if ('--' == arg) {
+ literal = true;
+ continue;
+ }
+
+ if (literal) {
+ args.push(arg);
+ continue;
+ }
+
+ // find matching Option
+ option = this.optionFor(arg);
+
+ // option is defined
+ if (option) {
+ // requires arg
+ if (option.required) {
+ arg = argv[++i];
+ if (null == arg) return this.optionMissingArgument(option);
+ this.emit(option.name(), arg);
+ // optional arg
+ } else if (option.optional) {
+ arg = argv[i+1];
+ if (null == arg || ('-' == arg[0] && '-' != arg)) {
+ arg = null;
+ } else {
+ ++i;
+ }
+ this.emit(option.name(), arg);
+ // bool
+ } else {
+ this.emit(option.name());
+ }
+ continue;
+ }
+
+ // looks like an option
+ if (arg.length > 1 && '-' == arg[0]) {
+ unknownOptions.push(arg);
+
+ // If the next argument looks like it might be
+ // an argument for this option, we pass it on.
+ // If it isn't, then it'll simply be ignored
+ if (argv[i+1] && '-' != argv[i+1][0]) {
+ unknownOptions.push(argv[++i]);
+ }
+ continue;
+ }
+
+ // arg
+ args.push(arg);
+ }
+
+ return { args: args, unknown: unknownOptions };
+};
+
+/**
+ * Return an object containing options as key-value pairs
+ *
+ * @return {Object}
+ * @api public
+ */
+Command.prototype.opts = function() {
+ var result = {}
+ , len = this.options.length;
+
+ for (var i = 0 ; i < len; i++) {
+ var key = camelcase(this.options[i].name());
+ result[key] = key === 'version' ? this._version : this[key];
+ }
+ return result;
+};
+
+/**
+ * Argument `name` is missing.
+ *
+ * @param {String} name
+ * @api private
+ */
+
+Command.prototype.missingArgument = function(name) {
+ console.error();
+ console.error(" error: missing required argument `%s'", name);
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * `Option` is missing an argument, but received `flag` or nothing.
+ *
+ * @param {String} option
+ * @param {String} flag
+ * @api private
+ */
+
+Command.prototype.optionMissingArgument = function(option, flag) {
+ console.error();
+ if (flag) {
+ console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag);
+ } else {
+ console.error(" error: option `%s' argument missing", option.flags);
+ }
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * Unknown option `flag`.
+ *
+ * @param {String} flag
+ * @api private
+ */
+
+Command.prototype.unknownOption = function(flag) {
+ if (this._allowUnknownOption) return;
+ console.error();
+ console.error(" error: unknown option `%s'", flag);
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * Variadic argument with `name` is not the last argument as required.
+ *
+ * @param {String} name
+ * @api private
+ */
+
+Command.prototype.variadicArgNotLast = function(name) {
+ console.error();
+ console.error(" error: variadic arguments must be last `%s'", name);
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * Set the program version to `str`.
+ *
+ * This method auto-registers the "-V, --version" flag
+ * which will print the version number when passed.
+ *
+ * @param {String} str
+ * @param {String} flags
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.version = function(str, flags) {
+ if (0 == arguments.length) return this._version;
+ this._version = str;
+ flags = flags || '-V, --version';
+ this.option(flags, 'output the version number');
+ this.on('version', function() {
+ process.stdout.write(str + '\n');
+ process.exit(0);
+ });
+ return this;
+};
+
+/**
+ * Set the description to `str`.
+ *
+ * @param {String} str
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.description = function(str) {
+ if (0 === arguments.length) return this._description;
+ this._description = str;
+ return this;
+};
+
+/**
+ * Set an alias for the command
+ *
+ * @param {String} alias
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.alias = function(alias) {
+ if (0 == arguments.length) return this._alias;
+ this._alias = alias;
+ return this;
+};
+
+/**
+ * Set / get the command usage `str`.
+ *
+ * @param {String} str
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.usage = function(str) {
+ var args = this._args.map(function(arg) {
+ return humanReadableArgName(arg);
+ });
+
+ var usage = '[options]'
+ + (this.commands.length ? ' [command]' : '')
+ + (this._args.length ? ' ' + args.join(' ') : '');
+
+ if (0 == arguments.length) return this._usage || usage;
+ this._usage = str;
+
+ return this;
+};
+
+/**
+ * Get the name of the command
+ *
+ * @param {String} name
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.name = function() {
+ return this._name;
+};
+
+/**
+ * Return the largest option length.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+Command.prototype.largestOptionLength = function() {
+ return this.options.reduce(function(max, option) {
+ return Math.max(max, option.flags.length);
+ }, 0);
+};
+
+/**
+ * Return help for options.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.optionHelp = function() {
+ var width = this.largestOptionLength();
+
+ // Prepend the help information
+ return [pad('-h, --help', width) + ' ' + 'output usage information']
+ .concat(this.options.map(function(option) {
+ return pad(option.flags, width) + ' ' + option.description;
+ }))
+ .join('\n');
+};
+
+/**
+ * Return command help documentation.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.commandHelp = function() {
+ if (!this.commands.length) return '';
+
+ var commands = this.commands.filter(function(cmd) {
+ return !cmd._noHelp;
+ }).map(function(cmd) {
+ var args = cmd._args.map(function(arg) {
+ return humanReadableArgName(arg);
+ }).join(' ');
+
+ return [
+ cmd._name
+ + (cmd._alias ? '|' + cmd._alias : '')
+ + (cmd.options.length ? ' [options]' : '')
+ + ' ' + args
+ , cmd.description()
+ ];
+ });
+
+ var width = commands.reduce(function(max, command) {
+ return Math.max(max, command[0].length);
+ }, 0);
+
+ return [
+ ''
+ , ' Commands:'
+ , ''
+ , commands.map(function(cmd) {
+ var desc = cmd[1] ? ' ' + cmd[1] : '';
+ return pad(cmd[0], width) + desc;
+ }).join('\n').replace(/^/gm, ' ')
+ , ''
+ ].join('\n');
+};
+
+/**
+ * Return program help documentation.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.helpInformation = function() {
+ var desc = [];
+ if (this._description) {
+ desc = [
+ ' ' + this._description
+ , ''
+ ];
+ }
+
+ var cmdName = this._name;
+ if (this._alias) {
+ cmdName = cmdName + '|' + this._alias;
+ }
+ var usage = [
+ ''
+ ,' Usage: ' + cmdName + ' ' + this.usage()
+ , ''
+ ];
+
+ var cmds = [];
+ var commandHelp = this.commandHelp();
+ if (commandHelp) cmds = [commandHelp];
+
+ var options = [
+ ' Options:'
+ , ''
+ , '' + this.optionHelp().replace(/^/gm, ' ')
+ , ''
+ , ''
+ ];
+
+ return usage
+ .concat(cmds)
+ .concat(desc)
+ .concat(options)
+ .join('\n');
+};
+
+/**
+ * Output help information for this command
+ *
+ * @api public
+ */
+
+Command.prototype.outputHelp = function(cb) {
+ if (!cb) {
+ cb = function(passthru) {
+ return passthru;
+ }
+ }
+ process.stdout.write(cb(this.helpInformation()));
+ this.emit('--help');
+};
+
+/**
+ * Output help information and exit.
+ *
+ * @api public
+ */
+
+Command.prototype.help = function(cb) {
+ this.outputHelp(cb);
+ process.exit();
+};
+
+/**
+ * Camel-case the given `flag`
+ *
+ * @param {String} flag
+ * @return {String}
+ * @api private
+ */
+
+function camelcase(flag) {
+ return flag.split('-').reduce(function(str, word) {
+ return str + word[0].toUpperCase() + word.slice(1);
+ });
+}
+
+/**
+ * Pad `str` to `width`.
+ *
+ * @param {String} str
+ * @param {Number} width
+ * @return {String}
+ * @api private
+ */
+
+function pad(str, width) {
+ var len = Math.max(0, width - str.length);
+ return str + Array(len + 1).join(' ');
+}
+
+/**
+ * Output help information if necessary
+ *
+ * @param {Command} command to output help for
+ * @param {Array} array of options to search for -h or --help
+ * @api private
+ */
+
+function outputHelpIfNecessary(cmd, options) {
+ options = options || [];
+ for (var i = 0; i < options.length; i++) {
+ if (options[i] == '--help' || options[i] == '-h') {
+ cmd.outputHelp();
+ process.exit(0);
+ }
+ }
+}
+
+/**
+ * Takes an argument an returns its human readable equivalent for help usage.
+ *
+ * @param {Object} arg
+ * @return {String}
+ * @api private
+ */
+
+function humanReadableArgName(arg) {
+ var nameOutput = arg.name + (arg.variadic === true ? '...' : '');
+
+ return arg.required
+ ? '<' + nameOutput + '>'
+ : '[' + nameOutput + ']'
+}
+
+// for versions before node v0.8 when there weren't `fs.existsSync`
+function exists(file) {
+ try {
+ if (fs.statSync(file).isFile()) {
+ return true;
+ }
+ } catch (e) {
+ return false;
+ }
+}
+
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.npmignore b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.npmignore
new file mode 100644
index 000000000..3ac7d16c6
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.npmignore
@@ -0,0 +1,3 @@
+.idea/
+.DS_Store
+node_modules/
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.travis.yml b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.travis.yml
new file mode 100644
index 000000000..baf9be7f6
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+ - "0.10"
+ - "0.12"
+ - "io.js"
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE
new file mode 100644
index 000000000..d1f842f0b
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Zhiye Li
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/README.md b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/README.md
new file mode 100644
index 000000000..fc63b505a
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/README.md
@@ -0,0 +1,17 @@
+# graceful-readlink
+[![NPM Version](http://img.shields.io/npm/v/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink)
+[![NPM Downloads](https://img.shields.io/npm/dm/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink)
+
+
+## Usage
+
+```js
+var readlinkSync = require('graceful-readlink').readlinkSync;
+console.log(readlinkSync(f));
+// output
+// the file pointed to when `f` is a symbolic link
+// the `f` itself when `f` is not a symbolic link
+```
+## Licence
+
+MIT License
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js
new file mode 100644
index 000000000..7e9fc70f0
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js
@@ -0,0 +1,12 @@
+var fs = require('fs')
+ , lstat = fs.lstatSync;
+
+exports.readlinkSync = function (p) {
+ if (lstat(p).isSymbolicLink()) {
+ return fs.readlinkSync(p);
+ } else {
+ return p;
+ }
+};
+
+
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json
new file mode 100644
index 000000000..64d7d644d
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json
@@ -0,0 +1,31 @@
+{
+ "name": "graceful-readlink",
+ "version": "1.0.1",
+ "description": "graceful fs.readlink",
+ "main": "index.js",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/zhiyelee/graceful-readlink.git"
+ },
+ "homepage": "https://github.com/zhiyelee/graceful-readlink",
+ "bugs": {
+ "url": "https://github.com/zhiyelee/graceful-readlink/issues"
+ },
+ "keywords": [
+ "fs.readlink",
+ "readlink"
+ ],
+ "author": {
+ "name": "zhiyelee"
+ },
+ "license": "MIT",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "readme": "# graceful-readlink\n[![NPM Version](http://img.shields.io/npm/v/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink)\n[![NPM Downloads](https://img.shields.io/npm/dm/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink)\n\n\n## Usage\n\n```js\nvar readlinkSync = require('graceful-readlink').readlinkSync;\nconsole.log(readlinkSync(f));\n// output\n// the file pointed to when `f` is a symbolic link\n// the `f` itself when `f` is not a symbolic link\n```\n## Licence\n\nMIT License\n",
+ "readmeFilename": "README.md",
+ "_id": "graceful-readlink@1.0.1",
+ "_shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725",
+ "_resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
+ "_from": "graceful-readlink@>=1.0.0"
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/commander/package.json b/node_modules/request/node_modules/har-validator/node_modules/commander/package.json
new file mode 100644
index 000000000..ccc77e036
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/commander/package.json
@@ -0,0 +1,71 @@
+{
+ "name": "commander",
+ "version": "2.9.0",
+ "description": "the complete solution for node.js command-line programs",
+ "keywords": [
+ "command",
+ "option",
+ "parser"
+ ],
+ "author": {
+ "name": "TJ Holowaychuk",
+ "email": "tj@vision-media.ca"
+ },
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/tj/commander.js.git"
+ },
+ "devDependencies": {
+ "should": ">= 0.0.1",
+ "sinon": ">=1.17.1"
+ },
+ "scripts": {
+ "test": "make test"
+ },
+ "main": "index",
+ "engines": {
+ "node": ">= 0.6.x"
+ },
+ "files": [
+ "index.js"
+ ],
+ "dependencies": {
+ "graceful-readlink": ">= 1.0.0"
+ },
+ "gitHead": "b2aad7a8471d434593a85306aa73777a526e9f75",
+ "bugs": {
+ "url": "https://github.com/tj/commander.js/issues"
+ },
+ "homepage": "https://github.com/tj/commander.js#readme",
+ "_id": "commander@2.9.0",
+ "_shasum": "9c99094176e12240cb22d6c5146098400fe0f7d4",
+ "_from": "commander@>=2.8.1 <3.0.0",
+ "_npmVersion": "2.11.3",
+ "_nodeVersion": "0.12.7",
+ "_npmUser": {
+ "name": "zhiyelee",
+ "email": "zhiyelee@gmail.com"
+ },
+ "dist": {
+ "shasum": "9c99094176e12240cb22d6c5146098400fe0f7d4",
+ "tarball": "http://registry.npmjs.org/commander/-/commander-2.9.0.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "tjholowaychuk",
+ "email": "tj@vision-media.ca"
+ },
+ {
+ "name": "somekittens",
+ "email": "rkoutnik@gmail.com"
+ },
+ {
+ "name": "zhiyelee",
+ "email": "zhiyelee@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.npmignore b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.npmignore
new file mode 100644
index 000000000..dbb0721ce
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.npmignore
@@ -0,0 +1,2 @@
+node_modules
+cosmicrealms.com
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.travis.yml b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.travis.yml
new file mode 100644
index 000000000..6e5919de3
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - "0.10"
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/LICENSE b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/LICENSE
new file mode 100644
index 000000000..757562ec5
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Mathias Buus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE. \ No newline at end of file
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md
new file mode 100644
index 000000000..cbf2b20d3
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md
@@ -0,0 +1,173 @@
+# is-my-json-valid
+
+A [JSONSchema](http://json-schema.org/) validator that uses code generation
+to be extremely fast
+
+```
+npm install is-my-json-valid
+```
+
+It passes the entire JSONSchema v4 test suite except for `remoteRefs` and `maxLength`/`minLength` when using unicode surrogate pairs.
+
+[![build status](http://img.shields.io/travis/mafintosh/is-my-json-valid.svg?style=flat)](http://travis-ci.org/mafintosh/is-my-json-valid)
+
+## Usage
+
+Simply pass a schema to compile it
+
+``` js
+var validator = require('is-my-json-valid')
+
+var validate = validator({
+ required: true,
+ type: 'object',
+ properties: {
+ hello: {
+ required: true,
+ type: 'string'
+ }
+ }
+})
+
+console.log('should be valid', validate({hello: 'world'}))
+console.log('should not be valid', validate({}))
+
+// get the last list of errors by checking validate.errors
+// the following will print [{field: 'data.hello', message: 'is required'}]
+console.log(validate.errors)
+```
+
+You can also pass the schema as a string
+
+``` js
+var validate = validate('{"type": ... }')
+```
+
+Optionally you can use the require submodule to load a schema from `__dirname`
+
+``` js
+var validator = require('is-my-json-valid/require')
+var validate = validator('my-schema.json')
+```
+
+## Custom formats
+
+is-my-json-valid supports the formats specified in JSON schema v4 (such as date-time).
+If you want to add your own custom formats pass them as the formats options to the validator
+
+``` js
+var validate = validator({
+ type: 'string',
+ required: true,
+ format: 'only-a'
+}, {
+ formats: {
+ 'only-a': /^a+$/
+ }
+})
+
+console.log(validate('aa')) // true
+console.log(validate('ab')) // false
+```
+
+## External schemas
+
+You can pass in external schemas that you reference using the `$ref` attribute as the `schemas` option
+
+``` js
+var ext = {
+ required: true,
+ type: 'string'
+}
+
+var schema = {
+ $ref: '#ext' // references another schema called ext
+}
+
+// pass the external schemas as an option
+var validate = validator(schema, {schemas: {ext: ext}})
+
+validate('hello') // returns true
+validate(42) // return false
+```
+
+## Filtering away additional properties
+
+is-my-json-valid supports filtering away properties not in the schema
+
+``` js
+var filter = validator.filter({
+ required: true,
+ type: 'object',
+ properties: {
+ hello: {type: 'string', required: true}
+ },
+ additionalProperties: false
+})
+
+var doc = {hello: 'world', notInSchema: true}
+console.log(filter(doc)) // {hello: 'world'}
+```
+
+## Verbose mode outputs the value on errors
+
+is-my-json-valid outputs the value causing an error when verbose is set to true
+
+``` js
+var validate = validator({
+ required: true,
+ type: 'object',
+ properties: {
+ hello: {
+ required: true,
+ type: 'string'
+ }
+ }
+}, {
+ verbose: true
+})
+
+validate({hello: 100});
+console.log(validate.errors) // {field: 'data.hello', message: 'is the wrong type', value: 100}
+```
+
+## Greedy mode tries to validate as much as possible
+
+By default is-my-json-valid bails on first validation error but when greedy is
+set to true it tries to validate as much as possible:
+
+``` js
+var validate = validator({
+ type: 'object',
+ properties: {
+ x: {
+ type: 'number'
+ }
+ },
+ required: ['x', 'y']
+}, {
+ greedy: true
+});
+
+validate({x: 'string'});
+console.log(validate.errors) // [{field: 'data.y', message: 'is required'},
+ // {field: 'data.x', message: 'is the wrong type'}]
+```
+
+## Performance
+
+is-my-json-valid uses code generation to turn your JSON schema into basic javascript code that is easily optimizeable by v8.
+
+At the time of writing, is-my-json-valid is the __fastest validator__ when running
+
+* [json-schema-benchmark](https://github.com/Muscula/json-schema-benchmark)
+* [cosmicreals.com benchmark](http://cosmicrealms.com/blog/2014/08/29/benchmark-of-node-dot-js-json-validation-modules-part-3/)
+* [jsck benchmark](https://github.com/pandastrike/jsck/issues/72#issuecomment-70992684)
+* [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html)
+* [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html)
+
+If you know any other relevant benchmarks open a PR and I'll add them.
+
+## License
+
+MIT
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
new file mode 100644
index 000000000..f70f4dfb5
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js
@@ -0,0 +1,18 @@
+var validator = require('./')
+
+var validate = validator({
+ type: 'object',
+ properties: {
+ hello: {
+ required: true,
+ type: 'string'
+ }
+ }
+})
+
+console.log('should be valid', validate({hello: 'world'}))
+console.log('should not be valid', validate({}))
+
+// get the last error message by checking validate.error
+// the following will print "data.hello is required"
+console.log('the errors were:', validate.errors)
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/formats.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/formats.js
new file mode 100644
index 000000000..3038daea9
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/formats.js
@@ -0,0 +1,14 @@
+exports['date-time'] = /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}[tT ]\d{2}:\d{2}:\d{2}(\.\d+)?([zZ]|[+-]\d{2}:\d{2})$/
+exports['date'] = /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}$/
+exports['time'] = /^\d{2}:\d{2}:\d{2}$/
+exports['email'] = /^\S+@\S+$/
+exports['ip-address'] = exports['ipv4'] = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
+exports['ipv6'] = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/
+exports['uri'] = /^[a-zA-Z][a-zA-Z0-9+-.]*:[^\s]*$/
+exports['color'] = /(#?([0-9A-Fa-f]{3,6})\b)|(aqua)|(black)|(blue)|(fuchsia)|(gray)|(green)|(lime)|(maroon)|(navy)|(olive)|(orange)|(purple)|(red)|(silver)|(teal)|(white)|(yellow)|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\))/
+exports['hostname'] = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$/
+exports['alpha'] = /^[a-zA-Z]+$/
+exports['alphanumeric'] = /^[a-zA-Z0-9]+$/
+exports['style'] = /\s*(.+?):\s*([^;]+);?/g
+exports['phone'] = /^\+(?:[0-9] ?){6,14}[0-9]$/
+exports['utc-millisec'] = /^[0-9]+(\.?[0-9]+)?$/
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js
new file mode 100644
index 000000000..7820e6497
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js
@@ -0,0 +1,573 @@
+var genobj = require('generate-object-property')
+var genfun = require('generate-function')
+var jsonpointer = require('jsonpointer')
+var xtend = require('xtend')
+var formats = require('./formats')
+
+var get = function(obj, additionalSchemas, ptr) {
+ if (/^https?:\/\//.test(ptr)) return null
+
+ var visit = function(sub) {
+ if (sub && sub.id === ptr) return sub
+ if (typeof sub !== 'object' || !sub) return null
+ return Object.keys(sub).reduce(function(res, k) {
+ return res || visit(sub[k])
+ }, null)
+ }
+
+ var res = visit(obj)
+ if (res) return res
+
+ ptr = ptr.replace(/^#/, '')
+ ptr = ptr.replace(/\/$/, '')
+
+ try {
+ return jsonpointer.get(obj, decodeURI(ptr))
+ } catch (err) {
+ var end = ptr.indexOf('#')
+ var other
+ // external reference
+ if (end !== 0) {
+ // fragment doesn't exist.
+ if (end === -1) {
+ other = additionalSchemas[ptr]
+ } else {
+ var ext = ptr.slice(0, end)
+ other = additionalSchemas[ext]
+ var fragment = ptr.slice(end).replace(/^#/, '')
+ try {
+ return jsonpointer.get(other, fragment)
+ } catch (err) {}
+ }
+ } else {
+ other = additionalSchemas[ptr]
+ }
+ return other || null
+ }
+}
+
+var formatName = function(field) {
+ field = JSON.stringify(field)
+ var pattern = /\[([^\[\]"]+)\]/
+ while (pattern.test(field)) field = field.replace(pattern, '."+$1+"')
+ return field
+}
+
+var types = {}
+
+types.any = function() {
+ return 'true'
+}
+
+types.null = function(name) {
+ return name+' === null'
+}
+
+types.boolean = function(name) {
+ return 'typeof '+name+' === "boolean"'
+}
+
+types.array = function(name) {
+ return 'Array.isArray('+name+')'
+}
+
+types.object = function(name) {
+ return 'typeof '+name+' === "object" && '+name+' && !Array.isArray('+name+')'
+}
+
+types.number = function(name) {
+ return 'typeof '+name+' === "number"'
+}
+
+types.integer = function(name) {
+ return 'typeof '+name+' === "number" && (Math.floor('+name+') === '+name+' || '+name+' > 9007199254740992 || '+name+' < -9007199254740992)'
+}
+
+types.string = function(name) {
+ return 'typeof '+name+' === "string"'
+}
+
+var unique = function(array) {
+ var list = []
+ for (var i = 0; i < array.length; i++) {
+ list.push(typeof array[i] === 'object' ? JSON.stringify(array[i]) : array[i])
+ }
+ for (var i = 1; i < list.length; i++) {
+ if (list.indexOf(list[i]) !== i) return false
+ }
+ return true
+}
+
+var toType = function(node) {
+ return node.type
+}
+
+var compile = function(schema, cache, root, reporter, opts) {
+ var fmts = opts ? xtend(formats, opts.formats) : formats
+ var scope = {unique:unique, formats:fmts}
+ var verbose = opts ? !!opts.verbose : false;
+ var greedy = opts && opts.greedy !== undefined ?
+ opts.greedy : false;
+
+ var syms = {}
+ var gensym = function(name) {
+ return name+(syms[name] = (syms[name] || 0)+1)
+ }
+
+ var reversePatterns = {}
+ var patterns = function(p) {
+ if (reversePatterns[p]) return reversePatterns[p]
+ var n = gensym('pattern')
+ scope[n] = new RegExp(p)
+ reversePatterns[p] = n
+ return n
+ }
+
+ var vars = ['i','j','k','l','m','n','o','p','q','r','s','t','u','v','x','y','z']
+ var genloop = function() {
+ var v = vars.shift()
+ vars.push(v+v[0])
+ return v
+ }
+
+ var visit = function(name, node, reporter, filter) {
+ var properties = node.properties
+ var type = node.type
+ var tuple = false
+
+ if (Array.isArray(node.items)) { // tuple type
+ properties = {}
+ node.items.forEach(function(item, i) {
+ properties[i] = item
+ })
+ type = 'array'
+ tuple = true
+ }
+
+ var indent = 0
+ var error = function(msg, prop, value) {
+ validate('errors++')
+ if (reporter === true) {
+ validate('if (validate.errors === null) validate.errors = []')
+ if (verbose) {
+ validate('validate.errors.push({field:%s,message:%s,value:%s})', formatName(prop || name), JSON.stringify(msg), value || name)
+ } else {
+ validate('validate.errors.push({field:%s,message:%s})', formatName(prop || name), JSON.stringify(msg))
+ }
+ }
+ }
+
+ if (node.required === true) {
+ indent++
+ validate('if (%s === undefined) {', name)
+ error('is required')
+ validate('} else {')
+ } else {
+ indent++
+ validate('if (%s !== undefined) {', name)
+ }
+
+ var valid = [].concat(type)
+ .map(function(t) {
+ return types[t || 'any'](name)
+ })
+ .join(' || ') || 'true'
+
+ if (valid !== 'true') {
+ indent++
+ validate('if (!(%s)) {', valid)
+ error('is the wrong type')
+ validate('} else {')
+ }
+
+ if (tuple) {
+ if (node.additionalItems === false) {
+ validate('if (%s.length > %d) {', name, node.items.length)
+ error('has additional items')
+ validate('}')
+ } else if (node.additionalItems) {
+ var i = genloop()
+ validate('for (var %s = %d; %s < %s.length; %s++) {', i, node.items.length, i, name, i)
+ visit(name+'['+i+']', node.additionalItems, reporter, filter)
+ validate('}')
+ }
+ }
+
+ if (node.format && fmts[node.format]) {
+ if (type !== 'string' && formats[node.format]) validate('if (%s) {', types.string(name))
+ var n = gensym('format')
+ scope[n] = fmts[node.format]
+
+ if (typeof scope[n] === 'function') validate('if (!%s(%s)) {', n, name)
+ else validate('if (!%s.test(%s)) {', n, name)
+ error('must be '+node.format+' format')
+ validate('}')
+ if (type !== 'string' && formats[node.format]) validate('}')
+ }
+
+ if (Array.isArray(node.required)) {
+ var isUndefined = function(req) {
+ return genobj(name, req) + ' === undefined'
+ }
+
+ var checkRequired = function (req) {
+ var prop = genobj(name, req);
+ validate('if (%s === undefined) {', prop)
+ error('is required', prop)
+ validate('missing++')
+ validate('}')
+ }
+ validate('if ((%s)) {', type !== 'object' ? types.object(name) : 'true')
+ validate('var missing = 0')
+ node.required.map(checkRequired)
+ validate('}');
+ if (!greedy) {
+ validate('if (missing === 0) {')
+ indent++
+ }
+ }
+
+ if (node.uniqueItems) {
+ if (type !== 'array') validate('if (%s) {', types.array(name))
+ validate('if (!(unique(%s))) {', name)
+ error('must be unique')
+ validate('}')
+ if (type !== 'array') validate('}')
+ }
+
+ if (node.enum) {
+ var complex = node.enum.some(function(e) {
+ return typeof e === 'object'
+ })
+
+ var compare = complex ?
+ function(e) {
+ return 'JSON.stringify('+name+')'+' !== JSON.stringify('+JSON.stringify(e)+')'
+ } :
+ function(e) {
+ return name+' !== '+JSON.stringify(e)
+ }
+
+ validate('if (%s) {', node.enum.map(compare).join(' && ') || 'false')
+ error('must be an enum value')
+ validate('}')
+ }
+
+ if (node.dependencies) {
+ if (type !== 'object') validate('if (%s) {', types.object(name))
+
+ Object.keys(node.dependencies).forEach(function(key) {
+ var deps = node.dependencies[key]
+ if (typeof deps === 'string') deps = [deps]
+
+ var exists = function(k) {
+ return genobj(name, k) + ' !== undefined'
+ }
+
+ if (Array.isArray(deps)) {
+ validate('if (%s !== undefined && !(%s)) {', genobj(name, key), deps.map(exists).join(' && ') || 'true')
+ error('dependencies not set')
+ validate('}')
+ }
+ if (typeof deps === 'object') {
+ validate('if (%s !== undefined) {', genobj(name, key))
+ visit(name, deps, reporter, filter)
+ validate('}')
+ }
+ })
+
+ if (type !== 'object') validate('}')
+ }
+
+ if (node.additionalProperties || node.additionalProperties === false) {
+ if (type !== 'object') validate('if (%s) {', types.object(name))
+
+ var i = genloop()
+ var keys = gensym('keys')
+
+ var toCompare = function(p) {
+ return keys+'['+i+'] !== '+JSON.stringify(p)
+ }
+
+ var toTest = function(p) {
+ return '!'+patterns(p)+'.test('+keys+'['+i+'])'
+ }
+
+ var additionalProp = Object.keys(properties || {}).map(toCompare)
+ .concat(Object.keys(node.patternProperties || {}).map(toTest))
+ .join(' && ') || 'true'
+
+ validate('var %s = Object.keys(%s)', keys, name)
+ ('for (var %s = 0; %s < %s.length; %s++) {', i, i, keys, i)
+ ('if (%s) {', additionalProp)
+
+ if (node.additionalProperties === false) {
+ if (filter) validate('delete %s', name+'['+keys+'['+i+']]')
+ error('has additional properties', null, JSON.stringify(name+'.') + ' + ' + keys + '['+i+']')
+ } else {
+ visit(name+'['+keys+'['+i+']]', node.additionalProperties, reporter, filter)
+ }
+
+ validate
+ ('}')
+ ('}')
+
+ if (type !== 'object') validate('}')
+ }
+
+ if (node.$ref) {
+ var sub = get(root, opts && opts.schemas || {}, node.$ref)
+ if (sub) {
+ var fn = cache[node.$ref]
+ if (!fn) {
+ cache[node.$ref] = function proxy(data) {
+ return fn(data)
+ }
+ fn = compile(sub, cache, root, false, opts)
+ }
+ var n = gensym('ref')
+ scope[n] = fn
+ validate('if (!(%s(%s))) {', n, name)
+ error('referenced schema does not match')
+ validate('}')
+ }
+ }
+
+ if (node.not) {
+ var prev = gensym('prev')
+ validate('var %s = errors', prev)
+ visit(name, node.not, false, filter)
+ validate('if (%s === errors) {', prev)
+ error('negative schema matches')
+ validate('} else {')
+ ('errors = %s', prev)
+ ('}')
+ }
+
+ if (node.items && !tuple) {
+ if (type !== 'array') validate('if (%s) {', types.array(name))
+
+ var i = genloop()
+ validate('for (var %s = 0; %s < %s.length; %s++) {', i, i, name, i)
+ visit(name+'['+i+']', node.items, reporter, filter)
+ validate('}')
+
+ if (type !== 'array') validate('}')
+ }
+
+ if (node.patternProperties) {
+ if (type !== 'object') validate('if (%s) {', types.object(name))
+ var keys = gensym('keys')
+ var i = genloop()
+ validate
+ ('var %s = Object.keys(%s)', keys, name)
+ ('for (var %s = 0; %s < %s.length; %s++) {', i, i, keys, i)
+
+ Object.keys(node.patternProperties).forEach(function(key) {
+ var p = patterns(key)
+ validate('if (%s.test(%s)) {', p, keys+'['+i+']')
+ visit(name+'['+keys+'['+i+']]', node.patternProperties[key], reporter, filter)
+ validate('}')
+ })
+
+ validate('}')
+ if (type !== 'object') validate('}')
+ }
+
+ if (node.pattern) {
+ var p = patterns(node.pattern)
+ if (type !== 'string') validate('if (%s) {', types.string(name))
+ validate('if (!(%s.test(%s))) {', p, name)
+ error('pattern mismatch')
+ validate('}')
+ if (type !== 'string') validate('}')
+ }
+
+ if (node.allOf) {
+ node.allOf.forEach(function(sch) {
+ visit(name, sch, reporter, filter)
+ })
+ }
+
+ if (node.anyOf && node.anyOf.length) {
+ var prev = gensym('prev')
+
+ node.anyOf.forEach(function(sch, i) {
+ if (i === 0) {
+ validate('var %s = errors', prev)
+ } else {
+ validate('if (errors !== %s) {', prev)
+ ('errors = %s', prev)
+ }
+ visit(name, sch, false, false)
+ })
+ node.anyOf.forEach(function(sch, i) {
+ if (i) validate('}')
+ })
+ validate('if (%s !== errors) {', prev)
+ error('no schemas match')
+ validate('}')
+ }
+
+ if (node.oneOf && node.oneOf.length) {
+ var prev = gensym('prev')
+ var passes = gensym('passes')
+
+ validate
+ ('var %s = errors', prev)
+ ('var %s = 0', passes)
+
+ node.oneOf.forEach(function(sch, i) {
+ visit(name, sch, false, false)
+ validate('if (%s === errors) {', prev)
+ ('%s++', passes)
+ ('} else {')
+ ('errors = %s', prev)
+ ('}')
+ })
+
+ validate('if (%s !== 1) {', passes)
+ error('no (or more than one) schemas match')
+ validate('}')
+ }
+
+ if (node.multipleOf !== undefined) {
+ if (type !== 'number' && type !== 'integer') validate('if (%s) {', types.number(name))
+
+ var factor = ((node.multipleOf | 0) !== node.multipleOf) ? Math.pow(10, node.multipleOf.toString().split('.').pop().length) : 1
+ if (factor > 1) validate('if ((%d*%s) % %d) {', factor, name, factor*node.multipleOf)
+ else validate('if (%s % %d) {', name, node.multipleOf)
+
+ error('has a remainder')
+ validate('}')
+
+ if (type !== 'number' && type !== 'integer') validate('}')
+ }
+
+ if (node.maxProperties !== undefined) {
+ if (type !== 'object') validate('if (%s) {', types.object(name))
+
+ validate('if (Object.keys(%s).length > %d) {', name, node.maxProperties)
+ error('has more properties than allowed')
+ validate('}')
+
+ if (type !== 'object') validate('}')
+ }
+
+ if (node.minProperties !== undefined) {
+ if (type !== 'object') validate('if (%s) {', types.object(name))
+
+ validate('if (Object.keys(%s).length < %d) {', name, node.minProperties)
+ error('has less properties than allowed')
+ validate('}')
+
+ if (type !== 'object') validate('}')
+ }
+
+ if (node.maxItems !== undefined) {
+ if (type !== 'array') validate('if (%s) {', types.array(name))
+
+ validate('if (%s.length > %d) {', name, node.maxItems)
+ error('has more items than allowed')
+ validate('}')
+
+ if (type !== 'array') validate('}')
+ }
+
+ if (node.minItems !== undefined) {
+ if (type !== 'array') validate('if (%s) {', types.array(name))
+
+ validate('if (%s.length < %d) {', name, node.minItems)
+ error('has less items than allowed')
+ validate('}')
+
+ if (type !== 'array') validate('}')
+ }
+
+ if (node.maxLength !== undefined) {
+ if (type !== 'string') validate('if (%s) {', types.string(name))
+
+ validate('if (%s.length > %d) {', name, node.maxLength)
+ error('has longer length than allowed')
+ validate('}')
+
+ if (type !== 'string') validate('}')
+ }
+
+ if (node.minLength !== undefined) {
+ if (type !== 'string') validate('if (%s) {', types.string(name))
+
+ validate('if (%s.length < %d) {', name, node.minLength)
+ error('has less length than allowed')
+ validate('}')
+
+ if (type !== 'string') validate('}')
+ }
+
+ if (node.minimum !== undefined) {
+ validate('if (%s %s %d) {', name, node.exclusiveMinimum ? '<=' : '<', node.minimum)
+ error('is less than minimum')
+ validate('}')
+ }
+
+ if (node.maximum !== undefined) {
+ validate('if (%s %s %d) {', name, node.exclusiveMaximum ? '>=' : '>', node.maximum)
+ error('is more than maximum')
+ validate('}')
+ }
+
+ if (properties) {
+ Object.keys(properties).forEach(function(p) {
+ if (Array.isArray(type) && type.indexOf('null') !== -1) validate('if (%s !== null) {', name)
+
+ visit(genobj(name, p), properties[p], reporter, filter)
+
+ if (Array.isArray(type) && type.indexOf('null') !== -1) validate('}')
+ })
+ }
+
+ while (indent--) validate('}')
+ }
+
+ var validate = genfun
+ ('function validate(data) {')
+ ('validate.errors = null')
+ ('var errors = 0')
+
+ visit('data', schema, reporter, opts && opts.filter)
+
+ validate
+ ('return errors === 0')
+ ('}')
+
+ validate = validate.toFunction(scope)
+ validate.errors = null
+
+ validate.__defineGetter__('error', function() {
+ if (!validate.errors) return ''
+ return validate.errors
+ .map(function(err) {
+ return err.field+' '+err.message
+ })
+ .join('\n')
+ })
+
+ validate.toJSON = function() {
+ return schema
+ }
+
+ return validate
+}
+
+module.exports = function(schema, opts) {
+ if (typeof schema === 'string') schema = JSON.parse(schema)
+ return compile(schema, {}, schema, true, opts)
+}
+
+module.exports.filter = function(schema, opts) {
+ var validate = module.exports(schema, xtend(opts, {filter: true}))
+ return function(sch) {
+ validate(sch)
+ return sch
+ }
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore
new file mode 100644
index 000000000..3c3629e64
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore
@@ -0,0 +1 @@
+node_modules
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml
new file mode 100644
index 000000000..6e5919de3
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - "0.10"
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/README.md b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/README.md
new file mode 100644
index 000000000..693bff87c
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/README.md
@@ -0,0 +1,72 @@
+# generate-function
+
+Module that helps you write generated functions in Node
+
+```
+npm install generate-function
+```
+
+[![build status](http://img.shields.io/travis/mafintosh/generate-function.svg?style=flat)](http://travis-ci.org/mafintosh/generate-function)
+
+## Disclamer
+
+Writing code that generates code is hard.
+You should only use this if you really, really, really need this for performance reasons (like schema validators / parsers etc).
+
+## Usage
+
+``` js
+var genfun = require('generate-function')
+
+var addNumber = function(val) {
+ var fn = genfun()
+ ('function add(n) {')
+ ('return n + %d', val) // supports format strings to insert values
+ ('}')
+
+ return fn.toFunction() // will compile the function
+}
+
+var add2 = addNumber(2)
+
+console.log('1+2=', add2(1))
+console.log(add2.toString()) // prints the generated function
+```
+
+If you need to close over variables in your generated function pass them to `toFunction(scope)`
+
+``` js
+var multiply = function(a, b) {
+ return a * b
+}
+
+var addAndMultiplyNumber = function(val) {
+ var fn = genfun()
+ ('function(n) {')
+ ('if (typeof n !== "number") {') // ending a line with { will indent the source
+ ('throw new Error("argument should be a number")')
+ ('}')
+ ('var result = multiply(%d, n+%d)', val, val)
+ ('return result')
+ ('}')
+
+ // use fn.toString() if you want to see the generated source
+
+ return fn.toFunction({
+ multiply: multiply
+ })
+}
+
+var addAndMultiply2 = addAndMultiplyNumber(2)
+
+console.log('(3 + 2) * 2 =', addAndMultiply2(3))
+```
+
+## Related
+
+See [generate-object-property](https://github.com/mafintosh/generate-object-property) if you need to safely generate code that
+can be used to reference an object property
+
+## License
+
+MIT \ No newline at end of file
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/example.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/example.js
new file mode 100644
index 000000000..8d1fee162
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/example.js
@@ -0,0 +1,27 @@
+var genfun = require('./')
+
+var multiply = function(a, b) {
+ return a * b
+}
+
+var addAndMultiplyNumber = function(val) {
+ var fn = genfun()
+ ('function(n) {')
+ ('if (typeof n !== "number") {') // ending a line with { will indent the source
+ ('throw new Error("argument should be a number")')
+ ('}')
+ ('var result = multiply(%d, n+%d)', val, val)
+ ('return result')
+ ('}')
+
+ // use fn.toString() if you want to see the generated source
+
+ return fn.toFunction({
+ multiply: multiply
+ })
+}
+
+var addAndMultiply2 = addAndMultiplyNumber(2)
+
+console.log(addAndMultiply2.toString())
+console.log('(3 + 2) * 2 =', addAndMultiply2(3)) \ No newline at end of file
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/index.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/index.js
new file mode 100644
index 000000000..37e064bb4
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/index.js
@@ -0,0 +1,61 @@
+var util = require('util')
+
+var INDENT_START = /[\{\[]/
+var INDENT_END = /[\}\]]/
+
+module.exports = function() {
+ var lines = []
+ var indent = 0
+
+ var push = function(str) {
+ var spaces = ''
+ while (spaces.length < indent*2) spaces += ' '
+ lines.push(spaces+str)
+ }
+
+ var line = function(fmt) {
+ if (!fmt) return line
+
+ if (INDENT_END.test(fmt.trim()[0]) && INDENT_START.test(fmt[fmt.length-1])) {
+ indent--
+ push(util.format.apply(util, arguments))
+ indent++
+ return line
+ }
+ if (INDENT_START.test(fmt[fmt.length-1])) {
+ push(util.format.apply(util, arguments))
+ indent++
+ return line
+ }
+ if (INDENT_END.test(fmt.trim()[0])) {
+ indent--
+ push(util.format.apply(util, arguments))
+ return line
+ }
+
+ push(util.format.apply(util, arguments))
+ return line
+ }
+
+ line.toString = function() {
+ return lines.join('\n')
+ }
+
+ line.toFunction = function(scope) {
+ var src = 'return ('+line.toString()+')'
+
+ var keys = Object.keys(scope || {}).map(function(key) {
+ return key
+ })
+
+ var vals = keys.map(function(key) {
+ return scope[key]
+ })
+
+ return Function.apply(null, keys.concat(src)).apply(null, vals)
+ }
+
+ if (arguments.length) line.apply(null, arguments)
+
+ return line
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json
new file mode 100644
index 000000000..e2bc77284
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json
@@ -0,0 +1,37 @@
+{
+ "name": "generate-function",
+ "version": "2.0.0",
+ "description": "Module that helps you write generated functions in Node",
+ "main": "index.js",
+ "scripts": {
+ "test": "tape test.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/mafintosh/generate-function.git"
+ },
+ "keywords": [
+ "generate",
+ "code",
+ "generation",
+ "function",
+ "performance"
+ ],
+ "author": {
+ "name": "Mathias Buus"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/mafintosh/generate-function/issues"
+ },
+ "homepage": "https://github.com/mafintosh/generate-function",
+ "devDependencies": {
+ "tape": "^2.13.4"
+ },
+ "readme": "# generate-function\n\nModule that helps you write generated functions in Node\n\n```\nnpm install generate-function\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/generate-function.svg?style=flat)](http://travis-ci.org/mafintosh/generate-function)\n\n## Disclamer\n\nWriting code that generates code is hard.\nYou should only use this if you really, really, really need this for performance reasons (like schema validators / parsers etc).\n\n## Usage\n\n``` js\nvar genfun = require('generate-function')\n\nvar addNumber = function(val) {\n var fn = genfun()\n ('function add(n) {')\n ('return n + %d', val) // supports format strings to insert values\n ('}')\n\n return fn.toFunction() // will compile the function\n}\n\nvar add2 = addNumber(2)\n\nconsole.log('1+2=', add2(1))\nconsole.log(add2.toString()) // prints the generated function\n```\n\nIf you need to close over variables in your generated function pass them to `toFunction(scope)`\n\n``` js\nvar multiply = function(a, b) {\n return a * b\n}\n\nvar addAndMultiplyNumber = function(val) {\n var fn = genfun()\n ('function(n) {')\n ('if (typeof n !== \"number\") {') // ending a line with { will indent the source\n ('throw new Error(\"argument should be a number\")')\n ('}')\n ('var result = multiply(%d, n+%d)', val, val)\n ('return result')\n ('}')\n\n // use fn.toString() if you want to see the generated source\n\n return fn.toFunction({\n multiply: multiply\n })\n}\n\nvar addAndMultiply2 = addAndMultiplyNumber(2)\n\nconsole.log('(3 + 2) * 2 =', addAndMultiply2(3))\n```\n\n## Related\n\nSee [generate-object-property](https://github.com/mafintosh/generate-object-property) if you need to safely generate code that\ncan be used to reference an object property\n\n## License\n\nMIT",
+ "readmeFilename": "README.md",
+ "_id": "generate-function@2.0.0",
+ "_shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74",
+ "_resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz",
+ "_from": "generate-function@>=2.0.0 <3.0.0"
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/test.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/test.js
new file mode 100644
index 000000000..2768893eb
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/test.js
@@ -0,0 +1,33 @@
+var tape = require('tape')
+var genfun = require('./')
+
+tape('generate add function', function(t) {
+ var fn = genfun()
+ ('function add(n) {')
+ ('return n + %d', 42)
+ ('}')
+
+ t.same(fn.toString(), 'function add(n) {\n return n + 42\n}', 'code is indented')
+ t.same(fn.toFunction()(10), 52, 'function works')
+ t.end()
+})
+
+tape('generate function + closed variables', function(t) {
+ var fn = genfun()
+ ('function add(n) {')
+ ('return n + %d + number', 42)
+ ('}')
+
+ var notGood = fn.toFunction()
+ var good = fn.toFunction({number:10})
+
+ try {
+ notGood(10)
+ t.ok(false, 'function should not work')
+ } catch (err) {
+ t.same(err.message, 'number is not defined', 'throws reference error')
+ }
+
+ t.same(good(11), 63, 'function with closed var works')
+ t.end()
+}) \ No newline at end of file
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore
new file mode 100644
index 000000000..3c3629e64
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore
@@ -0,0 +1 @@
+node_modules
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml
new file mode 100644
index 000000000..6e5919de3
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - "0.10"
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE
new file mode 100644
index 000000000..757562ec5
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Mathias Buus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE. \ No newline at end of file
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md
new file mode 100644
index 000000000..0ee04613d
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md
@@ -0,0 +1,19 @@
+# generate-object-property
+
+Generate safe JS code that can used to reference a object property
+
+ npm install generate-object-property
+
+[![build status](http://img.shields.io/travis/mafintosh/generate-object-property.svg?style=flat)](http://travis-ci.org/mafintosh/generate-object-property)
+
+## Usage
+
+``` js
+var gen = require('generate-object-property');
+console.log(gen('a','b')); // prints a.b
+console.log(gen('a', 'foo-bar')); // prints a["foo-bar"]
+```
+
+## License
+
+MIT \ No newline at end of file
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js
new file mode 100644
index 000000000..5dc9f776d
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js
@@ -0,0 +1,12 @@
+var isProperty = require('is-property')
+
+var gen = function(obj, prop) {
+ return isProperty(prop) ? obj+'.'+prop : obj+'['+JSON.stringify(prop)+']'
+}
+
+gen.valid = isProperty
+gen.property = function (prop) {
+ return isProperty(prop) ? prop : JSON.stringify(prop)
+}
+
+module.exports = gen
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore
new file mode 100644
index 000000000..8ecfa25a8
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore
@@ -0,0 +1,17 @@
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+
+pids
+logs
+results
+
+npm-debug.log
+node_modules/*
+*.DS_Store
+test/* \ No newline at end of file
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE
new file mode 100644
index 000000000..8ce206a84
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE
@@ -0,0 +1,22 @@
+
+The MIT License (MIT)
+
+Copyright (c) 2013 Mikola Lysenko
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md
new file mode 100644
index 000000000..ef1d00b62
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md
@@ -0,0 +1,28 @@
+is-property
+===========
+Tests if a property of a JavaScript object can be accessed using the dot (.) notation or if it must be enclosed in brackets, (ie use x[" ... "])
+
+Example
+-------
+
+```javascript
+var isProperty = require("is-property")
+
+console.log(isProperty("foo")) //Prints true
+console.log(isProperty("0")) //Prints false
+```
+
+Install
+-------
+
+ npm install is-property
+
+### `require("is-property")(str)`
+Checks if str is a property
+
+* `str` is a string which we will test if it is a property or not
+
+**Returns** true or false depending if str is a property
+
+## Credits
+(c) 2013 Mikola Lysenko. MIT License \ No newline at end of file
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js
new file mode 100644
index 000000000..db58b47b2
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js
@@ -0,0 +1,5 @@
+"use strict"
+function isProperty(str) {
+ return /^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(str)
+}
+module.exports = isProperty \ No newline at end of file
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json
new file mode 100644
index 000000000..41225e266
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json
@@ -0,0 +1,44 @@
+{
+ "name": "is-property",
+ "version": "1.0.2",
+ "description": "Tests if a JSON property can be accessed using . syntax",
+ "main": "is-property.js",
+ "directories": {
+ "test": "test"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "tape": "~1.0.4"
+ },
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/mikolalysenko/is-property.git"
+ },
+ "keywords": [
+ "is",
+ "property",
+ "json",
+ "dot",
+ "bracket",
+ ".",
+ "[]"
+ ],
+ "author": {
+ "name": "Mikola Lysenko"
+ },
+ "license": "MIT",
+ "readmeFilename": "README.md",
+ "gitHead": "0a85ea5b6b1264ea1cdecc6e5cf186adbb3ffc50",
+ "bugs": {
+ "url": "https://github.com/mikolalysenko/is-property/issues"
+ },
+ "readme": "is-property\n===========\nTests if a property of a JavaScript object can be accessed using the dot (.) notation or if it must be enclosed in brackets, (ie use x[\" ... \"])\n\nExample\n-------\n\n```javascript\nvar isProperty = require(\"is-property\")\n\nconsole.log(isProperty(\"foo\")) //Prints true\nconsole.log(isProperty(\"0\")) //Prints false\n```\n\nInstall\n-------\n\n npm install is-property\n \n### `require(\"is-property\")(str)`\nChecks if str is a property\n\n* `str` is a string which we will test if it is a property or not\n\n**Returns** true or false depending if str is a property\n\n## Credits\n(c) 2013 Mikola Lysenko. MIT License",
+ "homepage": "https://github.com/mikolalysenko/is-property#readme",
+ "_id": "is-property@1.0.2",
+ "_shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84",
+ "_resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
+ "_from": "is-property@>=1.0.0 <2.0.0"
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json
new file mode 100644
index 000000000..0d018abfa
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json
@@ -0,0 +1,34 @@
+{
+ "name": "generate-object-property",
+ "version": "1.2.0",
+ "description": "Generate safe JS code that can used to reference a object property",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/mafintosh/generate-object-property.git"
+ },
+ "devDependencies": {
+ "tape": "^2.13.0"
+ },
+ "scripts": {
+ "test": "tape test.js"
+ },
+ "dependencies": {
+ "is-property": "^1.0.0"
+ },
+ "bugs": {
+ "url": "https://github.com/mafintosh/generate-object-property/issues"
+ },
+ "homepage": "https://github.com/mafintosh/generate-object-property",
+ "main": "index.js",
+ "author": {
+ "name": "Mathias Buus",
+ "url": "@mafintosh"
+ },
+ "license": "MIT",
+ "readme": "# generate-object-property\n\nGenerate safe JS code that can used to reference a object property\n\n\tnpm install generate-object-property\n\n[![build status](http://img.shields.io/travis/mafintosh/generate-object-property.svg?style=flat)](http://travis-ci.org/mafintosh/generate-object-property)\n\n## Usage\n\n``` js\nvar gen = require('generate-object-property');\nconsole.log(gen('a','b')); // prints a.b\nconsole.log(gen('a', 'foo-bar')); // prints a[\"foo-bar\"]\n```\n\n## License\n\nMIT",
+ "readmeFilename": "README.md",
+ "_id": "generate-object-property@1.2.0",
+ "_shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0",
+ "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz",
+ "_from": "generate-object-property@>=1.1.0 <2.0.0"
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js
new file mode 100644
index 000000000..6c299c67f
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js
@@ -0,0 +1,12 @@
+var tape = require('tape')
+var gen = require('./')
+
+tape('valid', function(t) {
+ t.same(gen('a', 'b'), 'a.b')
+ t.end()
+})
+
+tape('invalid', function(t) {
+ t.same(gen('a', '-b'), 'a["-b"]')
+ t.end()
+}) \ No newline at end of file
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml
new file mode 100644
index 000000000..9338bf147
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml
@@ -0,0 +1,10 @@
+language: "node_js"
+node_js:
+ - 0.6
+ - 0.8
+ - 0.10
+ - 0.11
+ - 0.12
+ - iojs-v1.0
+ - iojs-v2.0
+ - iojs
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md
new file mode 100644
index 000000000..e096dfa5d
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md
@@ -0,0 +1,32 @@
+# JSON Pointer for nodejs
+
+This is an implementation of [JSON Pointer](http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08).
+
+## Usage
+
+ var jsonpointer = require("jsonpointer");
+ var obj = { foo: 1, bar: { baz: 2}, qux: [3, 4, 5]};
+ var one = jsonpointer.get(obj, "/foo");
+ var two = jsonpointer.get(obj, "/bar/baz");
+ var three = jsonpointer.get(obj, "/qux/0");
+ var four = jsonpointer.get(obj, "/qux/1");
+ var five = jsonpointer.get(obj, "/qux/2");
+ var notfound = jsonpointer.get(obj, "/quo"); // returns null
+
+ jsonpointer.set(obj, "/foo", 6); // obj.foo = 6;
+
+## Testing
+
+ $ node test.js
+ All tests pass.
+ $
+
+[![Build Status](https://travis-ci.org/janl/node-jsonpointer.png?branch=master)](https://travis-ci.org/janl/node-jsonpointer)
+
+## Author
+
+(c) 2011 Jan Lehnardt <jan@apache.org>
+
+## License
+
+MIT License.
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js
new file mode 100644
index 000000000..006f85ef3
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js
@@ -0,0 +1,76 @@
+var untilde = function(str) {
+ return str.replace(/~./g, function(m) {
+ switch (m) {
+ case "~0":
+ return "~";
+ case "~1":
+ return "/";
+ }
+ throw new Error("Invalid tilde escape: " + m);
+ });
+}
+
+var traverse = function(obj, pointer, value) {
+ // assert(isArray(pointer))
+ var part = untilde(pointer.shift());
+ if(!obj.hasOwnProperty(part)) {
+ return null;
+ }
+ if(pointer.length !== 0) { // keep traversin!
+ return traverse(obj[part], pointer, value);
+ }
+ // we're done
+ if(typeof value === "undefined") {
+ // just reading
+ return obj[part];
+ }
+ // set new value, return old value
+ var old_value = obj[part];
+ if(value === null) {
+ delete obj[part];
+ } else {
+ obj[part] = value;
+ }
+ return old_value;
+}
+
+var validate_input = function(obj, pointer) {
+ if(typeof obj !== "object") {
+ throw new Error("Invalid input object.");
+ }
+
+ if(pointer === "") {
+ return [];
+ }
+
+ if(!pointer) {
+ throw new Error("Invalid JSON pointer.");
+ }
+
+ pointer = pointer.split("/");
+ var first = pointer.shift();
+ if (first !== "") {
+ throw new Error("Invalid JSON pointer.");
+ }
+
+ return pointer;
+}
+
+var get = function(obj, pointer) {
+ pointer = validate_input(obj, pointer);
+ if (pointer.length === 0) {
+ return obj;
+ }
+ return traverse(obj, pointer);
+}
+
+var set = function(obj, pointer, value) {
+ pointer = validate_input(obj, pointer);
+ if (pointer.length === 0) {
+ throw new Error("Invalid JSON pointer for set.")
+ }
+ return traverse(obj, pointer, value);
+}
+
+exports.get = get
+exports.set = set
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json
new file mode 100644
index 000000000..4b0677650
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json
@@ -0,0 +1,64 @@
+{
+ "name": "jsonpointer",
+ "description": "Simple JSON Addressing.",
+ "tags": [
+ "util",
+ "simple",
+ "util",
+ "utility"
+ ],
+ "version": "2.0.0",
+ "author": {
+ "name": "Jan Lehnardt",
+ "email": "jan@apache.org"
+ },
+ "contributors": [
+ {
+ "name": "Joe Hildebrand",
+ "email": "joe-github@cursive.net"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/janl/node-jsonpointer.git"
+ },
+ "bugs": {
+ "url": "http://github.com/janl/node-jsonpointer/issues"
+ },
+ "engines": {
+ "node": ">=0.6.0"
+ },
+ "main": "./jsonpointer",
+ "scripts": {
+ "test": "node test.js"
+ },
+ "license": "MIT",
+ "gitHead": "26ea4a5c0fcb6d9a2e87f733403791dd05637af8",
+ "homepage": "https://github.com/janl/node-jsonpointer#readme",
+ "_id": "jsonpointer@2.0.0",
+ "_shasum": "3af1dd20fe85463910d469a385e33017d2a030d9",
+ "_from": "jsonpointer@2.0.0",
+ "_npmVersion": "2.10.1",
+ "_nodeVersion": "0.10.36",
+ "_npmUser": {
+ "name": "marcbachmann",
+ "email": "marc.brookman@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "jan",
+ "email": "jan@apache.org"
+ },
+ {
+ "name": "marcbachmann",
+ "email": "marc.brookman@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "3af1dd20fe85463910d469a385e33017d2a030d9",
+ "tarball": "http://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js
new file mode 100644
index 000000000..1c67d7f7e
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js
@@ -0,0 +1,98 @@
+var assert = require("assert");
+var jsonpointer = require("./jsonpointer");
+
+var obj = {
+ a: 1,
+ b: {
+ c: 2
+ },
+ d: {
+ e: [{a:3}, {b:4}, {c:5}]
+ }
+};
+
+assert.equal(jsonpointer.get(obj, "/a"), 1);
+assert.equal(jsonpointer.get(obj, "/b/c"), 2);
+assert.equal(jsonpointer.get(obj, "/d/e/0/a"), 3);
+assert.equal(jsonpointer.get(obj, "/d/e/1/b"), 4);
+assert.equal(jsonpointer.get(obj, "/d/e/2/c"), 5);
+
+// set returns old value
+assert.equal(jsonpointer.set(obj, "/a", 2), 1);
+assert.equal(jsonpointer.set(obj, "/b/c", 3), 2);
+assert.equal(jsonpointer.set(obj, "/d/e/0/a", 4), 3);
+assert.equal(jsonpointer.set(obj, "/d/e/1/b", 5), 4);
+assert.equal(jsonpointer.set(obj, "/d/e/2/c", 6), 5);
+
+assert.equal(jsonpointer.get(obj, "/a"), 2);
+assert.equal(jsonpointer.get(obj, "/b/c"), 3);
+assert.equal(jsonpointer.get(obj, "/d/e/0/a"), 4);
+assert.equal(jsonpointer.get(obj, "/d/e/1/b"), 5);
+assert.equal(jsonpointer.get(obj, "/d/e/2/c"), 6);
+
+assert.equal(jsonpointer.get(obj, ""), obj);
+assert.throws(function(){ jsonpointer.get(obj, "a"); }, validateError);
+assert.throws(function(){ jsonpointer.get(obj, "a/"); }, validateError);
+
+function validateError(err) {
+ if ( (err instanceof Error) && /Invalid JSON pointer/.test(err.message) ) {
+ return true;
+ }
+}
+
+var complexKeys = {
+ "a/b": {
+ c: 1
+ },
+ d: {
+ "e/f": 2
+ },
+ "~1": 3,
+ "01": 4
+}
+
+assert.equal(jsonpointer.get(complexKeys, "/a~1b/c"), 1);
+assert.equal(jsonpointer.get(complexKeys, "/d/e~1f"), 2);
+assert.equal(jsonpointer.get(complexKeys, "/~01"), 3);
+assert.equal(jsonpointer.get(complexKeys, "/01"), 4);
+assert.equal(jsonpointer.get(complexKeys, "/a/b/c"), null);
+assert.equal(jsonpointer.get(complexKeys, "/~1"), null);
+
+// draft-ietf-appsawg-json-pointer-08 has special array rules
+var ary = [ "zero", "one", "two" ];
+assert.equal(jsonpointer.get(ary, "/01"), null);
+
+//assert.equal(jsonpointer.set(ary, "/-", "three"), null);
+//assert.equal(ary[3], "three");
+
+// Examples from the draft:
+var example = {
+ "foo": ["bar", "baz"],
+ "": 0,
+ "a/b": 1,
+ "c%d": 2,
+ "e^f": 3,
+ "g|h": 4,
+ "i\\j": 5,
+ "k\"l": 6,
+ " ": 7,
+ "m~n": 8
+};
+
+assert.equal(jsonpointer.get(example, ""), example);
+var ans = jsonpointer.get(example, "/foo");
+assert.equal(ans.length, 2);
+assert.equal(ans[0], "bar");
+assert.equal(ans[1], "baz");
+assert.equal(jsonpointer.get(example, "/foo/0"), "bar");
+assert.equal(jsonpointer.get(example, "/"), 0);
+assert.equal(jsonpointer.get(example, "/a~1b"), 1);
+assert.equal(jsonpointer.get(example, "/c%d"), 2);
+assert.equal(jsonpointer.get(example, "/e^f"), 3);
+assert.equal(jsonpointer.get(example, "/g|h"), 4);
+assert.equal(jsonpointer.get(example, "/i\\j"), 5);
+assert.equal(jsonpointer.get(example, "/k\"l"), 6);
+assert.equal(jsonpointer.get(example, "/ "), 7);
+assert.equal(jsonpointer.get(example, "/m~0n"), 8);
+
+console.log("All tests pass.");
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/.npmignore b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/.npmignore
new file mode 100644
index 000000000..3c3629e64
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/.npmignore
@@ -0,0 +1 @@
+node_modules
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/LICENCE b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/LICENCE
new file mode 100644
index 000000000..1a14b437e
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/LICENCE
@@ -0,0 +1,19 @@
+Copyright (c) 2012-2014 Raynos.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/Makefile b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/Makefile
new file mode 100644
index 000000000..d583fcf49
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/Makefile
@@ -0,0 +1,4 @@
+browser:
+ node ./support/compile
+
+.PHONY: browser \ No newline at end of file
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/README.md b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/README.md
new file mode 100644
index 000000000..093cb2978
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/README.md
@@ -0,0 +1,32 @@
+# xtend
+
+[![browser support][3]][4]
+
+[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges)
+
+Extend like a boss
+
+xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence.
+
+## Examples
+
+```js
+var extend = require("xtend")
+
+// extend returns a new object. Does not mutate arguments
+var combination = extend({
+ a: "a",
+ b: 'c'
+}, {
+ b: "b"
+})
+// { a: "a", b: "b" }
+```
+
+## Stability status: Locked
+
+## MIT Licenced
+
+
+ [3]: http://ci.testling.com/Raynos/xtend.png
+ [4]: http://ci.testling.com/Raynos/xtend
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/immutable.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/immutable.js
new file mode 100644
index 000000000..5b760152b
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/immutable.js
@@ -0,0 +1,17 @@
+module.exports = extend
+
+function extend() {
+ var target = {}
+
+ for (var i = 0; i < arguments.length; i++) {
+ var source = arguments[i]
+
+ for (var key in source) {
+ if (source.hasOwnProperty(key)) {
+ target[key] = source[key]
+ }
+ }
+ }
+
+ return target
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/mutable.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/mutable.js
new file mode 100644
index 000000000..a34475ebd
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/mutable.js
@@ -0,0 +1,15 @@
+module.exports = extend
+
+function extend(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i]
+
+ for (var key in source) {
+ if (source.hasOwnProperty(key)) {
+ target[key] = source[key]
+ }
+ }
+ }
+
+ return target
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/package.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/package.json
new file mode 100644
index 000000000..c087642df
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/package.json
@@ -0,0 +1,72 @@
+{
+ "name": "xtend",
+ "version": "4.0.0",
+ "description": "extend like a boss",
+ "keywords": [
+ "extend",
+ "merge",
+ "options",
+ "opts",
+ "object",
+ "array"
+ ],
+ "author": {
+ "name": "Raynos",
+ "email": "raynos2@gmail.com"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/Raynos/xtend.git"
+ },
+ "main": "immutable",
+ "scripts": {
+ "test": "node test"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "tape": "~1.1.0"
+ },
+ "homepage": "https://github.com/Raynos/xtend",
+ "contributors": [
+ {
+ "name": "Jake Verbaten"
+ },
+ {
+ "name": "Matt Esch"
+ }
+ ],
+ "bugs": {
+ "url": "https://github.com/Raynos/xtend/issues",
+ "email": "raynos2@gmail.com"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://github.com/raynos/xtend/raw/master/LICENSE"
+ }
+ ],
+ "testling": {
+ "files": "test.js",
+ "browsers": [
+ "ie/7..latest",
+ "firefox/16..latest",
+ "firefox/nightly",
+ "chrome/22..latest",
+ "chrome/canary",
+ "opera/12..latest",
+ "opera/next",
+ "safari/5.1..latest",
+ "ipad/6.0..latest",
+ "iphone/6.0..latest"
+ ]
+ },
+ "engines": {
+ "node": ">=0.4"
+ },
+ "readme": "# xtend\n\n[![browser support][3]][4]\n\n[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges)\n\nExtend like a boss\n\nxtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence.\n\n## Examples\n\n```js\nvar extend = require(\"xtend\")\n\n// extend returns a new object. Does not mutate arguments\nvar combination = extend({\n a: \"a\",\n b: 'c'\n}, {\n b: \"b\"\n})\n// { a: \"a\", b: \"b\" }\n```\n\n## Stability status: Locked\n\n## MIT Licenced\n\n\n [3]: http://ci.testling.com/Raynos/xtend.png\n [4]: http://ci.testling.com/Raynos/xtend\n",
+ "readmeFilename": "README.md",
+ "_id": "xtend@4.0.0",
+ "_shasum": "8bc36ff87aedbe7ce9eaf0bca36b2354a743840f",
+ "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz",
+ "_from": "xtend@>=4.0.0 <5.0.0"
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/test.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/test.js
new file mode 100644
index 000000000..3369d7966
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/test.js
@@ -0,0 +1,63 @@
+var test = require("tape")
+var extend = require("./")
+var mutableExtend = require("./mutable")
+
+test("merge", function(assert) {
+ var a = { a: "foo" }
+ var b = { b: "bar" }
+
+ assert.deepEqual(extend(a, b), { a: "foo", b: "bar" })
+ assert.end()
+})
+
+test("replace", function(assert) {
+ var a = { a: "foo" }
+ var b = { a: "bar" }
+
+ assert.deepEqual(extend(a, b), { a: "bar" })
+ assert.end()
+})
+
+test("undefined", function(assert) {
+ var a = { a: undefined }
+ var b = { b: "foo" }
+
+ assert.deepEqual(extend(a, b), { a: undefined, b: "foo" })
+ assert.deepEqual(extend(b, a), { a: undefined, b: "foo" })
+ assert.end()
+})
+
+test("handle 0", function(assert) {
+ var a = { a: "default" }
+ var b = { a: 0 }
+
+ assert.deepEqual(extend(a, b), { a: 0 })
+ assert.deepEqual(extend(b, a), { a: "default" })
+ assert.end()
+})
+
+test("is immutable", function (assert) {
+ var record = {}
+
+ extend(record, { foo: "bar" })
+ assert.equal(record.foo, undefined)
+ assert.end()
+})
+
+test("null as argument", function (assert) {
+ var a = { foo: "bar" }
+ var b = null
+ var c = void 0
+
+ assert.deepEqual(extend(b, a, c), { foo: "bar" })
+ assert.end()
+})
+
+test("mutable", function (assert) {
+ var a = { foo: "bar" }
+
+ mutableExtend(a, { bar: "baz" })
+
+ assert.equal(a.bar, "baz")
+ assert.end()
+})
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json
new file mode 100644
index 000000000..4dfb435af
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json
@@ -0,0 +1,42 @@
+{
+ "name": "is-my-json-valid",
+ "version": "2.12.2",
+ "description": "A JSONSchema validator that uses code generation to be extremely fast",
+ "main": "index.js",
+ "dependencies": {
+ "generate-function": "^2.0.0",
+ "generate-object-property": "^1.1.0",
+ "jsonpointer": "2.0.0",
+ "xtend": "^4.0.0"
+ },
+ "devDependencies": {
+ "tape": "^2.13.4"
+ },
+ "scripts": {
+ "test": "tape test/*.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/mafintosh/is-my-json-valid.git"
+ },
+ "keywords": [
+ "json",
+ "schema",
+ "orderly",
+ "jsonschema"
+ ],
+ "author": {
+ "name": "Mathias Buus"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/mafintosh/is-my-json-valid/issues"
+ },
+ "homepage": "https://github.com/mafintosh/is-my-json-valid",
+ "readme": "# is-my-json-valid\n\nA [JSONSchema](http://json-schema.org/) validator that uses code generation\nto be extremely fast\n\n```\nnpm install is-my-json-valid\n```\n\nIt passes the entire JSONSchema v4 test suite except for `remoteRefs` and `maxLength`/`minLength` when using unicode surrogate pairs.\n\n[![build status](http://img.shields.io/travis/mafintosh/is-my-json-valid.svg?style=flat)](http://travis-ci.org/mafintosh/is-my-json-valid)\n\n## Usage\n\nSimply pass a schema to compile it\n\n``` js\nvar validator = require('is-my-json-valid')\n\nvar validate = validator({\n required: true,\n type: 'object',\n properties: {\n hello: {\n required: true,\n type: 'string'\n }\n }\n})\n\nconsole.log('should be valid', validate({hello: 'world'}))\nconsole.log('should not be valid', validate({}))\n\n// get the last list of errors by checking validate.errors\n// the following will print [{field: 'data.hello', message: 'is required'}]\nconsole.log(validate.errors)\n```\n\nYou can also pass the schema as a string\n\n``` js\nvar validate = validate('{\"type\": ... }')\n```\n\nOptionally you can use the require submodule to load a schema from `__dirname`\n\n``` js\nvar validator = require('is-my-json-valid/require')\nvar validate = validator('my-schema.json')\n```\n\n## Custom formats\n\nis-my-json-valid supports the formats specified in JSON schema v4 (such as date-time).\nIf you want to add your own custom formats pass them as the formats options to the validator\n\n``` js\nvar validate = validator({\n type: 'string',\n required: true,\n format: 'only-a'\n}, {\n formats: {\n 'only-a': /^a+$/\n }\n})\n\nconsole.log(validate('aa')) // true\nconsole.log(validate('ab')) // false\n```\n\n## External schemas\n\nYou can pass in external schemas that you reference using the `$ref` attribute as the `schemas` option\n\n``` js\nvar ext = {\n required: true,\n type: 'string'\n}\n\nvar schema = {\n $ref: '#ext' // references another schema called ext\n}\n\n// pass the external schemas as an option\nvar validate = validator(schema, {schemas: {ext: ext}})\n\nvalidate('hello') // returns true\nvalidate(42) // return false\n```\n\n## Filtering away additional properties\n\nis-my-json-valid supports filtering away properties not in the schema\n\n``` js\nvar filter = validator.filter({\n required: true,\n type: 'object',\n properties: {\n hello: {type: 'string', required: true}\n },\n additionalProperties: false\n})\n\nvar doc = {hello: 'world', notInSchema: true}\nconsole.log(filter(doc)) // {hello: 'world'}\n```\n\n## Verbose mode outputs the value on errors\n\nis-my-json-valid outputs the value causing an error when verbose is set to true\n\n``` js\nvar validate = validator({\n required: true,\n type: 'object',\n properties: {\n hello: {\n required: true,\n type: 'string'\n }\n }\n}, {\n verbose: true\n})\n\nvalidate({hello: 100});\nconsole.log(validate.errors) // {field: 'data.hello', message: 'is the wrong type', value: 100}\n```\n\n## Greedy mode tries to validate as much as possible\n\nBy default is-my-json-valid bails on first validation error but when greedy is\nset to true it tries to validate as much as possible:\n\n``` js\nvar validate = validator({\n type: 'object',\n properties: {\n x: {\n type: 'number'\n }\n },\n required: ['x', 'y']\n}, {\n greedy: true\n});\n\nvalidate({x: 'string'});\nconsole.log(validate.errors) // [{field: 'data.y', message: 'is required'},\n // {field: 'data.x', message: 'is the wrong type'}]\n```\n\n## Performance\n\nis-my-json-valid uses code generation to turn your JSON schema into basic javascript code that is easily optimizeable by v8.\n\nAt the time of writing, is-my-json-valid is the __fastest validator__ when running\n\n* [json-schema-benchmark](https://github.com/Muscula/json-schema-benchmark)\n* [cosmicreals.com benchmark](http://cosmicrealms.com/blog/2014/08/29/benchmark-of-node-dot-js-json-validation-modules-part-3/)\n* [jsck benchmark](https://github.com/pandastrike/jsck/issues/72#issuecomment-70992684)\n* [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html)\n* [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html)\n\nIf you know any other relevant benchmarks open a PR and I'll add them.\n\n## License\n\nMIT\n",
+ "readmeFilename": "README.md",
+ "_id": "is-my-json-valid@2.12.2",
+ "_shasum": "0d65859318c846ce3a134402fd3fbc504272ccc9",
+ "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.2.tgz",
+ "_from": "is-my-json-valid@>=2.12.2 <3.0.0"
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/require.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/require.js
new file mode 100644
index 000000000..0bfb8a29d
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/require.js
@@ -0,0 +1,12 @@
+var fs = require('fs')
+var path = require('path')
+var compile = require('./')
+
+delete require.cache[require.resolve(__filename)]
+
+module.exports = function(file, opts) {
+ file = path.join(path.dirname(module.parent.filename), file)
+ if (!fs.existsSync(file) && fs.existsSync(file+'.schema')) file += '.schema'
+ if (!fs.existsSync(file) && fs.existsSync(file+'.json')) file += '.json'
+ return compile(fs.readFileSync(file, 'utf-8'), opts)
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/fixtures/cosmic.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/fixtures/cosmic.js
new file mode 100644
index 000000000..4e0a34b21
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/fixtures/cosmic.js
@@ -0,0 +1,84 @@
+exports.valid = {
+ fullName : "John Doe",
+ age : 47,
+ state : "Massachusetts",
+ city : "Boston",
+ zip : 16417,
+ married : false,
+ dozen : 12,
+ dozenOrBakersDozen : 13,
+ favoriteEvenNumber : 14,
+ topThreeFavoriteColors : [ "red", "blue", "green" ],
+ favoriteSingleDigitWholeNumbers : [ 7 ],
+ favoriteFiveLetterWord : "coder",
+ emailAddresses :
+ [
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@letters-in-local.org",
+ "01234567890@numbers-in-local.net",
+ "&'*+-./=?^_{}~@other-valid-characters-in-local.net",
+ "mixed-1234-in-{+^}-local@sld.net",
+ "a@single-character-in-local.org",
+ "\"quoted\"@sld.com",
+ "\"\\e\\s\\c\\a\\p\\e\\d\"@sld.com",
+ "\"quoted-at-sign@sld.org\"@sld.com",
+ "\"escaped\\\"quote\"@sld.com",
+ "\"back\\slash\"@sld.com",
+ "one-character-third-level@a.example.com",
+ "single-character-in-sld@x.org",
+ "local@dash-in-sld.com",
+ "letters-in-sld@123.com",
+ "one-letter-sld@x.org",
+ "uncommon-tld@sld.museum",
+ "uncommon-tld@sld.travel",
+ "uncommon-tld@sld.mobi",
+ "country-code-tld@sld.uk",
+ "country-code-tld@sld.rw",
+ "local@sld.newTLD",
+ "the-total-length@of-an-entire-address.cannot-be-longer-than-two-hundred-and-fifty-four-characters.and-this-address-is-254-characters-exactly.so-it-should-be-valid.and-im-going-to-add-some-more-words-here.to-increase-the-lenght-blah-blah-blah-blah-bla.org",
+ "the-character-limit@for-each-part.of-the-domain.is-sixty-three-characters.this-is-exactly-sixty-three-characters-so-it-is-valid-blah-blah.com",
+ "local@sub.domains.com"
+ ],
+ ipAddresses : [ "127.0.0.1", "24.48.64.2", "192.168.1.1", "209.68.44.3", "2.2.2.2" ]
+}
+
+exports.invalid = {
+ fullName : null,
+ age : -1,
+ state : 47,
+ city : false,
+ zip : [null],
+ married : "yes",
+ dozen : 50,
+ dozenOrBakersDozen : "over 9000",
+ favoriteEvenNumber : 15,
+ topThreeFavoriteColors : [ "red", 5 ],
+ favoriteSingleDigitWholeNumbers : [ 78, 2, 999 ],
+ favoriteFiveLetterWord : "codernaut",
+ emailAddresses : [],
+ ipAddresses : [ "999.0.099.1", "294.48.64.2346", false, "2221409.64214128.42414.235233", "124124.12412412" ]
+}
+
+exports.schema = { // from cosmic thingy
+ name : "test",
+ type : "object",
+ additionalProperties : false,
+ required : ["fullName", "age", "zip", "married", "dozen", "dozenOrBakersDozen", "favoriteEvenNumber", "topThreeFavoriteColors", "favoriteSingleDigitWholeNumbers", "favoriteFiveLetterWord", "emailAddresses", "ipAddresses"],
+ properties :
+ {
+ fullName : { type : "string" },
+ age : { type : "integer", minimum : 0 },
+ optionalItem : { type : "string" },
+ state : { type : "string" },
+ city : { type : "string" },
+ zip : { type : "integer", minimum : 0, maximum : 99999 },
+ married : { type : "boolean" },
+ dozen : { type : "integer", minimum : 12, maximum : 12 },
+ dozenOrBakersDozen : { type : "integer", minimum : 12, maximum : 13 },
+ favoriteEvenNumber : { type : "integer", multipleOf : 2 },
+ topThreeFavoriteColors : { type : "array", minItems : 3, maxItems : 3, uniqueItems : true, items : { type : "string" }},
+ favoriteSingleDigitWholeNumbers : { type : "array", minItems : 1, maxItems : 10, uniqueItems : true, items : { type : "integer", minimum : 0, maximum : 9 }},
+ favoriteFiveLetterWord : { type : "string", minLength : 5, maxLength : 5 },
+ emailAddresses : { type : "array", minItems : 1, uniqueItems : true, items : { type : "string", format : "email" }},
+ ipAddresses : { type : "array", uniqueItems : true, items : { type : "string", format : "ipv4" }},
+ }
+ } \ No newline at end of file
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json
new file mode 100644
index 000000000..521745c8d
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json
@@ -0,0 +1,82 @@
+[
+ {
+ "description": "additionalItems as schema",
+ "schema": {
+ "items": [{}],
+ "additionalItems": {"type": "integer"}
+ },
+ "tests": [
+ {
+ "description": "additional items match schema",
+ "data": [ null, 2, 3, 4 ],
+ "valid": true
+ },
+ {
+ "description": "additional items do not match schema",
+ "data": [ null, 2, 3, "foo" ],
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "items is schema, no additionalItems",
+ "schema": {
+ "items": {},
+ "additionalItems": false
+ },
+ "tests": [
+ {
+ "description": "all items match schema",
+ "data": [ 1, 2, 3, 4, 5 ],
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "array of items with no additionalItems",
+ "schema": {
+ "items": [{}, {}, {}],
+ "additionalItems": false
+ },
+ "tests": [
+ {
+ "description": "no additional items present",
+ "data": [ 1, 2, 3 ],
+ "valid": true
+ },
+ {
+ "description": "additional items are not permitted",
+ "data": [ 1, 2, 3, 4 ],
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "additionalItems as false without items",
+ "schema": {"additionalItems": false},
+ "tests": [
+ {
+ "description":
+ "items defaults to empty schema so everything is valid",
+ "data": [ 1, 2, 3, 4, 5 ],
+ "valid": true
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": {"foo" : "bar"},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "additionalItems are allowed by default",
+ "schema": {"items": [{"type": "integer"}]},
+ "tests": [
+ {
+ "description": "only the first item is validated",
+ "data": [1, "foo", false],
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json
new file mode 100644
index 000000000..40831f9e9
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json
@@ -0,0 +1,88 @@
+[
+ {
+ "description":
+ "additionalProperties being false does not allow other properties",
+ "schema": {
+ "properties": {"foo": {}, "bar": {}},
+ "patternProperties": { "^v": {} },
+ "additionalProperties": false
+ },
+ "tests": [
+ {
+ "description": "no additional properties is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "an additional property is invalid",
+ "data": {"foo" : 1, "bar" : 2, "quux" : "boom"},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": [1, 2, 3],
+ "valid": true
+ },
+ {
+ "description": "patternProperties are not additional properties",
+ "data": {"foo":1, "vroom": 2},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description":
+ "additionalProperties allows a schema which should validate",
+ "schema": {
+ "properties": {"foo": {}, "bar": {}},
+ "additionalProperties": {"type": "boolean"}
+ },
+ "tests": [
+ {
+ "description": "no additional properties is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "an additional valid property is valid",
+ "data": {"foo" : 1, "bar" : 2, "quux" : true},
+ "valid": true
+ },
+ {
+ "description": "an additional invalid property is invalid",
+ "data": {"foo" : 1, "bar" : 2, "quux" : 12},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description":
+ "additionalProperties can exist by itself",
+ "schema": {
+ "additionalProperties": {"type": "boolean"}
+ },
+ "tests": [
+ {
+ "description": "an additional valid property is valid",
+ "data": {"foo" : true},
+ "valid": true
+ },
+ {
+ "description": "an additional invalid property is invalid",
+ "data": {"foo" : 1},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "additionalProperties are allowed by default",
+ "schema": {"properties": {"foo": {}, "bar": {}}},
+ "tests": [
+ {
+ "description": "additional properties are allowed",
+ "data": {"foo": 1, "bar": 2, "quux": true},
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json
new file mode 100644
index 000000000..bbb5f89e4
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json
@@ -0,0 +1,112 @@
+[
+ {
+ "description": "allOf",
+ "schema": {
+ "allOf": [
+ {
+ "properties": {
+ "bar": {"type": "integer"}
+ },
+ "required": ["bar"]
+ },
+ {
+ "properties": {
+ "foo": {"type": "string"}
+ },
+ "required": ["foo"]
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "allOf",
+ "data": {"foo": "baz", "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "mismatch second",
+ "data": {"foo": "baz"},
+ "valid": false
+ },
+ {
+ "description": "mismatch first",
+ "data": {"bar": 2},
+ "valid": false
+ },
+ {
+ "description": "wrong type",
+ "data": {"foo": "baz", "bar": "quux"},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "allOf with base schema",
+ "schema": {
+ "properties": {"bar": {"type": "integer"}},
+ "required": ["bar"],
+ "allOf" : [
+ {
+ "properties": {
+ "foo": {"type": "string"}
+ },
+ "required": ["foo"]
+ },
+ {
+ "properties": {
+ "baz": {"type": "null"}
+ },
+ "required": ["baz"]
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": {"foo": "quux", "bar": 2, "baz": null},
+ "valid": true
+ },
+ {
+ "description": "mismatch base schema",
+ "data": {"foo": "quux", "baz": null},
+ "valid": false
+ },
+ {
+ "description": "mismatch first allOf",
+ "data": {"bar": 2, "baz": null},
+ "valid": false
+ },
+ {
+ "description": "mismatch second allOf",
+ "data": {"foo": "quux", "bar": 2},
+ "valid": false
+ },
+ {
+ "description": "mismatch both",
+ "data": {"bar": 2},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "allOf simple types",
+ "schema": {
+ "allOf": [
+ {"maximum": 30},
+ {"minimum": 20}
+ ]
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": 25,
+ "valid": true
+ },
+ {
+ "description": "mismatch one",
+ "data": 35,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json
new file mode 100644
index 000000000..a58714afd
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json
@@ -0,0 +1,68 @@
+[
+ {
+ "description": "anyOf",
+ "schema": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "minimum": 2
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "first anyOf valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "second anyOf valid",
+ "data": 2.5,
+ "valid": true
+ },
+ {
+ "description": "both anyOf valid",
+ "data": 3,
+ "valid": true
+ },
+ {
+ "description": "neither anyOf valid",
+ "data": 1.5,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "anyOf with base schema",
+ "schema": {
+ "type": "string",
+ "anyOf" : [
+ {
+ "maxLength": 2
+ },
+ {
+ "minLength": 4
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "mismatch base schema",
+ "data": 3,
+ "valid": false
+ },
+ {
+ "description": "one anyOf valid",
+ "data": "foobar",
+ "valid": true
+ },
+ {
+ "description": "both anyOf invalid",
+ "data": "foo",
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json
new file mode 100644
index 000000000..ccc7c17fe
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json
@@ -0,0 +1,107 @@
+[
+ {
+ "description": "integer",
+ "schema": {"type": "integer"},
+ "tests": [
+ {
+ "description": "a bignum is an integer",
+ "data": 12345678910111213141516171819202122232425262728293031,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "number",
+ "schema": {"type": "number"},
+ "tests": [
+ {
+ "description": "a bignum is a number",
+ "data": 98249283749234923498293171823948729348710298301928331,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "integer",
+ "schema": {"type": "integer"},
+ "tests": [
+ {
+ "description": "a negative bignum is an integer",
+ "data": -12345678910111213141516171819202122232425262728293031,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "number",
+ "schema": {"type": "number"},
+ "tests": [
+ {
+ "description": "a negative bignum is a number",
+ "data": -98249283749234923498293171823948729348710298301928331,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "string",
+ "schema": {"type": "string"},
+ "tests": [
+ {
+ "description": "a bignum is not a string",
+ "data": 98249283749234923498293171823948729348710298301928331,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "integer comparison",
+ "schema": {"maximum": 18446744073709551615},
+ "tests": [
+ {
+ "description": "comparison works for high numbers",
+ "data": 18446744073709551600,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "float comparison with high precision",
+ "schema": {
+ "maximum": 972783798187987123879878123.18878137,
+ "exclusiveMaximum": true
+ },
+ "tests": [
+ {
+ "description": "comparison works for high numbers",
+ "data": 972783798187987123879878123.188781371,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "integer comparison",
+ "schema": {"minimum": -18446744073709551615},
+ "tests": [
+ {
+ "description": "comparison works for very negative numbers",
+ "data": -18446744073709551600,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "float comparison with high precision on negative numbers",
+ "schema": {
+ "minimum": -972783798187987123879878123.18878137,
+ "exclusiveMinimum": true
+ },
+ "tests": [
+ {
+ "description": "comparison works for very negative numbers",
+ "data": -972783798187987123879878123.188781371,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/default.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/default.json
new file mode 100644
index 000000000..17629779f
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/default.json
@@ -0,0 +1,49 @@
+[
+ {
+ "description": "invalid type for default",
+ "schema": {
+ "properties": {
+ "foo": {
+ "type": "integer",
+ "default": []
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "valid when property is specified",
+ "data": {"foo": 13},
+ "valid": true
+ },
+ {
+ "description": "still valid when the invalid default is used",
+ "data": {},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "invalid string value for default",
+ "schema": {
+ "properties": {
+ "bar": {
+ "type": "string",
+ "minLength": 4,
+ "default": "bad"
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "valid when property is specified",
+ "data": {"bar": "good"},
+ "valid": true
+ },
+ {
+ "description": "still valid when the invalid default is used",
+ "data": {},
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json
new file mode 100644
index 000000000..cf935a321
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json
@@ -0,0 +1,32 @@
+[
+ {
+ "description": "valid definition",
+ "schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
+ "tests": [
+ {
+ "description": "valid definition schema",
+ "data": {
+ "definitions": {
+ "foo": {"type": "integer"}
+ }
+ },
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "invalid definition",
+ "schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
+ "tests": [
+ {
+ "description": "invalid definition schema",
+ "data": {
+ "definitions": {
+ "foo": {"type": 1}
+ }
+ },
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json
new file mode 100644
index 000000000..7b9b16a7e
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json
@@ -0,0 +1,113 @@
+[
+ {
+ "description": "dependencies",
+ "schema": {
+ "dependencies": {"bar": ["foo"]}
+ },
+ "tests": [
+ {
+ "description": "neither",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "nondependant",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "with dependency",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "missing dependency",
+ "data": {"bar": 2},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": "foo",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "multiple dependencies",
+ "schema": {
+ "dependencies": {"quux": ["foo", "bar"]}
+ },
+ "tests": [
+ {
+ "description": "neither",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "nondependants",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "with dependencies",
+ "data": {"foo": 1, "bar": 2, "quux": 3},
+ "valid": true
+ },
+ {
+ "description": "missing dependency",
+ "data": {"foo": 1, "quux": 2},
+ "valid": false
+ },
+ {
+ "description": "missing other dependency",
+ "data": {"bar": 1, "quux": 2},
+ "valid": false
+ },
+ {
+ "description": "missing both dependencies",
+ "data": {"quux": 1},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "multiple dependencies subschema",
+ "schema": {
+ "dependencies": {
+ "bar": {
+ "properties": {
+ "foo": {"type": "integer"},
+ "bar": {"type": "integer"}
+ }
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "no dependency",
+ "data": {"foo": "quux"},
+ "valid": true
+ },
+ {
+ "description": "wrong type",
+ "data": {"foo": "quux", "bar": 2},
+ "valid": false
+ },
+ {
+ "description": "wrong type other",
+ "data": {"foo": 2, "bar": "quux"},
+ "valid": false
+ },
+ {
+ "description": "wrong type both",
+ "data": {"foo": "quux", "bar": "quux"},
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json
new file mode 100644
index 000000000..f124436a7
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json
@@ -0,0 +1,72 @@
+[
+ {
+ "description": "simple enum validation",
+ "schema": {"enum": [1, 2, 3]},
+ "tests": [
+ {
+ "description": "one of the enum is valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "something else is invalid",
+ "data": 4,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "heterogeneous enum validation",
+ "schema": {"enum": [6, "foo", [], true, {"foo": 12}]},
+ "tests": [
+ {
+ "description": "one of the enum is valid",
+ "data": [],
+ "valid": true
+ },
+ {
+ "description": "something else is invalid",
+ "data": null,
+ "valid": false
+ },
+ {
+ "description": "objects are deep compared",
+ "data": {"foo": false},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "enums in properties",
+ "schema": {
+ "type":"object",
+ "properties": {
+ "foo": {"enum":["foo"]},
+ "bar": {"enum":["bar"]}
+ },
+ "required": ["bar"]
+ },
+ "tests": [
+ {
+ "description": "both properties are valid",
+ "data": {"foo":"foo", "bar":"bar"},
+ "valid": true
+ },
+ {
+ "description": "missing optional property is valid",
+ "data": {"bar":"bar"},
+ "valid": true
+ },
+ {
+ "description": "missing required property is invalid",
+ "data": {"foo":"foo"},
+ "valid": false
+ },
+ {
+ "description": "missing all properties is invalid",
+ "data": {},
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/format.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/format.json
new file mode 100644
index 000000000..53c5d2519
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/format.json
@@ -0,0 +1,143 @@
+[
+ {
+ "description": "validation of date-time strings",
+ "schema": {"format": "date-time"},
+ "tests": [
+ {
+ "description": "a valid date-time string",
+ "data": "1963-06-19T08:30:06.283185Z",
+ "valid": true
+ },
+ {
+ "description": "an invalid date-time string",
+ "data": "06/19/1963 08:30:06 PST",
+ "valid": false
+ },
+ {
+ "description": "only RFC3339 not all of ISO 8601 are valid",
+ "data": "2013-350T01:01:01",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of URIs",
+ "schema": {"format": "uri"},
+ "tests": [
+ {
+ "description": "a valid URI",
+ "data": "http://foo.bar/?baz=qux#quux",
+ "valid": true
+ },
+ {
+ "description": "an invalid URI",
+ "data": "\\\\WINDOWS\\fileshare",
+ "valid": false
+ },
+ {
+ "description": "an invalid URI though valid URI reference",
+ "data": "abc",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of e-mail addresses",
+ "schema": {"format": "email"},
+ "tests": [
+ {
+ "description": "a valid e-mail address",
+ "data": "joe.bloggs@example.com",
+ "valid": true
+ },
+ {
+ "description": "an invalid e-mail address",
+ "data": "2962",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of IP addresses",
+ "schema": {"format": "ipv4"},
+ "tests": [
+ {
+ "description": "a valid IP address",
+ "data": "192.168.0.1",
+ "valid": true
+ },
+ {
+ "description": "an IP address with too many components",
+ "data": "127.0.0.0.1",
+ "valid": false
+ },
+ {
+ "description": "an IP address with out-of-range values",
+ "data": "256.256.256.256",
+ "valid": false
+ },
+ {
+ "description": "an IP address without 4 components",
+ "data": "127.0",
+ "valid": false
+ },
+ {
+ "description": "an IP address as an integer",
+ "data": "0x7f000001",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of IPv6 addresses",
+ "schema": {"format": "ipv6"},
+ "tests": [
+ {
+ "description": "a valid IPv6 address",
+ "data": "::1",
+ "valid": true
+ },
+ {
+ "description": "an IPv6 address with out-of-range values",
+ "data": "12345::",
+ "valid": false
+ },
+ {
+ "description": "an IPv6 address with too many components",
+ "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1",
+ "valid": false
+ },
+ {
+ "description": "an IPv6 address containing illegal characters",
+ "data": "::laptop",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "validation of host names",
+ "schema": {"format": "hostname"},
+ "tests": [
+ {
+ "description": "a valid host name",
+ "data": "www.example.com",
+ "valid": true
+ },
+ {
+ "description": "a host name starting with an illegal character",
+ "data": "-a-host-name-that-starts-with--",
+ "valid": false
+ },
+ {
+ "description": "a host name containing illegal characters",
+ "data": "not_a_valid_host_name",
+ "valid": false
+ },
+ {
+ "description": "a host name with a component too long",
+ "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component",
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/items.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/items.json
new file mode 100644
index 000000000..f5e18a138
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/items.json
@@ -0,0 +1,46 @@
+[
+ {
+ "description": "a schema given for items",
+ "schema": {
+ "items": {"type": "integer"}
+ },
+ "tests": [
+ {
+ "description": "valid items",
+ "data": [ 1, 2, 3 ],
+ "valid": true
+ },
+ {
+ "description": "wrong type of items",
+ "data": [1, "x"],
+ "valid": false
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": {"foo" : "bar"},
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "an array of schemas for items",
+ "schema": {
+ "items": [
+ {"type": "integer"},
+ {"type": "string"}
+ ]
+ },
+ "tests": [
+ {
+ "description": "correct types",
+ "data": [ 1, "foo" ],
+ "valid": true
+ },
+ {
+ "description": "wrong types",
+ "data": [ "foo", 1 ],
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json
new file mode 100644
index 000000000..3b53a6b37
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "maxItems validation",
+ "schema": {"maxItems": 2},
+ "tests": [
+ {
+ "description": "shorter is valid",
+ "data": [1],
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "too long is invalid",
+ "data": [1, 2, 3],
+ "valid": false
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": "foobar",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json
new file mode 100644
index 000000000..48eb1296d
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "maxLength validation",
+ "schema": {"maxLength": 2},
+ "tests": [
+ {
+ "description": "shorter is valid",
+ "data": "f",
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": "fo",
+ "valid": true
+ },
+ {
+ "description": "too long is invalid",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": 100,
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json
new file mode 100644
index 000000000..d282446ad
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "maxProperties validation",
+ "schema": {"maxProperties": 2},
+ "tests": [
+ {
+ "description": "shorter is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "too long is invalid",
+ "data": {"foo": 1, "bar": 2, "baz": 3},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": "foobar",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json
new file mode 100644
index 000000000..86c7b89c9
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json
@@ -0,0 +1,42 @@
+[
+ {
+ "description": "maximum validation",
+ "schema": {"maximum": 3.0},
+ "tests": [
+ {
+ "description": "below the maximum is valid",
+ "data": 2.6,
+ "valid": true
+ },
+ {
+ "description": "above the maximum is invalid",
+ "data": 3.5,
+ "valid": false
+ },
+ {
+ "description": "ignores non-numbers",
+ "data": "x",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "exclusiveMaximum validation",
+ "schema": {
+ "maximum": 3.0,
+ "exclusiveMaximum": true
+ },
+ "tests": [
+ {
+ "description": "below the maximum is still valid",
+ "data": 2.2,
+ "valid": true
+ },
+ {
+ "description": "boundary point is invalid",
+ "data": 3.0,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json
new file mode 100644
index 000000000..ed5118815
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "minItems validation",
+ "schema": {"minItems": 1},
+ "tests": [
+ {
+ "description": "longer is valid",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": [1],
+ "valid": true
+ },
+ {
+ "description": "too short is invalid",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "ignores non-arrays",
+ "data": "",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json
new file mode 100644
index 000000000..e9c14b172
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "minLength validation",
+ "schema": {"minLength": 2},
+ "tests": [
+ {
+ "description": "longer is valid",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": "fo",
+ "valid": true
+ },
+ {
+ "description": "too short is invalid",
+ "data": "f",
+ "valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": 1,
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json
new file mode 100644
index 000000000..a72c7d293
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json
@@ -0,0 +1,28 @@
+[
+ {
+ "description": "minProperties validation",
+ "schema": {"minProperties": 1},
+ "tests": [
+ {
+ "description": "longer is valid",
+ "data": {"foo": 1, "bar": 2},
+ "valid": true
+ },
+ {
+ "description": "exact length is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "too short is invalid",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": "",
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json
new file mode 100644
index 000000000..d5bf000bc
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json
@@ -0,0 +1,42 @@
+[
+ {
+ "description": "minimum validation",
+ "schema": {"minimum": 1.1},
+ "tests": [
+ {
+ "description": "above the minimum is valid",
+ "data": 2.6,
+ "valid": true
+ },
+ {
+ "description": "below the minimum is invalid",
+ "data": 0.6,
+ "valid": false
+ },
+ {
+ "description": "ignores non-numbers",
+ "data": "x",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "exclusiveMinimum validation",
+ "schema": {
+ "minimum": 1.1,
+ "exclusiveMinimum": true
+ },
+ "tests": [
+ {
+ "description": "above the minimum is still valid",
+ "data": 1.2,
+ "valid": true
+ },
+ {
+ "description": "boundary point is invalid",
+ "data": 1.1,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json
new file mode 100644
index 000000000..ca3b76180
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json
@@ -0,0 +1,60 @@
+[
+ {
+ "description": "by int",
+ "schema": {"multipleOf": 2},
+ "tests": [
+ {
+ "description": "int by int",
+ "data": 10,
+ "valid": true
+ },
+ {
+ "description": "int by int fail",
+ "data": 7,
+ "valid": false
+ },
+ {
+ "description": "ignores non-numbers",
+ "data": "foo",
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "by number",
+ "schema": {"multipleOf": 1.5},
+ "tests": [
+ {
+ "description": "zero is multiple of anything",
+ "data": 0,
+ "valid": true
+ },
+ {
+ "description": "4.5 is multiple of 1.5",
+ "data": 4.5,
+ "valid": true
+ },
+ {
+ "description": "35 is not multiple of 1.5",
+ "data": 35,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "by small number",
+ "schema": {"multipleOf": 0.0001},
+ "tests": [
+ {
+ "description": "0.0075 is multiple of 0.0001",
+ "data": 0.0075,
+ "valid": true
+ },
+ {
+ "description": "0.00751 is not multiple of 0.0001",
+ "data": 0.00751,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json
new file mode 100644
index 000000000..cbb7f46bf
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json
@@ -0,0 +1,96 @@
+[
+ {
+ "description": "not",
+ "schema": {
+ "not": {"type": "integer"}
+ },
+ "tests": [
+ {
+ "description": "allowed",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "disallowed",
+ "data": 1,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "not multiple types",
+ "schema": {
+ "not": {"type": ["integer", "boolean"]}
+ },
+ "tests": [
+ {
+ "description": "valid",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "other mismatch",
+ "data": true,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "not more complex schema",
+ "schema": {
+ "not": {
+ "type": "object",
+ "properties": {
+ "foo": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "match",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "other match",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": {"foo": "bar"},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "forbidden property",
+ "schema": {
+ "properties": {
+ "foo": {
+ "not": {}
+ }
+ }
+ },
+ "tests": [
+ {
+ "description": "property present",
+ "data": {"foo": 1, "bar": 2},
+ "valid": false
+ },
+ {
+ "description": "property absent",
+ "data": {"bar": 1, "baz": 2},
+ "valid": true
+ }
+ ]
+ }
+
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json
new file mode 100644
index 000000000..d7fce9f50
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json
@@ -0,0 +1,18 @@
+[
+ {
+ "description": "validation of null and format",
+ "schema": {"type": ["null", "string"], "format": "date-time"},
+ "tests": [
+ {
+ "description": "a valid date-time string",
+ "data": "1963-06-19T08:30:06.283185Z",
+ "valid": true
+ },
+ {
+ "description": "allow null",
+ "data": null,
+ "valid": true
+ }
+ ]
+ }
+] \ No newline at end of file
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndObject.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndObject.json
new file mode 100644
index 000000000..c65c02c36
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndObject.json
@@ -0,0 +1,18 @@
+[
+ {
+ "description": "multiple types of null and object containing properties",
+ "schema": {
+ "type": ["null", "object"],
+ "properties": {
+ "foo": {}
+ }
+ },
+ "tests": [
+ {
+ "description": "null is valid",
+ "data": null,
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json
new file mode 100644
index 000000000..1eaa4e479
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json
@@ -0,0 +1,68 @@
+[
+ {
+ "description": "oneOf",
+ "schema": {
+ "oneOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "minimum": 2
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "first oneOf valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "second oneOf valid",
+ "data": 2.5,
+ "valid": true
+ },
+ {
+ "description": "both oneOf valid",
+ "data": 3,
+ "valid": false
+ },
+ {
+ "description": "neither oneOf valid",
+ "data": 1.5,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "oneOf with base schema",
+ "schema": {
+ "type": "string",
+ "oneOf" : [
+ {
+ "minLength": 2
+ },
+ {
+ "maxLength": 4
+ }
+ ]
+ },
+ "tests": [
+ {
+ "description": "mismatch base schema",
+ "data": 3,
+ "valid": false
+ },
+ {
+ "description": "one oneOf valid",
+ "data": "foobar",
+ "valid": true
+ },
+ {
+ "description": "both oneOf valid",
+ "data": "foo",
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json
new file mode 100644
index 000000000..befc4b560
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json
@@ -0,0 +1,23 @@
+[
+ {
+ "description": "pattern validation",
+ "schema": {"pattern": "^a*$"},
+ "tests": [
+ {
+ "description": "a matching pattern is valid",
+ "data": "aaa",
+ "valid": true
+ },
+ {
+ "description": "a non-matching pattern is invalid",
+ "data": "abc",
+ "valid": false
+ },
+ {
+ "description": "ignores non-strings",
+ "data": true,
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json
new file mode 100644
index 000000000..18586e5da
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json
@@ -0,0 +1,110 @@
+[
+ {
+ "description":
+ "patternProperties validates properties matching a regex",
+ "schema": {
+ "patternProperties": {
+ "f.*o": {"type": "integer"}
+ }
+ },
+ "tests": [
+ {
+ "description": "a single valid match is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "multiple valid matches is valid",
+ "data": {"foo": 1, "foooooo" : 2},
+ "valid": true
+ },
+ {
+ "description": "a single invalid match is invalid",
+ "data": {"foo": "bar", "fooooo": 2},
+ "valid": false
+ },
+ {
+ "description": "multiple invalid matches is invalid",
+ "data": {"foo": "bar", "foooooo" : "baz"},
+ "valid": false
+ },
+ {
+ "description": "ignores non-objects",
+ "data": 12,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "multiple simultaneous patternProperties are validated",
+ "schema": {
+ "patternProperties": {
+ "a*": {"type": "integer"},
+ "aaa*": {"maximum": 20}
+ }
+ },
+ "tests": [
+ {
+ "description": "a single valid match is valid",
+ "data": {"a": 21},
+ "valid": true
+ },
+ {
+ "description": "a simultaneous match is valid",
+ "data": {"aaaa": 18},
+ "valid": true
+ },
+ {
+ "description": "multiple matches is valid",
+ "data": {"a": 21, "aaaa": 18},
+ "valid": true
+ },
+ {
+ "description": "an invalid due to one is invalid",
+ "data": {"a": "bar"},
+ "valid": false
+ },
+ {
+ "description": "an invalid due to the other is invalid",
+ "data": {"aaaa": 31},
+ "valid": false
+ },
+ {
+ "description": "an invalid due to both is invalid",
+ "data": {"aaa": "foo", "aaaa": 31},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "regexes are not anchored by default and are case sensitive",
+ "schema": {
+ "patternProperties": {
+ "[0-9]{2,}": { "type": "boolean" },
+ "X_": { "type": "string" }
+ }
+ },
+ "tests": [
+ {
+ "description": "non recognized members are ignored",
+ "data": { "answer 1": "42" },
+ "valid": true
+ },
+ {
+ "description": "recognized members are accounted for",
+ "data": { "a31b": null },
+ "valid": false
+ },
+ {
+ "description": "regexes are case sensitive",
+ "data": { "a_x_3": 3 },
+ "valid": true
+ },
+ {
+ "description": "regexes are case sensitive, 2",
+ "data": { "a_X_3": 3 },
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json
new file mode 100644
index 000000000..cd1644dcd
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json
@@ -0,0 +1,92 @@
+[
+ {
+ "description": "object properties validation",
+ "schema": {
+ "properties": {
+ "foo": {"type": "integer"},
+ "bar": {"type": "string"}
+ }
+ },
+ "tests": [
+ {
+ "description": "both properties present and valid is valid",
+ "data": {"foo": 1, "bar": "baz"},
+ "valid": true
+ },
+ {
+ "description": "one property invalid is invalid",
+ "data": {"foo": 1, "bar": {}},
+ "valid": false
+ },
+ {
+ "description": "both properties invalid is invalid",
+ "data": {"foo": [], "bar": {}},
+ "valid": false
+ },
+ {
+ "description": "doesn't invalidate other properties",
+ "data": {"quux": []},
+ "valid": true
+ },
+ {
+ "description": "ignores non-objects",
+ "data": [],
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description":
+ "properties, patternProperties, additionalProperties interaction",
+ "schema": {
+ "properties": {
+ "foo": {"type": "array", "maxItems": 3},
+ "bar": {"type": "array"}
+ },
+ "patternProperties": {"f.o": {"minItems": 2}},
+ "additionalProperties": {"type": "integer"}
+ },
+ "tests": [
+ {
+ "description": "property validates property",
+ "data": {"foo": [1, 2]},
+ "valid": true
+ },
+ {
+ "description": "property invalidates property",
+ "data": {"foo": [1, 2, 3, 4]},
+ "valid": false
+ },
+ {
+ "description": "patternProperty invalidates property",
+ "data": {"foo": []},
+ "valid": false
+ },
+ {
+ "description": "patternProperty validates nonproperty",
+ "data": {"fxo": [1, 2]},
+ "valid": true
+ },
+ {
+ "description": "patternProperty invalidates nonproperty",
+ "data": {"fxo": []},
+ "valid": false
+ },
+ {
+ "description": "additionalProperty ignores property",
+ "data": {"bar": []},
+ "valid": true
+ },
+ {
+ "description": "additionalProperty validates others",
+ "data": {"quux": 3},
+ "valid": true
+ },
+ {
+ "description": "additionalProperty invalidates others",
+ "data": {"quux": "foo"},
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json
new file mode 100644
index 000000000..d8214bc2b
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json
@@ -0,0 +1,128 @@
+[
+ {
+ "description": "root pointer ref",
+ "schema": {
+ "properties": {
+ "foo": {"$ref": "#"}
+ },
+ "additionalProperties": false
+ },
+ "tests": [
+ {
+ "description": "match",
+ "data": {"foo": false},
+ "valid": true
+ },
+ {
+ "description": "recursive match",
+ "data": {"foo": {"foo": false}},
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": {"bar": false},
+ "valid": false
+ },
+ {
+ "description": "recursive mismatch",
+ "data": {"foo": {"bar": false}},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "relative pointer ref to object",
+ "schema": {
+ "properties": {
+ "foo": {"type": "integer"},
+ "bar": {"$ref": "#/properties/foo"}
+ }
+ },
+ "tests": [
+ {
+ "description": "match",
+ "data": {"bar": 3},
+ "valid": true
+ },
+ {
+ "description": "mismatch",
+ "data": {"bar": true},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "relative pointer ref to array",
+ "schema": {
+ "items": [
+ {"type": "integer"},
+ {"$ref": "#/items/0"}
+ ]
+ },
+ "tests": [
+ {
+ "description": "match array",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "mismatch array",
+ "data": [1, "foo"],
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "escaped pointer ref",
+ "schema": {
+ "tilda~field": {"type": "integer"},
+ "slash/field": {"type": "integer"},
+ "percent%field": {"type": "integer"},
+ "properties": {
+ "tilda": {"$ref": "#/tilda~0field"},
+ "slash": {"$ref": "#/slash~1field"},
+ "percent": {"$ref": "#/percent%25field"}
+ }
+ },
+ "tests": [
+ {
+ "description": "slash",
+ "data": {"slash": "aoeu"},
+ "valid": false
+ },
+ {
+ "description": "tilda",
+ "data": {"tilda": "aoeu"},
+ "valid": false
+ },
+ {
+ "description": "percent",
+ "data": {"percent": "aoeu"},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "nested refs",
+ "schema": {
+ "definitions": {
+ "a": {"type": "integer"},
+ "b": {"$ref": "#/definitions/a"},
+ "c": {"$ref": "#/definitions/b"}
+ },
+ "$ref": "#/definitions/c"
+ },
+ "tests": [
+ {
+ "description": "nested ref valid",
+ "data": 5,
+ "valid": true
+ },
+ {
+ "description": "nested ref invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json
new file mode 100644
index 000000000..4ca804732
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json
@@ -0,0 +1,74 @@
+[
+ {
+ "description": "remote ref",
+ "schema": {"$ref": "http://localhost:1234/integer.json"},
+ "tests": [
+ {
+ "description": "remote ref valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "remote ref invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "fragment within remote ref",
+ "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"},
+ "tests": [
+ {
+ "description": "remote fragment valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "remote fragment invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "ref within remote ref",
+ "schema": {
+ "$ref": "http://localhost:1234/subSchemas.json#/refToInteger"
+ },
+ "tests": [
+ {
+ "description": "ref within ref valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "ref within ref invalid",
+ "data": "a",
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "change resolution scope",
+ "schema": {
+ "id": "http://localhost:1234/",
+ "items": {
+ "id": "folder/",
+ "items": {"$ref": "folderInteger.json"}
+ }
+ },
+ "tests": [
+ {
+ "description": "changed scope ref valid",
+ "data": [[1]],
+ "valid": true
+ },
+ {
+ "description": "changed scope ref invalid",
+ "data": [["a"]],
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/required.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/required.json
new file mode 100644
index 000000000..612f73f34
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/required.json
@@ -0,0 +1,39 @@
+[
+ {
+ "description": "required validation",
+ "schema": {
+ "properties": {
+ "foo": {},
+ "bar": {}
+ },
+ "required": ["foo"]
+ },
+ "tests": [
+ {
+ "description": "present required property is valid",
+ "data": {"foo": 1},
+ "valid": true
+ },
+ {
+ "description": "non-present required property is invalid",
+ "data": {"bar": 1},
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "required default validation",
+ "schema": {
+ "properties": {
+ "foo": {}
+ }
+ },
+ "tests": [
+ {
+ "description": "not required by default",
+ "data": {},
+ "valid": true
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/type.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/type.json
new file mode 100644
index 000000000..257f05129
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/type.json
@@ -0,0 +1,330 @@
+[
+ {
+ "description": "integer type matches integers",
+ "schema": {"type": "integer"},
+ "tests": [
+ {
+ "description": "an integer is an integer",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "a float is not an integer",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not an integer",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not an integer",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not an integer",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not an integer",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not an integer",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "number type matches numbers",
+ "schema": {"type": "number"},
+ "tests": [
+ {
+ "description": "an integer is a number",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "a float is a number",
+ "data": 1.1,
+ "valid": true
+ },
+ {
+ "description": "a string is not a number",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not a number",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not a number",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not a number",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not a number",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "string type matches strings",
+ "schema": {"type": "string"},
+ "tests": [
+ {
+ "description": "1 is not a string",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not a string",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is a string",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "an object is not a string",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not a string",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not a string",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not a string",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "object type matches objects",
+ "schema": {"type": "object"},
+ "tests": [
+ {
+ "description": "an integer is not an object",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not an object",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not an object",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is an object",
+ "data": {},
+ "valid": true
+ },
+ {
+ "description": "an array is not an object",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not an object",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not an object",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "array type matches arrays",
+ "schema": {"type": "array"},
+ "tests": [
+ {
+ "description": "an integer is not an array",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not an array",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not an array",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not an array",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not an array",
+ "data": [],
+ "valid": true
+ },
+ {
+ "description": "a boolean is not an array",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is not an array",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "boolean type matches booleans",
+ "schema": {"type": "boolean"},
+ "tests": [
+ {
+ "description": "an integer is not a boolean",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not a boolean",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not a boolean",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not a boolean",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not a boolean",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not a boolean",
+ "data": true,
+ "valid": true
+ },
+ {
+ "description": "null is not a boolean",
+ "data": null,
+ "valid": false
+ }
+ ]
+ },
+ {
+ "description": "null type matches only the null object",
+ "schema": {"type": "null"},
+ "tests": [
+ {
+ "description": "an integer is not null",
+ "data": 1,
+ "valid": false
+ },
+ {
+ "description": "a float is not null",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "a string is not null",
+ "data": "foo",
+ "valid": false
+ },
+ {
+ "description": "an object is not null",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is not null",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is not null",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is null",
+ "data": null,
+ "valid": true
+ }
+ ]
+ },
+ {
+ "description": "multiple types can be specified in an array",
+ "schema": {"type": ["integer", "string"]},
+ "tests": [
+ {
+ "description": "an integer is valid",
+ "data": 1,
+ "valid": true
+ },
+ {
+ "description": "a string is valid",
+ "data": "foo",
+ "valid": true
+ },
+ {
+ "description": "a float is invalid",
+ "data": 1.1,
+ "valid": false
+ },
+ {
+ "description": "an object is invalid",
+ "data": {},
+ "valid": false
+ },
+ {
+ "description": "an array is invalid",
+ "data": [],
+ "valid": false
+ },
+ {
+ "description": "a boolean is invalid",
+ "data": true,
+ "valid": false
+ },
+ {
+ "description": "null is invalid",
+ "data": null,
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json
new file mode 100644
index 000000000..c1f4ab99c
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json
@@ -0,0 +1,79 @@
+[
+ {
+ "description": "uniqueItems validation",
+ "schema": {"uniqueItems": true},
+ "tests": [
+ {
+ "description": "unique array of integers is valid",
+ "data": [1, 2],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of integers is invalid",
+ "data": [1, 1],
+ "valid": false
+ },
+ {
+ "description": "numbers are unique if mathematically unequal",
+ "data": [1.0, 1.00, 1],
+ "valid": false
+ },
+ {
+ "description": "unique array of objects is valid",
+ "data": [{"foo": "bar"}, {"foo": "baz"}],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of objects is invalid",
+ "data": [{"foo": "bar"}, {"foo": "bar"}],
+ "valid": false
+ },
+ {
+ "description": "unique array of nested objects is valid",
+ "data": [
+ {"foo": {"bar" : {"baz" : true}}},
+ {"foo": {"bar" : {"baz" : false}}}
+ ],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of nested objects is invalid",
+ "data": [
+ {"foo": {"bar" : {"baz" : true}}},
+ {"foo": {"bar" : {"baz" : true}}}
+ ],
+ "valid": false
+ },
+ {
+ "description": "unique array of arrays is valid",
+ "data": [["foo"], ["bar"]],
+ "valid": true
+ },
+ {
+ "description": "non-unique array of arrays is invalid",
+ "data": [["foo"], ["foo"]],
+ "valid": false
+ },
+ {
+ "description": "1 and true are unique",
+ "data": [1, true],
+ "valid": true
+ },
+ {
+ "description": "0 and false are unique",
+ "data": [0, false],
+ "valid": true
+ },
+ {
+ "description": "unique heterogeneous types are valid",
+ "data": [{}, [1], true, null, 1],
+ "valid": true
+ },
+ {
+ "description": "non-unique heterogeneous types are invalid",
+ "data": [{}, [1], true, null, {}, 1],
+ "valid": false
+ }
+ ]
+ }
+]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema.js
new file mode 100644
index 000000000..e68a263a2
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema.js
@@ -0,0 +1,23 @@
+var tape = require('tape')
+var fs = require('fs')
+var validator = require('../')
+
+var files = fs.readdirSync(__dirname+'/json-schema-draft4')
+ .map(function(file) {
+ if (file === 'definitions.json') return null
+ if (file === 'refRemote.json') return null
+ return require('./json-schema-draft4/'+file)
+ })
+ .filter(Boolean)
+
+files.forEach(function(file) {
+ file.forEach(function(f) {
+ tape('json-schema-test-suite '+f.description, function(t) {
+ var validate = validator(f.schema)
+ f.tests.forEach(function(test) {
+ t.same(validate(test.data), test.valid, test.description)
+ })
+ t.end()
+ })
+ })
+})
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js
new file mode 100644
index 000000000..b5109e576
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js
@@ -0,0 +1,429 @@
+var tape = require('tape')
+var cosmic = require('./fixtures/cosmic')
+var validator = require('../')
+var validatorRequire = require('../require')
+
+tape('simple', function(t) {
+ var schema = {
+ required: true,
+ type: 'object',
+ properties: {
+ hello: {type:'string', required:true}
+ }
+ }
+
+ var validate = validator(schema)
+
+ t.ok(validate({hello: 'world'}), 'should be valid')
+ t.notOk(validate(), 'should be invalid')
+ t.notOk(validate({}), 'should be invalid')
+ t.end()
+})
+
+tape('advanced', function(t) {
+ var validate = validator(cosmic.schema)
+
+ t.ok(validate(cosmic.valid), 'should be valid')
+ t.notOk(validate(cosmic.invalid), 'should be invalid')
+ t.end()
+})
+
+tape('greedy/false', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ x: {
+ type: 'number'
+ }
+ },
+ required: ['x', 'y']
+ });
+ t.notOk(validate({}), 'should be invalid')
+ t.strictEqual(validate.errors.length, 2);
+ t.strictEqual(validate.errors[0].field, 'data.x')
+ t.strictEqual(validate.errors[0].message, 'is required')
+ t.strictEqual(validate.errors[1].field, 'data.y')
+ t.strictEqual(validate.errors[1].message, 'is required')
+ t.notOk(validate({x: 'string'}), 'should be invalid')
+ t.strictEqual(validate.errors.length, 1);
+ t.strictEqual(validate.errors[0].field, 'data.y')
+ t.strictEqual(validate.errors[0].message, 'is required')
+ t.notOk(validate({x: 'string', y: 'value'}), 'should be invalid')
+ t.strictEqual(validate.errors.length, 1);
+ t.strictEqual(validate.errors[0].field, 'data.x')
+ t.strictEqual(validate.errors[0].message, 'is the wrong type')
+ t.end();
+});
+
+tape('greedy/true', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ x: {
+ type: 'number'
+ }
+ },
+ required: ['x', 'y']
+ }, {
+ greedy: true
+ });
+ t.notOk(validate({}), 'should be invalid')
+ t.strictEqual(validate.errors.length, 2);
+ t.strictEqual(validate.errors[0].field, 'data.x')
+ t.strictEqual(validate.errors[0].message, 'is required')
+ t.strictEqual(validate.errors[1].field, 'data.y')
+ t.strictEqual(validate.errors[1].message, 'is required')
+ t.notOk(validate({x: 'string'}), 'should be invalid')
+ t.strictEqual(validate.errors.length, 2);
+ t.strictEqual(validate.errors[0].field, 'data.y')
+ t.strictEqual(validate.errors[0].message, 'is required')
+ t.strictEqual(validate.errors[1].field, 'data.x')
+ t.strictEqual(validate.errors[1].message, 'is the wrong type')
+ t.notOk(validate({x: 'string', y: 'value'}), 'should be invalid')
+ t.strictEqual(validate.errors.length, 1);
+ t.strictEqual(validate.errors[0].field, 'data.x')
+ t.strictEqual(validate.errors[0].message, 'is the wrong type')
+ t.ok(validate({x: 1, y: 'value'}), 'should be invalid')
+ t.end();
+});
+
+tape('additional props', function(t) {
+ var validate = validator({
+ type: 'object',
+ additionalProperties: false
+ }, {
+ verbose: true
+ })
+
+ t.ok(validate({}))
+ t.notOk(validate({foo:'bar'}))
+ t.ok(validate.errors[0].value === 'data.foo', 'should output the property not allowed in verbose mode')
+ t.end()
+})
+
+tape('array', function(t) {
+ var validate = validator({
+ type: 'array',
+ required: true,
+ items: {
+ type: 'string'
+ }
+ })
+
+ t.notOk(validate({}), 'wrong type')
+ t.notOk(validate(), 'is required')
+ t.ok(validate(['test']))
+ t.end()
+})
+
+tape('nested array', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ list: {
+ type: 'array',
+ required: true,
+ items: {
+ type: 'string'
+ }
+ }
+ }
+ })
+
+ t.notOk(validate({}), 'is required')
+ t.ok(validate({list:['test']}))
+ t.notOk(validate({list:[1]}))
+ t.end()
+})
+
+tape('enum', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ foo: {
+ type: 'number',
+ required: true,
+ enum: [42]
+ }
+ }
+ })
+
+ t.notOk(validate({}), 'is required')
+ t.ok(validate({foo:42}))
+ t.notOk(validate({foo:43}))
+ t.end()
+})
+
+tape('minimum/maximum', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ foo: {
+ type: 'number',
+ minimum: 0,
+ maximum: 0
+ }
+ }
+ })
+
+ t.notOk(validate({foo:-42}))
+ t.ok(validate({foo:0}))
+ t.notOk(validate({foo:42}))
+ t.end()
+})
+
+tape('exclusiveMinimum/exclusiveMaximum', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ foo: {
+ type: 'number',
+ minimum: 10,
+ maximum: 20,
+ exclusiveMinimum: true,
+ exclusiveMaximum: true
+ }
+ }
+ })
+
+ t.notOk(validate({foo:10}))
+ t.ok(validate({foo:11}))
+ t.notOk(validate({foo:20}))
+ t.ok(validate({foo:19}))
+ t.end()
+})
+
+tape('custom format', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ foo: {
+ type: 'string',
+ format: 'as'
+ }
+ }
+ }, {formats: {as:/^a+$/}})
+
+ t.notOk(validate({foo:''}), 'not as')
+ t.notOk(validate({foo:'b'}), 'not as')
+ t.notOk(validate({foo:'aaab'}), 'not as')
+ t.ok(validate({foo:'a'}), 'as')
+ t.ok(validate({foo:'aaaaaa'}), 'as')
+ t.end()
+})
+
+tape('custom format function', function(t) {
+ var validate = validator({
+ type: 'object',
+ properties: {
+ foo: {
+ type: 'string',
+ format: 'as'
+ }
+ }
+ }, {formats: {as:function(s) { return /^a+$/.test(s) } }})
+
+ t.notOk(validate({foo:''}), 'not as')
+ t.notOk(validate({foo:'b'}), 'not as')
+ t.notOk(validate({foo:'aaab'}), 'not as')
+ t.ok(validate({foo:'a'}), 'as')
+ t.ok(validate({foo:'aaaaaa'}), 'as')
+ t.end()
+})
+
+tape('do not mutate schema', function(t) {
+ var sch = {
+ items: [
+ {}
+ ],
+ additionalItems: {
+ type: 'integer'
+ }
+ }
+
+ var copy = JSON.parse(JSON.stringify(sch))
+
+ validator(sch)
+
+ t.same(sch, copy, 'did not mutate')
+ t.end()
+})
+
+tape('#toJSON()', function(t) {
+ var schema = {
+ required: true,
+ type: 'object',
+ properties: {
+ hello: {type:'string', required:true}
+ }
+ }
+
+ var validate = validator(schema)
+
+ t.deepEqual(validate.toJSON(), schema, 'should return original schema')
+ t.end()
+})
+
+tape('external schemas', function(t) {
+ var ext = {type: 'string'}
+ var schema = {
+ required: true,
+ $ref: '#ext'
+ }
+
+ var validate = validator(schema, {schemas: {ext:ext}})
+
+ t.ok(validate('hello string'), 'is a string')
+ t.notOk(validate(42), 'not a string')
+ t.end()
+})
+
+tape('top-level external schema', function(t) {
+ var defs = {
+ "string": {
+ type: "string"
+ },
+ "sex": {
+ type: "string",
+ enum: ["male", "female", "other"]
+ }
+ }
+ var schema = {
+ type: "object",
+ properties: {
+ "name": { $ref: "definitions.json#/string" },
+ "sex": { $ref: "definitions.json#/sex" }
+ },
+ required: ["name", "sex"]
+ }
+
+ var validate = validator(schema, {
+ schemas: {
+ "definitions.json": defs
+ }
+ })
+ t.ok(validate({name:"alice", sex:"female"}), 'is an object')
+ t.notOk(validate({name:"alice", sex: "bob"}), 'recognizes external schema')
+ t.notOk(validate({name:2, sex: "female"}), 'recognizes external schema')
+ t.end()
+})
+
+tape('nested required array decl', function(t) {
+ var schema = {
+ properties: {
+ x: {
+ type: 'object',
+ properties: {
+ y: {
+ type: 'object',
+ properties: {
+ z: {
+ type: 'string'
+ }
+ },
+ required: ['z']
+ }
+ }
+ }
+ },
+ required: ['x']
+ }
+
+ var validate = validator(schema)
+
+ t.ok(validate({x: {}}), 'should be valid')
+ t.notOk(validate({}), 'should not be valid')
+ t.strictEqual(validate.errors[0].field, 'data.x', 'should output the missing field')
+ t.end()
+})
+
+tape('verbose mode', function(t) {
+ var schema = {
+ required: true,
+ type: 'object',
+ properties: {
+ hello: {
+ required: true,
+ type: 'string'
+ }
+ }
+ };
+
+ var validate = validator(schema, {verbose: true})
+
+ t.ok(validate({hello: 'string'}), 'should be valid')
+ t.notOk(validate({hello: 100}), 'should not be valid')
+ t.strictEqual(validate.errors[0].value, 100, 'error object should contain the invalid value')
+ t.end()
+})
+
+tape('additional props in verbose mode', function(t) {
+ var schema = {
+ type: 'object',
+ required: true,
+ additionalProperties: false,
+ properties: {
+ foo: {
+ type: 'string'
+ },
+ 'hello world': {
+ type: 'object',
+ required: true,
+ additionalProperties: false,
+ properties: {
+ foo: {
+ type: 'string'
+ }
+ }
+ }
+ }
+ };
+
+ var validate = validator(schema, {verbose: true})
+
+ validate({'hello world': {bar: 'string'}});
+
+ t.strictEqual(validate.errors[0].value, 'data["hello world"].bar', 'should output the path to the additional prop in the error')
+ t.end()
+})
+
+tape('Date.now() is an integer', function(t) {
+ var schema = {type: 'integer'}
+ var validate = validator(schema)
+
+ t.ok(validate(Date.now()), 'is integer')
+ t.end()
+})
+
+tape('field shows item index in arrays', function(t) {
+ var schema = {
+ type: 'array',
+ items: {
+ type: 'array',
+ items: {
+ properties: {
+ foo: {
+ type: 'string',
+ required: true
+ }
+ }
+ }
+ }
+ }
+
+ var validate = validator(schema)
+
+ validate([
+ [
+ { foo: 'test' },
+ { foo: 'test' }
+ ],
+ [
+ { foo: 'test' },
+ { baz: 'test' }
+ ]
+ ])
+
+ t.strictEqual(validate.errors[0].field, 'data.1.1.foo', 'should output the field with specific index of failing item in the error')
+ t.end()
+})
diff --git a/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/index.js b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/index.js
new file mode 100644
index 000000000..cc64b902c
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/index.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = global.Promise || require('pinkie');
diff --git a/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/license b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/license
new file mode 100644
index 000000000..1aeb74fd2
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Vsevolod Strukchinsky <floatdrop@gmail.com> (github.com/floatdrop)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js
new file mode 100644
index 000000000..a7e3dc385
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js
@@ -0,0 +1,276 @@
+'use strict';
+
+var PENDING = 'pending';
+var SETTLED = 'settled';
+var FULFILLED = 'fulfilled';
+var REJECTED = 'rejected';
+var NOOP = function () {};
+
+// async calls
+var asyncSetTimer = typeof setImmediate !== 'undefined' ? setImmediate : setTimeout;
+var asyncQueue = [];
+var asyncTimer;
+
+function asyncFlush() {
+ // run promise callbacks
+ for (var i = 0; i < asyncQueue.length; i++) {
+ asyncQueue[i][0](asyncQueue[i][1]);
+ }
+
+ // reset async asyncQueue
+ asyncQueue = [];
+ asyncTimer = false;
+}
+
+function asyncCall(callback, arg) {
+ asyncQueue.push([callback, arg]);
+
+ if (!asyncTimer) {
+ asyncTimer = true;
+ asyncSetTimer(asyncFlush, 0);
+ }
+}
+
+function invokeResolver(resolver, promise) {
+ function resolvePromise(value) {
+ resolve(promise, value);
+ }
+
+ function rejectPromise(reason) {
+ reject(promise, reason);
+ }
+
+ try {
+ resolver(resolvePromise, rejectPromise);
+ } catch (e) {
+ rejectPromise(e);
+ }
+}
+
+function invokeCallback(subscriber) {
+ var owner = subscriber.owner;
+ var settled = owner._state;
+ var value = owner._data;
+ var callback = subscriber[settled];
+ var promise = subscriber.then;
+
+ if (typeof callback === 'function') {
+ settled = FULFILLED;
+ try {
+ value = callback(value);
+ } catch (e) {
+ reject(promise, e);
+ }
+ }
+
+ if (!handleThenable(promise, value)) {
+ if (settled === FULFILLED) {
+ resolve(promise, value);
+ }
+
+ if (settled === REJECTED) {
+ reject(promise, value);
+ }
+ }
+}
+
+function handleThenable(promise, value) {
+ var resolved;
+
+ try {
+ if (promise === value) {
+ throw new TypeError('A promises callback cannot return that same promise.');
+ }
+
+ if (value && (typeof value === 'function' || typeof value === 'object')) {
+ var then = value.then; // then should be retrived only once
+
+ if (typeof then === 'function') {
+ then.call(value, function (val) {
+ if (!resolved) {
+ resolved = true;
+
+ if (value !== val) {
+ resolve(promise, val);
+ } else {
+ fulfill(promise, val);
+ }
+ }
+ }, function (reason) {
+ if (!resolved) {
+ resolved = true;
+
+ reject(promise, reason);
+ }
+ });
+
+ return true;
+ }
+ }
+ } catch (e) {
+ if (!resolved) {
+ reject(promise, e);
+ }
+
+ return true;
+ }
+
+ return false;
+}
+
+function resolve(promise, value) {
+ if (promise === value || !handleThenable(promise, value)) {
+ fulfill(promise, value);
+ }
+}
+
+function fulfill(promise, value) {
+ if (promise._state === PENDING) {
+ promise._state = SETTLED;
+ promise._data = value;
+
+ asyncCall(publishFulfillment, promise);
+ }
+}
+
+function reject(promise, reason) {
+ if (promise._state === PENDING) {
+ promise._state = SETTLED;
+ promise._data = reason;
+
+ asyncCall(publishRejection, promise);
+ }
+}
+
+function publish(promise) {
+ promise._then = promise._then.forEach(invokeCallback);
+}
+
+function publishFulfillment(promise) {
+ promise._state = FULFILLED;
+ publish(promise);
+}
+
+function publishRejection(promise) {
+ promise._state = REJECTED;
+ publish(promise);
+}
+
+/**
+ * @class
+ */
+function Promise(resolver) {
+ if (typeof resolver !== 'function') {
+ throw new TypeError('Promise resolver ' + resolver + ' is not a function');
+ }
+
+ if (this instanceof Promise === false) {
+ throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.');
+ }
+
+ this._then = [];
+
+ invokeResolver(resolver, this);
+}
+
+Promise.prototype = {
+ constructor: Promise,
+
+ _state: PENDING,
+ _then: null,
+ _data: undefined,
+
+ then: function (onFulfillment, onRejection) {
+ var subscriber = {
+ owner: this,
+ then: new this.constructor(NOOP),
+ fulfilled: onFulfillment,
+ rejected: onRejection
+ };
+
+ if (this._state === FULFILLED || this._state === REJECTED) {
+ // already resolved, call callback async
+ asyncCall(invokeCallback, subscriber);
+ } else {
+ // subscribe
+ this._then.push(subscriber);
+ }
+
+ return subscriber.then;
+ },
+
+ 'catch': function (onRejection) {
+ return this.then(null, onRejection);
+ }
+};
+
+Promise.all = function (promises) {
+ if (!Array.isArray(promises)) {
+ throw new TypeError('You must pass an array to Promise.all().');
+ }
+
+ return new Promise(function (resolve, reject) {
+ var results = [];
+ var remaining = 0;
+
+ function resolver(index) {
+ remaining++;
+ return function (value) {
+ results[index] = value;
+ if (!--remaining) {
+ resolve(results);
+ }
+ };
+ }
+
+ for (var i = 0, promise; i < promises.length; i++) {
+ promise = promises[i];
+
+ if (promise && typeof promise.then === 'function') {
+ promise.then(resolver(i), reject);
+ } else {
+ results[i] = promise;
+ }
+ }
+
+ if (!remaining) {
+ resolve(results);
+ }
+ });
+};
+
+Promise.race = function (promises) {
+ if (!Array.isArray(promises)) {
+ throw new TypeError('You must pass an array to Promise.race().');
+ }
+
+ return new Promise(function (resolve, reject) {
+ for (var i = 0, promise; i < promises.length; i++) {
+ promise = promises[i];
+
+ if (promise && typeof promise.then === 'function') {
+ promise.then(resolve, reject);
+ } else {
+ resolve(promise);
+ }
+ }
+ });
+};
+
+Promise.resolve = function (value) {
+ if (value && typeof value === 'object' && value.constructor === Promise) {
+ return value;
+ }
+
+ return new Promise(function (resolve) {
+ resolve(value);
+ });
+};
+
+Promise.reject = function (reason) {
+ return new Promise(function (resolve, reject) {
+ reject(reason);
+ });
+};
+
+module.exports = Promise;
diff --git a/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/license b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/license
new file mode 100644
index 000000000..1aeb74fd2
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Vsevolod Strukchinsky <floatdrop@gmail.com> (github.com/floatdrop)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json
new file mode 100644
index 000000000..3a4c88269
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json
@@ -0,0 +1,43 @@
+{
+ "name": "pinkie",
+ "version": "1.0.0",
+ "description": "Itty bitty little wittle twinkie pinkie ES6 Promise implementation",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/floatdrop/pinkie.git"
+ },
+ "author": {
+ "name": "Vsevolod Strukchinsky",
+ "email": "floatdrop@gmail.com",
+ "url": "github.com/floatdrop"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "promise",
+ "es6"
+ ],
+ "dependencies": {},
+ "devDependencies": {
+ "mocha": "*",
+ "promises-aplus-tests": "*"
+ },
+ "readme": "<h1 align=\"center\">\n\t<br>\n\t<img width=\"300\" src=\"https://rawgit.com/floatdrop/pinkie/master/media/logo.png\" alt=\"pinkie\">\n\t<br>\n\t<br>\n</h1>\n\n> Itty bitty little wittle twinkie pinkie [ES6 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation\n\n[![Build Status](https://travis-ci.org/floatdrop/pinkie.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie)\n\nThere are [tons of Promise implementations](https://github.com/sorrycc/awesome-javascript#control-flow) out there, but all of them focused on browser compatibility and often bloated with functionality.\n\nThis module focused to be exactly Promise specification polyfill (like [native-promise-only](https://github.com/getify/native-promise-only)), but in NodeJS land (it should be browserify-able thou).\n\n\n## Install\n\n```\n$ npm install --save pinkie\n```\n\n\n## Usage\n\n```js\nvar Promise = require('pinkie');\n\nnew Promise(function (resolve, reject) {\n\tgot('google.com', function (err, data) {\n\t\tif (err) {\n\t\t\treturn reject(err);\n\t\t}\n\n\t\tresolve(data);\n\t});\n});\n//=> Promise\n```\n\n\n### API\n\n`pinkie` exports bare [ES6 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation. In case you forgot:\n\n#### new Promise(executor)\n\nReturns new instance of `Promise`.\n\n##### executor\n\n*Required* \nType: `function`\n\nFunction with two arguments resolve and reject. The first argument fulfills the promise, the second argument rejects it.\n\n#### pinkie.all(promises)\n\nReturns a promise that resolves when all of the promises in the `promises` Array argument have resolved.\n\n#### pinkie.race(promises)\n\nReturns a promise that resolves or rejects as soon as one of the promises in the `promises` Array resolves or rejects, with the value or reason from that promise.\n\n#### pinkie.reject(reason)\n\nReturns a Promise object that is rejected with the given `reason`.\n\n#### pinkie.resolve(value)\n\nReturns a Promise object that is resolved with the given `value`. If the `value` is a thenable (i.e. has a then method), the returned promise will \"follow\" that thenable, adopting its eventual state; otherwise the returned promise will be fulfilled with the `value`.\n\n## License\n\nMIT © [Vsevolod Strukchinsky](http://github.com/floatdrop)\n",
+ "readmeFilename": "readme.md",
+ "bugs": {
+ "url": "https://github.com/floatdrop/pinkie/issues"
+ },
+ "homepage": "https://github.com/floatdrop/pinkie#readme",
+ "_id": "pinkie@1.0.0",
+ "_shasum": "5a47f28ba1015d0201bda7bf0f358e47bec8c7e4",
+ "_resolved": "https://registry.npmjs.org/pinkie/-/pinkie-1.0.0.tgz",
+ "_from": "pinkie@>=1.0.0 <2.0.0"
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md
new file mode 100644
index 000000000..faa9b2b88
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md
@@ -0,0 +1,75 @@
+<h1 align="center">
+ <br>
+ <img width="300" src="https://rawgit.com/floatdrop/pinkie/master/media/logo.png" alt="pinkie">
+ <br>
+ <br>
+</h1>
+
+> Itty bitty little wittle twinkie pinkie [ES6 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation
+
+[![Build Status](https://travis-ci.org/floatdrop/pinkie.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie)
+
+There are [tons of Promise implementations](https://github.com/sorrycc/awesome-javascript#control-flow) out there, but all of them focused on browser compatibility and often bloated with functionality.
+
+This module focused to be exactly Promise specification polyfill (like [native-promise-only](https://github.com/getify/native-promise-only)), but in NodeJS land (it should be browserify-able thou).
+
+
+## Install
+
+```
+$ npm install --save pinkie
+```
+
+
+## Usage
+
+```js
+var Promise = require('pinkie');
+
+new Promise(function (resolve, reject) {
+ got('google.com', function (err, data) {
+ if (err) {
+ return reject(err);
+ }
+
+ resolve(data);
+ });
+});
+//=> Promise
+```
+
+
+### API
+
+`pinkie` exports bare [ES6 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation. In case you forgot:
+
+#### new Promise(executor)
+
+Returns new instance of `Promise`.
+
+##### executor
+
+*Required*
+Type: `function`
+
+Function with two arguments resolve and reject. The first argument fulfills the promise, the second argument rejects it.
+
+#### pinkie.all(promises)
+
+Returns a promise that resolves when all of the promises in the `promises` Array argument have resolved.
+
+#### pinkie.race(promises)
+
+Returns a promise that resolves or rejects as soon as one of the promises in the `promises` Array resolves or rejects, with the value or reason from that promise.
+
+#### pinkie.reject(reason)
+
+Returns a Promise object that is rejected with the given `reason`.
+
+#### pinkie.resolve(value)
+
+Returns a Promise object that is resolved with the given `value`. If the `value` is a thenable (i.e. has a then method), the returned promise will "follow" that thenable, adopting its eventual state; otherwise the returned promise will be fulfilled with the `value`.
+
+## License
+
+MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop)
diff --git a/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/package.json b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/package.json
new file mode 100644
index 000000000..bd4e66f8d
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/package.json
@@ -0,0 +1,46 @@
+{
+ "name": "pinkie-promise",
+ "version": "1.0.0",
+ "description": "ES6 Promise ponyfill",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/floatdrop/pinkie-promise.git"
+ },
+ "author": {
+ "name": "Vsevolod Strukchinsky",
+ "email": "floatdrop@gmail.com",
+ "url": "github.com/floatdrop"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "promise",
+ "es6",
+ "polyfill",
+ "ponyfill"
+ ],
+ "dependencies": {
+ "pinkie": "^1.0.0"
+ },
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "readme": "# pinkie-promise [![Build Status](https://travis-ci.org/floatdrop/pinkie-promise.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie-promise)\n\n> [ES6 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) ponyfill\n>\n> Ponyfill: A polyfill that doesn't overwrite the native method\n\nModule exports global Promise object (if available) or [`pinkie`](http://github.com/floatdrop/pinkie) Promise polyfill.\n\n## Install\n\n```\n$ npm install --save pinkie-promise\n```\n\n## Usage\n\n```js\nvar Promise = require('pinkie-promise');\n\nnew Promise(function (resolve) { resolve('unicorns'); });\n//=> Promise { 'unicorns' }\n```\n\n## License\n\nMIT © [Vsevolod Strukchinsky](http://github.com/floatdrop)\n",
+ "readmeFilename": "readme.md",
+ "bugs": {
+ "url": "https://github.com/floatdrop/pinkie-promise/issues"
+ },
+ "homepage": "https://github.com/floatdrop/pinkie-promise#readme",
+ "_id": "pinkie-promise@1.0.0",
+ "_shasum": "d1da67f5482563bb7cf57f286ae2822ecfbf3670",
+ "_resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-1.0.0.tgz",
+ "_from": "pinkie-promise@>=1.0.0 <2.0.0"
+}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/readme.md b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/readme.md
new file mode 100644
index 000000000..bb5e9d2e0
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/readme.md
@@ -0,0 +1,26 @@
+# pinkie-promise [![Build Status](https://travis-ci.org/floatdrop/pinkie-promise.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie-promise)
+
+> [ES6 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) ponyfill
+>
+> Ponyfill: A polyfill that doesn't overwrite the native method
+
+Module exports global Promise object (if available) or [`pinkie`](http://github.com/floatdrop/pinkie) Promise polyfill.
+
+## Install
+
+```
+$ npm install --save pinkie-promise
+```
+
+## Usage
+
+```js
+var Promise = require('pinkie-promise');
+
+new Promise(function (resolve) { resolve('unicorns'); });
+//=> Promise { 'unicorns' }
+```
+
+## License
+
+MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop)
diff --git a/node_modules/request/node_modules/har-validator/package.json b/node_modules/request/node_modules/har-validator/package.json
new file mode 100644
index 000000000..7892afc27
--- /dev/null
+++ b/node_modules/request/node_modules/har-validator/package.json
@@ -0,0 +1,88 @@
+{
+ "version": "2.0.2",
+ "name": "har-validator",
+ "description": "Extremely fast HTTP Archive (HAR) validator using JSON Schema",
+ "author": {
+ "name": "Ahmad Nassri",
+ "email": "ahmad@ahmadnassri.com",
+ "url": "https://www.ahmadnassri.com/"
+ },
+ "homepage": "https://github.com/ahmadnassri/har-validator",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/ahmadnassri/har-validator.git"
+ },
+ "license": "ISC",
+ "main": "lib/index",
+ "bin": {
+ "har-validator": "bin/har-validator"
+ },
+ "keywords": [
+ "har",
+ "http",
+ "archive",
+ "validate",
+ "validator"
+ ],
+ "engines": {
+ "node": ">=0.10"
+ },
+ "files": [
+ "bin",
+ "lib"
+ ],
+ "bugs": {
+ "url": "https://github.com/ahmadnassri/har-validator/issues"
+ },
+ "scripts": {
+ "pretest": "standard && echint",
+ "test": "mocha",
+ "posttest": "npm run coverage",
+ "coverage": "istanbul cover --dir coverage _mocha -- -R dot",
+ "codeclimate": "codeclimate < coverage/lcov.info"
+ },
+ "echint": {
+ "ignore": [
+ "coverage/**"
+ ]
+ },
+ "devDependencies": {
+ "codeclimate-test-reporter": "0.1.1",
+ "echint": "^1.5.0",
+ "istanbul": "^0.3.21",
+ "mocha": "^2.3.3",
+ "require-directory": "^2.1.1",
+ "should": "^7.1.0",
+ "should-promised": "^0.3.1",
+ "standard": "^5.3.1"
+ },
+ "dependencies": {
+ "chalk": "^1.1.1",
+ "commander": "^2.8.1",
+ "is-my-json-valid": "^2.12.2",
+ "pinkie-promise": "^1.0.0"
+ },
+ "gitHead": "46efd17253a81fb70614e904d9e766aa4de4f394",
+ "_id": "har-validator@2.0.2",
+ "_shasum": "233d0fa887b98a4f345969f811a2eec70d97aed7",
+ "_from": "har-validator@>=2.0.2 <2.1.0",
+ "_npmVersion": "2.14.4",
+ "_nodeVersion": "4.1.1",
+ "_npmUser": {
+ "name": "ahmadnassri",
+ "email": "ahmad@ahmadnassri.com"
+ },
+ "maintainers": [
+ {
+ "name": "ahmadnassri",
+ "email": "ahmad@ahmadnassri.com"
+ }
+ ],
+ "dist": {
+ "shasum": "233d0fa887b98a4f345969f811a2eec70d97aed7",
+ "tarball": "http://registry.npmjs.org/har-validator/-/har-validator-2.0.2.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.2.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/hawk/.npmignore b/node_modules/request/node_modules/hawk/.npmignore
new file mode 100644
index 000000000..96ed0910b
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/.npmignore
@@ -0,0 +1,20 @@
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+components
+build
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+
diff --git a/node_modules/request/node_modules/hawk/.travis.yml b/node_modules/request/node_modules/hawk/.travis.yml
new file mode 100755
index 000000000..40ca59eee
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/.travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+
+node_js:
+ - 0.10
+
diff --git a/node_modules/request/node_modules/hawk/LICENSE b/node_modules/request/node_modules/hawk/LICENSE
new file mode 100755
index 000000000..788093684
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/LICENSE
@@ -0,0 +1,28 @@
+Copyright (c) 2012-2014, Eran Hammer and other contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The names of any contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ * * *
+
+The complete list of contributors can be found at: https://github.com/hueniverse/hawk/graphs/contributors
diff --git a/node_modules/request/node_modules/hawk/README.md b/node_modules/request/node_modules/hawk/README.md
new file mode 100755
index 000000000..4aff23f3a
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/README.md
@@ -0,0 +1,634 @@
+![hawk Logo](https://raw.github.com/hueniverse/hawk/master/images/hawk.png)
+
+<img align="right" src="https://raw.github.com/hueniverse/hawk/master/images/logo.png" /> **Hawk** is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial
+HTTP request cryptographic verification. For more complex use cases such as access delegation, see [Oz](https://github.com/hueniverse/oz).
+
+Current version: **3.x**
+
+Note: 3.x and 2.x are the same exact protocol as 1.1. The version increments reflect changes in the node API.
+
+[![Build Status](https://secure.travis-ci.org/hueniverse/hawk.png)](http://travis-ci.org/hueniverse/hawk)
+
+# Table of Content
+
+- [**Introduction**](#introduction)
+ - [Replay Protection](#replay-protection)
+ - [Usage Example](#usage-example)
+ - [Protocol Example](#protocol-example)
+ - [Payload Validation](#payload-validation)
+ - [Response Payload Validation](#response-payload-validation)
+ - [Browser Support and Considerations](#browser-support-and-considerations)
+<p></p>
+- [**Single URI Authorization**](#single-uri-authorization)
+ - [Usage Example](#bewit-usage-example)
+<p></p>
+- [**Security Considerations**](#security-considerations)
+ - [MAC Keys Transmission](#mac-keys-transmission)
+ - [Confidentiality of Requests](#confidentiality-of-requests)
+ - [Spoofing by Counterfeit Servers](#spoofing-by-counterfeit-servers)
+ - [Plaintext Storage of Credentials](#plaintext-storage-of-credentials)
+ - [Entropy of Keys](#entropy-of-keys)
+ - [Coverage Limitations](#coverage-limitations)
+ - [Future Time Manipulation](#future-time-manipulation)
+ - [Client Clock Poisoning](#client-clock-poisoning)
+ - [Bewit Limitations](#bewit-limitations)
+ - [Host Header Forgery](#host-header-forgery)
+<p></p>
+- [**Frequently Asked Questions**](#frequently-asked-questions)
+<p></p>
+- [**Implementations**](#implementations)
+- [**Acknowledgements**](#acknowledgements)
+
+# Introduction
+
+**Hawk** is an HTTP authentication scheme providing mechanisms for making authenticated HTTP requests with
+partial cryptographic verification of the request and response, covering the HTTP method, request URI, host,
+and optionally the request payload.
+
+Similar to the HTTP [Digest access authentication schemes](http://www.ietf.org/rfc/rfc2617.txt), **Hawk** uses a set of
+client credentials which include an identifier (e.g. username) and key (e.g. password). Likewise, just as with the Digest scheme,
+the key is never included in authenticated requests. Instead, it is used to calculate a request MAC value which is
+included in its place.
+
+However, **Hawk** has several differences from Digest. In particular, while both use a nonce to limit the possibility of
+replay attacks, in **Hawk** the client generates the nonce and uses it in combination with a timestamp, leading to less
+"chattiness" (interaction with the server).
+
+Also unlike Digest, this scheme is not intended to protect the key itself (the password in Digest) because
+the client and server must both have access to the key material in the clear.
+
+The primary design goals of this scheme are to:
+* simplify and improve HTTP authentication for services that are unwilling or unable to deploy TLS for all resources,
+* secure credentials against leakage (e.g., when the client uses some form of dynamic configuration to determine where
+ to send an authenticated request), and
+* avoid the exposure of credentials sent to a malicious server over an unauthenticated secure channel due to client
+ failure to validate the server's identity as part of its TLS handshake.
+
+In addition, **Hawk** supports a method for granting third-parties temporary access to individual resources using
+a query parameter called _bewit_ (in falconry, a leather strap used to attach a tracking device to the leg of a hawk).
+
+The **Hawk** scheme requires the establishment of a shared symmetric key between the client and the server,
+which is beyond the scope of this module. Typically, the shared credentials are established via an initial
+TLS-protected phase or derived from some other shared confidential information available to both the client
+and the server.
+
+
+## Replay Protection
+
+Without replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more
+than once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when
+making requests. This gives the server enough information to prevent replay attacks.
+
+The nonce is generated by the client, and is a string unique across all requests with the same timestamp and
+key identifier combination.
+
+The timestamp enables the server to restrict the validity period of the credentials where requests occuring afterwards
+are rejected. It also removes the need for the server to retain an unbounded number of nonce values for future checks.
+By default, **Hawk** uses a time window of 1 minute to allow for time skew between the client and server (which in
+practice translates to a maximum of 2 minutes as the skew can be positive or negative).
+
+Using a timestamp requires the client's clock to be in sync with the server's clock. **Hawk** requires both the client
+clock and the server clock to use NTP to ensure synchronization. However, given the limitations of some client types
+(e.g. browsers) to deploy NTP, the server provides the client with its current time (in seconds precision) in response
+to a bad timestamp.
+
+There is no expectation that the client will adjust its system clock to match the server (in fact, this would be a
+potential attack vector). Instead, the client only uses the server's time to calculate an offset used only
+for communications with that particular server. The protocol rewards clients with synchronized clocks by reducing
+the number of round trips required to authenticate the first request.
+
+
+## Usage Example
+
+Server code:
+
+```javascript
+var Http = require('http');
+var Hawk = require('hawk');
+
+
+// Credentials lookup function
+
+var credentialsFunc = function (id, callback) {
+
+ var credentials = {
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'Steve'
+ };
+
+ return callback(null, credentials);
+};
+
+// Create HTTP server
+
+var handler = function (req, res) {
+
+ // Authenticate incoming request
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ // Prepare response
+
+ var payload = (!err ? 'Hello ' + credentials.user + ' ' + artifacts.ext : 'Shoosh!');
+ var headers = { 'Content-Type': 'text/plain' };
+
+ // Generate Server-Authorization response header
+
+ var header = Hawk.server.header(credentials, artifacts, { payload: payload, contentType: headers['Content-Type'] });
+ headers['Server-Authorization'] = header;
+
+ // Send the response back
+
+ res.writeHead(!err ? 200 : 401, headers);
+ res.end(payload);
+ });
+};
+
+// Start server
+
+Http.createServer(handler).listen(8000, 'example.com');
+```
+
+Client code:
+
+```javascript
+var Request = require('request');
+var Hawk = require('hawk');
+
+
+// Client credentials
+
+var credentials = {
+ id: 'dh37fgj492je',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256'
+}
+
+// Request options
+
+var requestOptions = {
+ uri: 'http://example.com:8000/resource/1?b=1&a=2',
+ method: 'GET',
+ headers: {}
+};
+
+// Generate Authorization request header
+
+var header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'GET', { credentials: credentials, ext: 'some-app-data' });
+requestOptions.headers.Authorization = header.field;
+
+// Send authenticated request
+
+Request(requestOptions, function (error, response, body) {
+
+ // Authenticate the server's response
+
+ var isValid = Hawk.client.authenticate(response, credentials, header.artifacts, { payload: body });
+
+ // Output results
+
+ console.log(response.statusCode + ': ' + body + (isValid ? ' (valid)' : ' (invalid)'));
+});
+```
+
+**Hawk** utilized the [**SNTP**](https://github.com/hueniverse/sntp) module for time sync management. By default, the local
+machine time is used. To automatically retrieve and synchronice the clock within the application, use the SNTP 'start()' method.
+
+```javascript
+Hawk.sntp.start();
+```
+
+
+## Protocol Example
+
+The client attempts to access a protected resource without authentication, sending the following HTTP request to
+the resource server:
+
+```
+GET /resource/1?b=1&a=2 HTTP/1.1
+Host: example.com:8000
+```
+
+The resource server returns an authentication challenge.
+
+```
+HTTP/1.1 401 Unauthorized
+WWW-Authenticate: Hawk
+```
+
+The client has previously obtained a set of **Hawk** credentials for accessing resources on the "http://example.com/"
+server. The **Hawk** credentials issued to the client include the following attributes:
+
+* Key identifier: dh37fgj492je
+* Key: werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn
+* Algorithm: sha256
+
+The client generates the authentication header by calculating a timestamp (e.g. the number of seconds since January 1,
+1970 00:00:00 GMT), generating a nonce, and constructing the normalized request string (each value followed by a newline
+character):
+
+```
+hawk.1.header
+1353832234
+j4h3g2
+GET
+/resource/1?b=1&a=2
+example.com
+8000
+
+some-app-ext-data
+
+```
+
+The request MAC is calculated using HMAC with the specified hash algorithm "sha256" and the key over the normalized request string.
+The result is base64-encoded to produce the request MAC:
+
+```
+6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE=
+```
+
+The client includes the **Hawk** key identifier, timestamp, nonce, application specific data, and request MAC with the request using
+the HTTP `Authorization` request header field:
+
+```
+GET /resource/1?b=1&a=2 HTTP/1.1
+Host: example.com:8000
+Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="
+```
+
+The server validates the request by calculating the request MAC again based on the request received and verifies the validity
+and scope of the **Hawk** credentials. If valid, the server responds with the requested resource.
+
+
+### Payload Validation
+
+**Hawk** provides optional payload validation. When generating the authentication header, the client calculates a payload hash
+using the specified hash algorithm. The hash is calculated over the concatenated value of (each followed by a newline character):
+* `hawk.1.payload`
+* the content-type in lowercase, without any parameters (e.g. `application/json`)
+* the request payload prior to any content encoding (the exact representation requirements should be specified by the server for payloads other than simple single-part ascii to ensure interoperability)
+
+For example:
+
+* Payload: `Thank you for flying Hawk`
+* Content Type: `text/plain`
+* Hash (sha256): `Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=`
+
+Results in the following input to the payload hash function (newline terminated values):
+
+```
+hawk.1.payload
+text/plain
+Thank you for flying Hawk
+
+```
+
+Which produces the following hash value:
+
+```
+Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=
+```
+
+The client constructs the normalized request string (newline terminated values):
+
+```
+hawk.1.header
+1353832234
+j4h3g2
+POST
+/resource/1?a=1&b=2
+example.com
+8000
+Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=
+some-app-ext-data
+
+```
+
+Then calculates the request MAC and includes the **Hawk** key identifier, timestamp, nonce, payload hash, application specific data,
+and request MAC, with the request using the HTTP `Authorization` request header field:
+
+```
+POST /resource/1?a=1&b=2 HTTP/1.1
+Host: example.com:8000
+Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", hash="Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=", ext="some-app-ext-data", mac="aSe1DERmZuRl3pI36/9BdZmnErTw3sNzOOAUlfeKjVw="
+```
+
+It is up to the server if and when it validates the payload for any given request, based solely on it's security policy
+and the nature of the data included.
+
+If the payload is available at the time of authentication, the server uses the hash value provided by the client to construct
+the normalized string and validates the MAC. If the MAC is valid, the server calculates the payload hash and compares the value
+with the provided payload hash in the header. In many cases, checking the MAC first is faster than calculating the payload hash.
+
+However, if the payload is not available at authentication time (e.g. too large to fit in memory, streamed elsewhere, or processed
+at a different stage in the application), the server may choose to defer payload validation for later by retaining the hash value
+provided by the client after validating the MAC.
+
+It is important to note that MAC validation does not mean the hash value provided by the client is valid, only that the value
+included in the header was not modified. Without calculating the payload hash on the server and comparing it to the value provided
+by the client, the payload may be modified by an attacker.
+
+
+## Response Payload Validation
+
+**Hawk** provides partial response payload validation. The server includes the `Server-Authorization` response header which enables the
+client to authenticate the response and ensure it is talking to the right server. **Hawk** defines the HTTP `Server-Authorization` header
+as a response header using the exact same syntax as the `Authorization` request header field.
+
+The header is contructed using the same process as the client's request header. The server uses the same credentials and other
+artifacts provided by the client to constructs the normalized request string. The `ext` and `hash` values are replaced with
+new values based on the server response. The rest as identical to those used by the client.
+
+The result MAC digest is included with the optional `hash` and `ext` values:
+
+```
+Server-Authorization: Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"
+```
+
+
+## Browser Support and Considerations
+
+A browser script is provided for including using a `<script>` tag in [lib/browser.js](/lib/browser.js). It's also a [component](http://component.io/hueniverse/hawk).
+
+**Hawk** relies on the _Server-Authorization_ and _WWW-Authenticate_ headers in its response to communicate with the client.
+Therefore, in case of CORS requests, it is important to consider sending _Access-Control-Expose-Headers_ with the value
+_"WWW-Authenticate, Server-Authorization"_ on each response from your server. As explained in the
+[specifications](http://www.w3.org/TR/cors/#access-control-expose-headers-response-header), it will indicate that these headers
+can safely be accessed by the client (using getResponseHeader() on the XmlHttpRequest object). Otherwise you will be met with a
+["simple response header"](http://www.w3.org/TR/cors/#simple-response-header) which excludes these fields and would prevent the
+Hawk client from authenticating the requests.You can read more about the why and how in this
+[article](http://www.html5rocks.com/en/tutorials/cors/#toc-adding-cors-support-to-the-server)
+
+
+# Single URI Authorization
+
+There are cases in which limited and short-term access to a protected resource is granted to a third party which does not
+have access to the shared credentials. For example, displaying a protected image on a web page accessed by anyone. **Hawk**
+provides limited support for such URIs in the form of a _bewit_ - a URI query parameter appended to the request URI which contains
+the necessary credentials to authenticate the request.
+
+Because of the significant security risks involved in issuing such access, bewit usage is purposely limited only to GET requests
+and for a finite period of time. Both the client and server can issue bewit credentials, however, the server should not use the same
+credentials as the client to maintain clear traceability as to who issued which credentials.
+
+In order to simplify implementation, bewit credentials do not support single-use policy and can be replayed multiple times within
+the granted access timeframe.
+
+
+## Bewit Usage Example
+
+Server code:
+
+```javascript
+var Http = require('http');
+var Hawk = require('hawk');
+
+
+// Credentials lookup function
+
+var credentialsFunc = function (id, callback) {
+
+ var credentials = {
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256'
+ };
+
+ return callback(null, credentials);
+};
+
+// Create HTTP server
+
+var handler = function (req, res) {
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ res.writeHead(!err ? 200 : 401, { 'Content-Type': 'text/plain' });
+ res.end(!err ? 'Access granted' : 'Shoosh!');
+ });
+};
+
+Http.createServer(handler).listen(8000, 'example.com');
+```
+
+Bewit code generation:
+
+```javascript
+var Request = require('request');
+var Hawk = require('hawk');
+
+
+// Client credentials
+
+var credentials = {
+ id: 'dh37fgj492je',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256'
+}
+
+// Generate bewit
+
+var duration = 60 * 5; // 5 Minutes
+var bewit = Hawk.uri.getBewit('http://example.com:8080/resource/1?b=1&a=2', { credentials: credentials, ttlSec: duration, ext: 'some-app-data' });
+var uri = 'http://example.com:8000/resource/1?b=1&a=2' + '&bewit=' + bewit;
+```
+
+
+# Security Considerations
+
+The greatest sources of security risks are usually found not in **Hawk** but in the policies and procedures surrounding its use.
+Implementers are strongly encouraged to assess how this module addresses their security requirements. This section includes
+an incomplete list of security considerations that must be reviewed and understood before deploying **Hawk** on the server.
+Many of the protections provided in **Hawk** depends on whether and how they are used.
+
+### MAC Keys Transmission
+
+**Hawk** does not provide any mechanism for obtaining or transmitting the set of shared credentials required. Any mechanism used
+to obtain **Hawk** credentials must ensure that these transmissions are protected using transport-layer mechanisms such as TLS.
+
+### Confidentiality of Requests
+
+While **Hawk** provides a mechanism for verifying the integrity of HTTP requests, it provides no guarantee of request
+confidentiality. Unless other precautions are taken, eavesdroppers will have full access to the request content. Servers should
+carefully consider the types of data likely to be sent as part of such requests, and employ transport-layer security mechanisms
+to protect sensitive resources.
+
+### Spoofing by Counterfeit Servers
+
+**Hawk** provides limited verification of the server authenticity. When receiving a response back from the server, the server
+may choose to include a response `Server-Authorization` header which the client can use to verify the response. However, it is up to
+the server to determine when such measure is included, to up to the client to enforce that policy.
+
+A hostile party could take advantage of this by intercepting the client's requests and returning misleading or otherwise
+incorrect responses. Service providers should consider such attacks when developing services using this protocol, and should
+require transport-layer security for any requests where the authenticity of the resource server or of server responses is an issue.
+
+### Plaintext Storage of Credentials
+
+The **Hawk** key functions the same way passwords do in traditional authentication systems. In order to compute the request MAC,
+the server must have access to the key in plaintext form. This is in contrast, for example, to modern operating systems, which
+store only a one-way hash of user credentials.
+
+If an attacker were to gain access to these keys - or worse, to the server's database of all such keys - he or she would be able
+to perform any action on behalf of any resource owner. Accordingly, it is critical that servers protect these keys from unauthorized
+access.
+
+### Entropy of Keys
+
+Unless a transport-layer security protocol is used, eavesdroppers will have full access to authenticated requests and request
+MAC values, and will thus be able to mount offline brute-force attacks to recover the key used. Servers should be careful to
+assign keys which are long enough, and random enough, to resist such attacks for at least the length of time that the **Hawk**
+credentials are valid.
+
+For example, if the credentials are valid for two weeks, servers should ensure that it is not possible to mount a brute force
+attack that recovers the key in less than two weeks. Of course, servers are urged to err on the side of caution, and use the
+longest key reasonable.
+
+It is equally important that the pseudo-random number generator (PRNG) used to generate these keys be of sufficiently high
+quality. Many PRNG implementations generate number sequences that may appear to be random, but which nevertheless exhibit
+patterns or other weaknesses which make cryptanalysis or brute force attacks easier. Implementers should be careful to use
+cryptographically secure PRNGs to avoid these problems.
+
+### Coverage Limitations
+
+The request MAC only covers the HTTP `Host` header and optionally the `Content-Type` header. It does not cover any other headers
+which can often affect how the request body is interpreted by the server. If the server behavior is influenced by the presence
+or value of such headers, an attacker can manipulate the request headers without being detected. Implementers should use the
+`ext` feature to pass application-specific information via the `Authorization` header which is protected by the request MAC.
+
+The response authentication, when performed, only covers the response payload, content-type, and the request information
+provided by the client in it's request (method, resource, timestamp, nonce, etc.). It does not cover the HTTP status code or
+any other response header field (e.g. Location) which can affect the client's behaviour.
+
+### Future Time Manipulation
+
+The protocol relies on a clock sync between the client and server. To accomplish this, the server informs the client of its
+current time when an invalid timestamp is received.
+
+If an attacker is able to manipulate this information and cause the client to use an incorrect time, it would be able to cause
+the client to generate authenticated requests using time in the future. Such requests will fail when sent by the client, and will
+not likely leave a trace on the server (given the common implementation of nonce, if at all enforced). The attacker will then
+be able to replay the request at the correct time without detection.
+
+The client must only use the time information provided by the server if:
+* it was delivered over a TLS connection and the server identity has been verified, or
+* the `tsm` MAC digest calculated using the same client credentials over the timestamp has been verified.
+
+### Client Clock Poisoning
+
+When receiving a request with a bad timestamp, the server provides the client with its current time. The client must never use
+the time received from the server to adjust its own clock, and must only use it to calculate an offset for communicating with
+that particular server.
+
+### Bewit Limitations
+
+Special care must be taken when issuing bewit credentials to third parties. Bewit credentials are valid until expiration and cannot
+be revoked or limited without using other means. Whatever resource they grant access to will be completely exposed to anyone with
+access to the bewit credentials which act as bearer credentials for that particular resource. While bewit usage is limited to GET
+requests only and therefore cannot be used to perform transactions or change server state, it can still be used to expose private
+and sensitive information.
+
+### Host Header Forgery
+
+Hawk validates the incoming request MAC against the incoming HTTP Host header. However, unless the optional `host` and `port`
+options are used with `server.authenticate()`, a malicous client can mint new host names pointing to the server's IP address and
+use that to craft an attack by sending a valid request that's meant for another hostname than the one used by the server. Server
+implementors must manually verify that the host header received matches their expectation (or use the options mentioned above).
+
+# Frequently Asked Questions
+
+### Where is the protocol specification?
+
+If you are looking for some prose explaining how all this works, **this is it**. **Hawk** is being developed as an open source
+project instead of a standard. In other words, the [code](/hueniverse/hawk/tree/master/lib) is the specification. Not sure about
+something? Open an issue!
+
+### Is it done?
+
+As of version 0.10.0, **Hawk** is feature-complete. However, until this module reaches version 1.0.0 it is considered experimental
+and is likely to change. This also means your feedback and contribution are very welcome. Feel free to open issues with questions
+and suggestions.
+
+### Where can I find **Hawk** implementations in other languages?
+
+**Hawk**'s only reference implementation is provided in JavaScript as a node.js module. However, it has been ported to other languages.
+The full list is maintained [here](https://github.com/hueniverse/hawk/issues?labels=port&state=closed). Please add an issue if you are
+working on another port. A cross-platform test-suite is in the works.
+
+### Why isn't the algorithm part of the challenge or dynamically negotiated?
+
+The algorithm used is closely related to the key issued as different algorithms require different key sizes (and other
+requirements). While some keys can be used for multiple algorithm, the protocol is designed to closely bind the key and algorithm
+together as part of the issued credentials.
+
+### Why is Host and Content-Type the only headers covered by the request MAC?
+
+It is really hard to include other headers. Headers can be changed by proxies and other intermediaries and there is no
+well-established way to normalize them. Many platforms change the case of header field names and values. The only
+straight-forward solution is to include the headers in some blob (say, base64 encoded JSON) and include that with the request,
+an approach taken by JWT and other such formats. However, that design violates the HTTP header boundaries, repeats information,
+and introduces other security issues because firewalls will not be aware of these "hidden" headers. In addition, any information
+repeated must be compared to the duplicated information in the header and therefore only moves the problem elsewhere.
+
+### Why not just use HTTP Digest?
+
+Digest requires pre-negotiation to establish a nonce. This means you can't just make a request - you must first send
+a protocol handshake to the server. This pattern has become unacceptable for most web services, especially mobile
+where extra round-trip are costly.
+
+### Why bother with all this nonce and timestamp business?
+
+**Hawk** is an attempt to find a reasonable, practical compromise between security and usability. OAuth 1.0 got timestamp
+and nonces halfway right but failed when it came to scalability and consistent developer experience. **Hawk** addresses
+it by requiring the client to sync its clock, but provides it with tools to accomplish it.
+
+In general, replay protection is a matter of application-specific threat model. It is less of an issue on a TLS-protected
+system where the clients are implemented using best practices and are under the control of the server. Instead of dropping
+replay protection, **Hawk** offers a required time window and an optional nonce verification. Together, it provides developers
+with the ability to decide how to enforce their security policy without impacting the client's implementation.
+
+### What are `app` and `dlg` in the authorization header and normalized mac string?
+
+The original motivation for **Hawk** was to replace the OAuth 1.0 use cases. This included both a simple client-server mode which
+this module is specifically designed for, and a delegated access mode which is being developed separately in
+[Oz](https://github.com/hueniverse/oz). In addition to the **Hawk** use cases, Oz requires another attribute: the application id `app`.
+This provides binding between the credentials and the application in a way that prevents an attacker from tricking an application
+to use credentials issued to someone else. It also has an optional 'delegated-by' attribute `dlg` which is the application id of the
+application the credentials were directly issued to. The goal of these two additions is to allow Oz to utilize **Hawk** directly,
+but with the additional security of delegated credentials.
+
+### What is the purpose of the static strings used in each normalized MAC input?
+
+When calculating a hash or MAC, a static prefix (tag) is added. The prefix is used to prevent MAC values from being
+used or reused for a purpose other than what they were created for (i.e. prevents switching MAC values between a request,
+response, and a bewit use cases). It also protects against exploits created after a potential change in how the protocol
+creates the normalized string. For example, if a future version would switch the order of nonce and timestamp, it
+can create an exploit opportunity for cases where the nonce is similar in format to a timestamp.
+
+### Does **Hawk** have anything to do with OAuth?
+
+Short answer: no.
+
+**Hawk** was originally proposed as the OAuth MAC Token specification. However, the OAuth working group in its consistent
+incompetence failed to produce a final, usable solution to address one of the most popular use cases of OAuth 1.0 - using it
+to authenticate simple client-server transactions (i.e. two-legged). As you can guess, the OAuth working group is still hard
+at work to produce more garbage.
+
+**Hawk** provides a simple HTTP authentication scheme for making client-server requests. It does not address the OAuth use case
+of delegating access to a third party. If you are looking for an OAuth alternative, check out [Oz](https://github.com/hueniverse/oz).
+
+# Implementations
+
+- [Logibit Hawk in F#/.Net](https://github.com/logibit/logibit.hawk/)
+- [Tent Hawk in Ruby](https://github.com/tent/hawk-ruby)
+- [Wealdtech in Java](https://github.com/wealdtech/hawk)
+- [Kumar's Mohawk in Python](https://github.com/kumar303/mohawk/)
+
+# Acknowledgements
+
+**Hawk** is a derivative work of the [HTTP MAC Authentication Scheme](http://tools.ietf.org/html/draft-hammer-oauth-v2-mac-token-05) proposal
+co-authored by Ben Adida, Adam Barth, and Eran Hammer, which in turn was based on the OAuth 1.0 community specification.
+
+Special thanks to Ben Laurie for his always insightful feedback and advice.
+
+The **Hawk** logo was created by [Chris Carrasco](http://chriscarrasco.com).
diff --git a/node_modules/request/node_modules/hawk/bower.json b/node_modules/request/node_modules/hawk/bower.json
new file mode 100644
index 000000000..7d2d120e0
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/bower.json
@@ -0,0 +1,24 @@
+{
+ "name": "hawk",
+ "main": "lib/browser.js",
+ "license": "./LICENSE",
+ "ignore": [
+ "!lib",
+ "lib/*",
+ "!lib/browser.js",
+ "index.js"
+ ],
+ "keywords": [
+ "http",
+ "authentication",
+ "scheme",
+ "hawk"
+ ],
+ "authors": [
+ "Eran Hammer <eran@hammer.io>"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/hueniverse/hawk.git"
+ }
+}
diff --git a/node_modules/request/node_modules/hawk/component.json b/node_modules/request/node_modules/hawk/component.json
new file mode 100644
index 000000000..63e76a2e3
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/component.json
@@ -0,0 +1,19 @@
+{
+ "name": "hawk",
+ "repo": "hueniverse/hawk",
+ "description": "HTTP Hawk Authentication Scheme",
+ "version": "1.0.0",
+ "keywords": [
+ "http",
+ "authentication",
+ "scheme",
+ "hawk"
+ ],
+ "dependencies": {},
+ "development": {},
+ "license": "BSD",
+ "main": "lib/browser.js",
+ "scripts": [
+ "lib/browser.js"
+ ]
+} \ No newline at end of file
diff --git a/node_modules/request/node_modules/hawk/example/usage.js b/node_modules/request/node_modules/hawk/example/usage.js
new file mode 100755
index 000000000..13b860b4c
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/example/usage.js
@@ -0,0 +1,78 @@
+// Load modules
+
+var Http = require('http');
+var Request = require('request');
+var Hawk = require('../lib');
+
+
+// Declare internals
+
+var internals = {
+ credentials: {
+ dh37fgj492je: {
+ id: 'dh37fgj492je', // Required by Hawk.client.header
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'Steve'
+ }
+ }
+};
+
+
+// Credentials lookup function
+
+var credentialsFunc = function (id, callback) {
+
+ return callback(null, internals.credentials[id]);
+};
+
+
+// Create HTTP server
+
+var handler = function (req, res) {
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ var payload = (!err ? 'Hello ' + credentials.user + ' ' + artifacts.ext : 'Shoosh!');
+ var headers = {
+ 'Content-Type': 'text/plain',
+ 'Server-Authorization': Hawk.server.header(credentials, artifacts, { payload: payload, contentType: 'text/plain' })
+ };
+
+ res.writeHead(!err ? 200 : 401, headers);
+ res.end(payload);
+ });
+};
+
+Http.createServer(handler).listen(8000, '127.0.0.1');
+
+
+// Send unauthenticated request
+
+Request('http://127.0.0.1:8000/resource/1?b=1&a=2', function (error, response, body) {
+
+ console.log(response.statusCode + ': ' + body);
+});
+
+
+// Send authenticated request
+
+credentialsFunc('dh37fgj492je', function (err, credentials) {
+
+ var header = Hawk.client.header('http://127.0.0.1:8000/resource/1?b=1&a=2', 'GET', { credentials: credentials, ext: 'and welcome!' });
+ var options = {
+ uri: 'http://127.0.0.1:8000/resource/1?b=1&a=2',
+ method: 'GET',
+ headers: {
+ authorization: header.field
+ }
+ };
+
+ Request(options, function (error, response, body) {
+
+ var isValid = Hawk.client.authenticate(response, credentials, header.artifacts, { payload: body });
+ console.log(response.statusCode + ': ' + body + (isValid ? ' (valid)' : ' (invalid)'));
+ process.exit(0);
+ });
+});
+
diff --git a/node_modules/request/node_modules/hawk/images/hawk.png b/node_modules/request/node_modules/hawk/images/hawk.png
new file mode 100755
index 000000000..a0e15cda0
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/images/hawk.png
Binary files differ
diff --git a/node_modules/request/node_modules/hawk/images/logo.png b/node_modules/request/node_modules/hawk/images/logo.png
new file mode 100755
index 000000000..b8ff59017
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/images/logo.png
Binary files differ
diff --git a/node_modules/request/node_modules/hawk/lib/browser.js b/node_modules/request/node_modules/hawk/lib/browser.js
new file mode 100755
index 000000000..7ccacf613
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/lib/browser.js
@@ -0,0 +1,643 @@
+/*
+ HTTP Hawk Authentication Scheme
+ Copyright (c) 2012-2014, Eran Hammer <eran@hammer.io>
+ BSD Licensed
+*/
+
+
+// Declare namespace
+
+var hawk = {
+ internals: {}
+};
+
+
+hawk.client = {
+
+ // Generate an Authorization header for a given request
+
+ /*
+ uri: 'http://example.com/resource?a=b' or object generated by hawk.utils.parseUri()
+ method: HTTP verb (e.g. 'GET', 'POST')
+ options: {
+
+ // Required
+
+ credentials: {
+ id: 'dh37fgj492je',
+ key: 'aoijedoaijsdlaksjdl',
+ algorithm: 'sha256' // 'sha1', 'sha256'
+ },
+
+ // Optional
+
+ ext: 'application-specific', // Application specific data sent via the ext attribute
+ timestamp: Date.now() / 1000, // A pre-calculated timestamp in seconds
+ nonce: '2334f34f', // A pre-generated nonce
+ localtimeOffsetMsec: 400, // Time offset to sync with server time (ignored if timestamp provided)
+ payload: '{"some":"payload"}', // UTF-8 encoded string for body hash generation (ignored if hash provided)
+ contentType: 'application/json', // Payload content-type (ignored if hash provided)
+ hash: 'U4MKKSmiVxk37JCCrAVIjV=', // Pre-calculated payload hash
+ app: '24s23423f34dx', // Oz application id
+ dlg: '234sz34tww3sd' // Oz delegated-by application id
+ }
+ */
+
+ header: function (uri, method, options) {
+
+ var result = {
+ field: '',
+ artifacts: {}
+ };
+
+ // Validate inputs
+
+ if (!uri || (typeof uri !== 'string' && typeof uri !== 'object') ||
+ !method || typeof method !== 'string' ||
+ !options || typeof options !== 'object') {
+
+ result.err = 'Invalid argument type';
+ return result;
+ }
+
+ // Application time
+
+ var timestamp = options.timestamp || hawk.utils.now(options.localtimeOffsetMsec);
+
+ // Validate credentials
+
+ var credentials = options.credentials;
+ if (!credentials ||
+ !credentials.id ||
+ !credentials.key ||
+ !credentials.algorithm) {
+
+ result.err = 'Invalid credentials object';
+ return result;
+ }
+
+ if (hawk.crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ result.err = 'Unknown algorithm';
+ return result;
+ }
+
+ // Parse URI
+
+ if (typeof uri === 'string') {
+ uri = hawk.utils.parseUri(uri);
+ }
+
+ // Calculate signature
+
+ var artifacts = {
+ ts: timestamp,
+ nonce: options.nonce || hawk.utils.randomString(6),
+ method: method,
+ resource: uri.relative,
+ host: uri.hostname,
+ port: uri.port,
+ hash: options.hash,
+ ext: options.ext,
+ app: options.app,
+ dlg: options.dlg
+ };
+
+ result.artifacts = artifacts;
+
+ // Calculate payload hash
+
+ if (!artifacts.hash &&
+ (options.payload || options.payload === '')) {
+
+ artifacts.hash = hawk.crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
+ }
+
+ var mac = hawk.crypto.calculateMac('header', credentials, artifacts);
+
+ // Construct header
+
+ var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''; // Other falsey values allowed
+ var header = 'Hawk id="' + credentials.id +
+ '", ts="' + artifacts.ts +
+ '", nonce="' + artifacts.nonce +
+ (artifacts.hash ? '", hash="' + artifacts.hash : '') +
+ (hasExt ? '", ext="' + hawk.utils.escapeHeaderAttribute(artifacts.ext) : '') +
+ '", mac="' + mac + '"';
+
+ if (artifacts.app) {
+ header += ', app="' + artifacts.app +
+ (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"';
+ }
+
+ result.field = header;
+
+ return result;
+ },
+
+ // Generate a bewit value for a given URI
+
+ /*
+ uri: 'http://example.com/resource?a=b'
+ options: {
+
+ // Required
+
+ credentials: {
+ id: 'dh37fgj492je',
+ key: 'aoijedoaijsdlaksjdl',
+ algorithm: 'sha256' // 'sha1', 'sha256'
+ },
+ ttlSec: 60 * 60, // TTL in seconds
+
+ // Optional
+
+ ext: 'application-specific', // Application specific data sent via the ext attribute
+ localtimeOffsetMsec: 400 // Time offset to sync with server time
+ };
+ */
+
+ bewit: function (uri, options) {
+
+ // Validate inputs
+
+ if (!uri ||
+ (typeof uri !== 'string') ||
+ !options ||
+ typeof options !== 'object' ||
+ !options.ttlSec) {
+
+ return '';
+ }
+
+ options.ext = (options.ext === null || options.ext === undefined ? '' : options.ext); // Zero is valid value
+
+ // Application time
+
+ var now = hawk.utils.now(options.localtimeOffsetMsec);
+
+ // Validate credentials
+
+ var credentials = options.credentials;
+ if (!credentials ||
+ !credentials.id ||
+ !credentials.key ||
+ !credentials.algorithm) {
+
+ return '';
+ }
+
+ if (hawk.crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return '';
+ }
+
+ // Parse URI
+
+ uri = hawk.utils.parseUri(uri);
+
+ // Calculate signature
+
+ var exp = now + options.ttlSec;
+ var mac = hawk.crypto.calculateMac('bewit', credentials, {
+ ts: exp,
+ nonce: '',
+ method: 'GET',
+ resource: uri.relative, // Maintain trailing '?' and query params
+ host: uri.hostname,
+ port: uri.port,
+ ext: options.ext
+ });
+
+ // Construct bewit: id\exp\mac\ext
+
+ var bewit = credentials.id + '\\' + exp + '\\' + mac + '\\' + options.ext;
+ return hawk.utils.base64urlEncode(bewit);
+ },
+
+ // Validate server response
+
+ /*
+ request: object created via 'new XMLHttpRequest()' after response received
+ artifacts: object received from header().artifacts
+ options: {
+ payload: optional payload received
+ required: specifies if a Server-Authorization header is required. Defaults to 'false'
+ }
+ */
+
+ authenticate: function (request, credentials, artifacts, options) {
+
+ options = options || {};
+
+ var getHeader = function (name) {
+
+ return request.getResponseHeader ? request.getResponseHeader(name) : request.getHeader(name);
+ };
+
+ var wwwAuthenticate = getHeader('www-authenticate');
+ if (wwwAuthenticate) {
+
+ // Parse HTTP WWW-Authenticate header
+
+ var wwwAttributes = hawk.utils.parseAuthorizationHeader(wwwAuthenticate, ['ts', 'tsm', 'error']);
+ if (!wwwAttributes) {
+ return false;
+ }
+
+ if (wwwAttributes.ts) {
+ var tsm = hawk.crypto.calculateTsMac(wwwAttributes.ts, credentials);
+ if (tsm !== wwwAttributes.tsm) {
+ return false;
+ }
+
+ hawk.utils.setNtpOffset(wwwAttributes.ts - Math.floor((new Date()).getTime() / 1000)); // Keep offset at 1 second precision
+ }
+ }
+
+ // Parse HTTP Server-Authorization header
+
+ var serverAuthorization = getHeader('server-authorization');
+ if (!serverAuthorization &&
+ !options.required) {
+
+ return true;
+ }
+
+ var attributes = hawk.utils.parseAuthorizationHeader(serverAuthorization, ['mac', 'ext', 'hash']);
+ if (!attributes) {
+ return false;
+ }
+
+ var modArtifacts = {
+ ts: artifacts.ts,
+ nonce: artifacts.nonce,
+ method: artifacts.method,
+ resource: artifacts.resource,
+ host: artifacts.host,
+ port: artifacts.port,
+ hash: attributes.hash,
+ ext: attributes.ext,
+ app: artifacts.app,
+ dlg: artifacts.dlg
+ };
+
+ var mac = hawk.crypto.calculateMac('response', credentials, modArtifacts);
+ if (mac !== attributes.mac) {
+ return false;
+ }
+
+ if (!options.payload &&
+ options.payload !== '') {
+
+ return true;
+ }
+
+ if (!attributes.hash) {
+ return false;
+ }
+
+ var calculatedHash = hawk.crypto.calculatePayloadHash(options.payload, credentials.algorithm, getHeader('content-type'));
+ return (calculatedHash === attributes.hash);
+ },
+
+ message: function (host, port, message, options) {
+
+ // Validate inputs
+
+ if (!host || typeof host !== 'string' ||
+ !port || typeof port !== 'number' ||
+ message === null || message === undefined || typeof message !== 'string' ||
+ !options || typeof options !== 'object') {
+
+ return null;
+ }
+
+ // Application time
+
+ var timestamp = options.timestamp || hawk.utils.now(options.localtimeOffsetMsec);
+
+ // Validate credentials
+
+ var credentials = options.credentials;
+ if (!credentials ||
+ !credentials.id ||
+ !credentials.key ||
+ !credentials.algorithm) {
+
+ // Invalid credential object
+ return null;
+ }
+
+ if (hawk.crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return null;
+ }
+
+ // Calculate signature
+
+ var artifacts = {
+ ts: timestamp,
+ nonce: options.nonce || hawk.utils.randomString(6),
+ host: host,
+ port: port,
+ hash: hawk.crypto.calculatePayloadHash(message, credentials.algorithm)
+ };
+
+ // Construct authorization
+
+ var result = {
+ id: credentials.id,
+ ts: artifacts.ts,
+ nonce: artifacts.nonce,
+ hash: artifacts.hash,
+ mac: hawk.crypto.calculateMac('message', credentials, artifacts)
+ };
+
+ return result;
+ },
+
+ authenticateTimestamp: function (message, credentials, updateClock) { // updateClock defaults to true
+
+ var tsm = hawk.crypto.calculateTsMac(message.ts, credentials);
+ if (tsm !== message.tsm) {
+ return false;
+ }
+
+ if (updateClock !== false) {
+ hawk.utils.setNtpOffset(message.ts - Math.floor((new Date()).getTime() / 1000)); // Keep offset at 1 second precision
+ }
+
+ return true;
+ }
+};
+
+
+hawk.crypto = {
+
+ headerVersion: '1',
+
+ algorithms: ['sha1', 'sha256'],
+
+ calculateMac: function (type, credentials, options) {
+
+ var normalized = hawk.crypto.generateNormalizedString(type, options);
+
+ var hmac = CryptoJS['Hmac' + credentials.algorithm.toUpperCase()](normalized, credentials.key);
+ return hmac.toString(CryptoJS.enc.Base64);
+ },
+
+ generateNormalizedString: function (type, options) {
+
+ var normalized = 'hawk.' + hawk.crypto.headerVersion + '.' + type + '\n' +
+ options.ts + '\n' +
+ options.nonce + '\n' +
+ (options.method || '').toUpperCase() + '\n' +
+ (options.resource || '') + '\n' +
+ options.host.toLowerCase() + '\n' +
+ options.port + '\n' +
+ (options.hash || '') + '\n';
+
+ if (options.ext) {
+ normalized += options.ext.replace('\\', '\\\\').replace('\n', '\\n');
+ }
+
+ normalized += '\n';
+
+ if (options.app) {
+ normalized += options.app + '\n' +
+ (options.dlg || '') + '\n';
+ }
+
+ return normalized;
+ },
+
+ calculatePayloadHash: function (payload, algorithm, contentType) {
+
+ var hash = CryptoJS.algo[algorithm.toUpperCase()].create();
+ hash.update('hawk.' + hawk.crypto.headerVersion + '.payload\n');
+ hash.update(hawk.utils.parseContentType(contentType) + '\n');
+ hash.update(payload);
+ hash.update('\n');
+ return hash.finalize().toString(CryptoJS.enc.Base64);
+ },
+
+ calculateTsMac: function (ts, credentials) {
+
+ var hash = CryptoJS['Hmac' + credentials.algorithm.toUpperCase()]('hawk.' + hawk.crypto.headerVersion + '.ts\n' + ts + '\n', credentials.key);
+ return hash.toString(CryptoJS.enc.Base64);
+ }
+};
+
+
+// localStorage compatible interface
+
+hawk.internals.LocalStorage = function () {
+
+ this._cache = {};
+ this.length = 0;
+
+ this.getItem = function (key) {
+
+ return this._cache.hasOwnProperty(key) ? String(this._cache[key]) : null;
+ };
+
+ this.setItem = function (key, value) {
+
+ this._cache[key] = String(value);
+ this.length = Object.keys(this._cache).length;
+ };
+
+ this.removeItem = function (key) {
+
+ delete this._cache[key];
+ this.length = Object.keys(this._cache).length;
+ };
+
+ this.clear = function () {
+
+ this._cache = {};
+ this.length = 0;
+ };
+
+ this.key = function (i) {
+
+ return Object.keys(this._cache)[i || 0];
+ };
+};
+
+
+hawk.utils = {
+
+ storage: new hawk.internals.LocalStorage(),
+
+ setStorage: function (storage) {
+
+ var ntpOffset = hawk.utils.storage.getItem('hawk_ntp_offset');
+ hawk.utils.storage = storage;
+ if (ntpOffset) {
+ hawk.utils.setNtpOffset(ntpOffset);
+ }
+ },
+
+ setNtpOffset: function (offset) {
+
+ try {
+ hawk.utils.storage.setItem('hawk_ntp_offset', offset);
+ }
+ catch (err) {
+ console.error('[hawk] could not write to storage.');
+ console.error(err);
+ }
+ },
+
+ getNtpOffset: function () {
+
+ var offset = hawk.utils.storage.getItem('hawk_ntp_offset');
+ if (!offset) {
+ return 0;
+ }
+
+ return parseInt(offset, 10);
+ },
+
+ now: function (localtimeOffsetMsec) {
+
+ return Math.floor(((new Date()).getTime() + (localtimeOffsetMsec || 0)) / 1000) + hawk.utils.getNtpOffset();
+ },
+
+ escapeHeaderAttribute: function (attribute) {
+
+ return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"');
+ },
+
+ parseContentType: function (header) {
+
+ if (!header) {
+ return '';
+ }
+
+ return header.split(';')[0].replace(/^\s+|\s+$/g, '').toLowerCase();
+ },
+
+ parseAuthorizationHeader: function (header, keys) {
+
+ if (!header) {
+ return null;
+ }
+
+ var headerParts = header.match(/^(\w+)(?:\s+(.*))?$/); // Header: scheme[ something]
+ if (!headerParts) {
+ return null;
+ }
+
+ var scheme = headerParts[1];
+ if (scheme.toLowerCase() !== 'hawk') {
+ return null;
+ }
+
+ var attributesString = headerParts[2];
+ if (!attributesString) {
+ return null;
+ }
+
+ var attributes = {};
+ var verify = attributesString.replace(/(\w+)="([^"\\]*)"\s*(?:,\s*|$)/g, function ($0, $1, $2) {
+
+ // Check valid attribute names
+
+ if (keys.indexOf($1) === -1) {
+ return;
+ }
+
+ // Allowed attribute value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9
+
+ if ($2.match(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~]+$/) === null) {
+ return;
+ }
+
+ // Check for duplicates
+
+ if (attributes.hasOwnProperty($1)) {
+ return;
+ }
+
+ attributes[$1] = $2;
+ return '';
+ });
+
+ if (verify !== '') {
+ return null;
+ }
+
+ return attributes;
+ },
+
+ randomString: function (size) {
+
+ var randomSource = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
+ var len = randomSource.length;
+
+ var result = [];
+ for (var i = 0; i < size; ++i) {
+ result[i] = randomSource[Math.floor(Math.random() * len)];
+ }
+
+ return result.join('');
+ },
+
+ parseUri: function (input) {
+
+ // Based on: parseURI 1.2.2
+ // http://blog.stevenlevithan.com/archives/parseuri
+ // (c) Steven Levithan <stevenlevithan.com>
+ // MIT License
+
+ var keys = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'hostname', 'port', 'resource', 'relative', 'pathname', 'directory', 'file', 'query', 'fragment'];
+
+ var uriRegex = /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?)(?:#(.*))?)/;
+ var uriByNumber = input.match(uriRegex);
+ var uri = {};
+
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ uri[keys[i]] = uriByNumber[i] || '';
+ }
+
+ if (uri.port === '') {
+ uri.port = (uri.protocol.toLowerCase() === 'http' ? '80' : (uri.protocol.toLowerCase() === 'https' ? '443' : ''));
+ }
+
+ return uri;
+ },
+
+ base64urlEncode: function (value) {
+
+ var wordArray = CryptoJS.enc.Utf8.parse(value);
+ var encoded = CryptoJS.enc.Base64.stringify(wordArray);
+ return encoded.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
+ }
+};
+
+
+// $lab:coverage:off$
+/* eslint-disable */
+
+// Based on: Crypto-JS v3.1.2
+// Copyright (c) 2009-2013, Jeff Mott. All rights reserved.
+// http://code.google.com/p/crypto-js/
+// http://code.google.com/p/crypto-js/wiki/License
+
+var CryptoJS = CryptoJS || function (h, r) { var k = {}, l = k.lib = {}, n = function () { }, f = l.Base = { extend: function (a) { n.prototype = this; var b = new n; a && b.mixIn(a); b.hasOwnProperty("init") || (b.init = function () { b.$super.init.apply(this, arguments) }); b.init.prototype = b; b.$super = this; return b }, create: function () { var a = this.extend(); a.init.apply(a, arguments); return a }, init: function () { }, mixIn: function (a) { for (var b in a) a.hasOwnProperty(b) && (this[b] = a[b]); a.hasOwnProperty("toString") && (this.toString = a.toString) }, clone: function () { return this.init.prototype.extend(this) } }, j = l.WordArray = f.extend({ init: function (a, b) { a = this.words = a || []; this.sigBytes = b != r ? b : 4 * a.length }, toString: function (a) { return (a || s).stringify(this) }, concat: function (a) { var b = this.words, d = a.words, c = this.sigBytes; a = a.sigBytes; this.clamp(); if (c % 4) for (var e = 0; e < a; e++) b[c + e >>> 2] |= (d[e >>> 2] >>> 24 - 8 * (e % 4) & 255) << 24 - 8 * ((c + e) % 4); else if (65535 < d.length) for (e = 0; e < a; e += 4) b[c + e >>> 2] = d[e >>> 2]; else b.push.apply(b, d); this.sigBytes += a; return this }, clamp: function () { var a = this.words, b = this.sigBytes; a[b >>> 2] &= 4294967295 << 32 - 8 * (b % 4); a.length = h.ceil(b / 4) }, clone: function () { var a = f.clone.call(this); a.words = this.words.slice(0); return a }, random: function (a) { for (var b = [], d = 0; d < a; d += 4) b.push(4294967296 * h.random() | 0); return new j.init(b, a) } }), m = k.enc = {}, s = m.Hex = { stringify: function (a) { var b = a.words; a = a.sigBytes; for (var d = [], c = 0; c < a; c++) { var e = b[c >>> 2] >>> 24 - 8 * (c % 4) & 255; d.push((e >>> 4).toString(16)); d.push((e & 15).toString(16)) } return d.join("") }, parse: function (a) { for (var b = a.length, d = [], c = 0; c < b; c += 2) d[c >>> 3] |= parseInt(a.substr(c, 2), 16) << 24 - 4 * (c % 8); return new j.init(d, b / 2) } }, p = m.Latin1 = { stringify: function (a) { var b = a.words; a = a.sigBytes; for (var d = [], c = 0; c < a; c++) d.push(String.fromCharCode(b[c >>> 2] >>> 24 - 8 * (c % 4) & 255)); return d.join("") }, parse: function (a) { for (var b = a.length, d = [], c = 0; c < b; c++) d[c >>> 2] |= (a.charCodeAt(c) & 255) << 24 - 8 * (c % 4); return new j.init(d, b) } }, t = m.Utf8 = { stringify: function (a) { try { return decodeURIComponent(escape(p.stringify(a))) } catch (b) { throw Error("Malformed UTF-8 data"); } }, parse: function (a) { return p.parse(unescape(encodeURIComponent(a))) } }, q = l.BufferedBlockAlgorithm = f.extend({ reset: function () { this._data = new j.init; this._nDataBytes = 0 }, _append: function (a) { "string" == typeof a && (a = t.parse(a)); this._data.concat(a); this._nDataBytes += a.sigBytes }, _process: function (a) { var b = this._data, d = b.words, c = b.sigBytes, e = this.blockSize, f = c / (4 * e), f = a ? h.ceil(f) : h.max((f | 0) - this._minBufferSize, 0); a = f * e; c = h.min(4 * a, c); if (a) { for (var g = 0; g < a; g += e) this._doProcessBlock(d, g); g = d.splice(0, a); b.sigBytes -= c } return new j.init(g, c) }, clone: function () { var a = f.clone.call(this); a._data = this._data.clone(); return a }, _minBufferSize: 0 }); l.Hasher = q.extend({ cfg: f.extend(), init: function (a) { this.cfg = this.cfg.extend(a); this.reset() }, reset: function () { q.reset.call(this); this._doReset() }, update: function (a) { this._append(a); this._process(); return this }, finalize: function (a) { a && this._append(a); return this._doFinalize() }, blockSize: 16, _createHelper: function (a) { return function (b, d) { return (new a.init(d)).finalize(b) } }, _createHmacHelper: function (a) { return function (b, d) { return (new u.HMAC.init(a, d)).finalize(b) } } }); var u = k.algo = {}; return k }(Math);
+(function () { var k = CryptoJS, b = k.lib, m = b.WordArray, l = b.Hasher, d = [], b = k.algo.SHA1 = l.extend({ _doReset: function () { this._hash = new m.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]) }, _doProcessBlock: function (n, p) { for (var a = this._hash.words, e = a[0], f = a[1], h = a[2], j = a[3], b = a[4], c = 0; 80 > c; c++) { if (16 > c) d[c] = n[p + c] | 0; else { var g = d[c - 3] ^ d[c - 8] ^ d[c - 14] ^ d[c - 16]; d[c] = g << 1 | g >>> 31 } g = (e << 5 | e >>> 27) + b + d[c]; g = 20 > c ? g + ((f & h | ~f & j) + 1518500249) : 40 > c ? g + ((f ^ h ^ j) + 1859775393) : 60 > c ? g + ((f & h | f & j | h & j) - 1894007588) : g + ((f ^ h ^ j) - 899497514); b = j; j = h; h = f << 30 | f >>> 2; f = e; e = g } a[0] = a[0] + e | 0; a[1] = a[1] + f | 0; a[2] = a[2] + h | 0; a[3] = a[3] + j | 0; a[4] = a[4] + b | 0 }, _doFinalize: function () { var b = this._data, d = b.words, a = 8 * this._nDataBytes, e = 8 * b.sigBytes; d[e >>> 5] |= 128 << 24 - e % 32; d[(e + 64 >>> 9 << 4) + 14] = Math.floor(a / 4294967296); d[(e + 64 >>> 9 << 4) + 15] = a; b.sigBytes = 4 * d.length; this._process(); return this._hash }, clone: function () { var b = l.clone.call(this); b._hash = this._hash.clone(); return b } }); k.SHA1 = l._createHelper(b); k.HmacSHA1 = l._createHmacHelper(b) })();
+(function (k) { for (var g = CryptoJS, h = g.lib, v = h.WordArray, j = h.Hasher, h = g.algo, s = [], t = [], u = function (q) { return 4294967296 * (q - (q | 0)) | 0 }, l = 2, b = 0; 64 > b;) { var d; a: { d = l; for (var w = k.sqrt(d), r = 2; r <= w; r++) if (!(d % r)) { d = !1; break a } d = !0 } d && (8 > b && (s[b] = u(k.pow(l, 0.5))), t[b] = u(k.pow(l, 1 / 3)), b++); l++ } var n = [], h = h.SHA256 = j.extend({ _doReset: function () { this._hash = new v.init(s.slice(0)) }, _doProcessBlock: function (q, h) { for (var a = this._hash.words, c = a[0], d = a[1], b = a[2], k = a[3], f = a[4], g = a[5], j = a[6], l = a[7], e = 0; 64 > e; e++) { if (16 > e) n[e] = q[h + e] | 0; else { var m = n[e - 15], p = n[e - 2]; n[e] = ((m << 25 | m >>> 7) ^ (m << 14 | m >>> 18) ^ m >>> 3) + n[e - 7] + ((p << 15 | p >>> 17) ^ (p << 13 | p >>> 19) ^ p >>> 10) + n[e - 16] } m = l + ((f << 26 | f >>> 6) ^ (f << 21 | f >>> 11) ^ (f << 7 | f >>> 25)) + (f & g ^ ~f & j) + t[e] + n[e]; p = ((c << 30 | c >>> 2) ^ (c << 19 | c >>> 13) ^ (c << 10 | c >>> 22)) + (c & d ^ c & b ^ d & b); l = j; j = g; g = f; f = k + m | 0; k = b; b = d; d = c; c = m + p | 0 } a[0] = a[0] + c | 0; a[1] = a[1] + d | 0; a[2] = a[2] + b | 0; a[3] = a[3] + k | 0; a[4] = a[4] + f | 0; a[5] = a[5] + g | 0; a[6] = a[6] + j | 0; a[7] = a[7] + l | 0 }, _doFinalize: function () { var d = this._data, b = d.words, a = 8 * this._nDataBytes, c = 8 * d.sigBytes; b[c >>> 5] |= 128 << 24 - c % 32; b[(c + 64 >>> 9 << 4) + 14] = k.floor(a / 4294967296); b[(c + 64 >>> 9 << 4) + 15] = a; d.sigBytes = 4 * b.length; this._process(); return this._hash }, clone: function () { var b = j.clone.call(this); b._hash = this._hash.clone(); return b } }); g.SHA256 = j._createHelper(h); g.HmacSHA256 = j._createHmacHelper(h) })(Math);
+(function () { var c = CryptoJS, k = c.enc.Utf8; c.algo.HMAC = c.lib.Base.extend({ init: function (a, b) { a = this._hasher = new a.init; "string" == typeof b && (b = k.parse(b)); var c = a.blockSize, e = 4 * c; b.sigBytes > e && (b = a.finalize(b)); b.clamp(); for (var f = this._oKey = b.clone(), g = this._iKey = b.clone(), h = f.words, j = g.words, d = 0; d < c; d++) h[d] ^= 1549556828, j[d] ^= 909522486; f.sigBytes = g.sigBytes = e; this.reset() }, reset: function () { var a = this._hasher; a.reset(); a.update(this._iKey) }, update: function (a) { this._hasher.update(a); return this }, finalize: function (a) { var b = this._hasher; a = b.finalize(a); b.reset(); return b.finalize(this._oKey.clone().concat(a)) } }) })();
+(function () { var h = CryptoJS, j = h.lib.WordArray; h.enc.Base64 = { stringify: function (b) { var e = b.words, f = b.sigBytes, c = this._map; b.clamp(); b = []; for (var a = 0; a < f; a += 3) for (var d = (e[a >>> 2] >>> 24 - 8 * (a % 4) & 255) << 16 | (e[a + 1 >>> 2] >>> 24 - 8 * ((a + 1) % 4) & 255) << 8 | e[a + 2 >>> 2] >>> 24 - 8 * ((a + 2) % 4) & 255, g = 0; 4 > g && a + 0.75 * g < f; g++) b.push(c.charAt(d >>> 6 * (3 - g) & 63)); if (e = c.charAt(64)) for (; b.length % 4;) b.push(e); return b.join("") }, parse: function (b) { var e = b.length, f = this._map, c = f.charAt(64); c && (c = b.indexOf(c), -1 != c && (e = c)); for (var c = [], a = 0, d = 0; d < e; d++) if (d % 4) { var g = f.indexOf(b.charAt(d - 1)) << 2 * (d % 4), h = f.indexOf(b.charAt(d)) >>> 6 - 2 * (d % 4); c[a >>> 2] |= (g | h) << 24 - 8 * (a % 4); a++ } return j.create(c, a) }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" } })();
+
+hawk.crypto.internals = CryptoJS;
+
+
+// Export if used as a module
+
+if (typeof module !== 'undefined' && module.exports) {
+ module.exports = hawk;
+}
+
+/* eslint-enable */
+// $lab:coverage:on$
diff --git a/node_modules/request/node_modules/hawk/lib/client.js b/node_modules/request/node_modules/hawk/lib/client.js
new file mode 100755
index 000000000..b3e8649e3
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/lib/client.js
@@ -0,0 +1,369 @@
+// Load modules
+
+var Url = require('url');
+var Hoek = require('hoek');
+var Cryptiles = require('cryptiles');
+var Crypto = require('./crypto');
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Generate an Authorization header for a given request
+
+/*
+ uri: 'http://example.com/resource?a=b' or object from Url.parse()
+ method: HTTP verb (e.g. 'GET', 'POST')
+ options: {
+
+ // Required
+
+ credentials: {
+ id: 'dh37fgj492je',
+ key: 'aoijedoaijsdlaksjdl',
+ algorithm: 'sha256' // 'sha1', 'sha256'
+ },
+
+ // Optional
+
+ ext: 'application-specific', // Application specific data sent via the ext attribute
+ timestamp: Date.now(), // A pre-calculated timestamp
+ nonce: '2334f34f', // A pre-generated nonce
+ localtimeOffsetMsec: 400, // Time offset to sync with server time (ignored if timestamp provided)
+ payload: '{"some":"payload"}', // UTF-8 encoded string for body hash generation (ignored if hash provided)
+ contentType: 'application/json', // Payload content-type (ignored if hash provided)
+ hash: 'U4MKKSmiVxk37JCCrAVIjV=', // Pre-calculated payload hash
+ app: '24s23423f34dx', // Oz application id
+ dlg: '234sz34tww3sd' // Oz delegated-by application id
+ }
+*/
+
+exports.header = function (uri, method, options) {
+
+ var result = {
+ field: '',
+ artifacts: {}
+ };
+
+ // Validate inputs
+
+ if (!uri || (typeof uri !== 'string' && typeof uri !== 'object') ||
+ !method || typeof method !== 'string' ||
+ !options || typeof options !== 'object') {
+
+ result.err = 'Invalid argument type';
+ return result;
+ }
+
+ // Application time
+
+ var timestamp = options.timestamp || Utils.nowSecs(options.localtimeOffsetMsec);
+
+ // Validate credentials
+
+ var credentials = options.credentials;
+ if (!credentials ||
+ !credentials.id ||
+ !credentials.key ||
+ !credentials.algorithm) {
+
+ result.err = 'Invalid credential object';
+ return result;
+ }
+
+ if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ result.err = 'Unknown algorithm';
+ return result;
+ }
+
+ // Parse URI
+
+ if (typeof uri === 'string') {
+ uri = Url.parse(uri);
+ }
+
+ // Calculate signature
+
+ var artifacts = {
+ ts: timestamp,
+ nonce: options.nonce || Cryptiles.randomString(6),
+ method: method,
+ resource: uri.pathname + (uri.search || ''), // Maintain trailing '?'
+ host: uri.hostname,
+ port: uri.port || (uri.protocol === 'http:' ? 80 : 443),
+ hash: options.hash,
+ ext: options.ext,
+ app: options.app,
+ dlg: options.dlg
+ };
+
+ result.artifacts = artifacts;
+
+ // Calculate payload hash
+
+ if (!artifacts.hash &&
+ (options.payload || options.payload === '')) {
+
+ artifacts.hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
+ }
+
+ var mac = Crypto.calculateMac('header', credentials, artifacts);
+
+ // Construct header
+
+ var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''; // Other falsey values allowed
+ var header = 'Hawk id="' + credentials.id +
+ '", ts="' + artifacts.ts +
+ '", nonce="' + artifacts.nonce +
+ (artifacts.hash ? '", hash="' + artifacts.hash : '') +
+ (hasExt ? '", ext="' + Hoek.escapeHeaderAttribute(artifacts.ext) : '') +
+ '", mac="' + mac + '"';
+
+ if (artifacts.app) {
+ header += ', app="' + artifacts.app +
+ (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"';
+ }
+
+ result.field = header;
+
+ return result;
+};
+
+
+// Validate server response
+
+/*
+ res: node's response object
+ artifacts: object received from header().artifacts
+ options: {
+ payload: optional payload received
+ required: specifies if a Server-Authorization header is required. Defaults to 'false'
+ }
+*/
+
+exports.authenticate = function (res, credentials, artifacts, options) {
+
+ artifacts = Hoek.clone(artifacts);
+ options = options || {};
+
+ if (res.headers['www-authenticate']) {
+
+ // Parse HTTP WWW-Authenticate header
+
+ var wwwAttributes = Utils.parseAuthorizationHeader(res.headers['www-authenticate'], ['ts', 'tsm', 'error']);
+ if (wwwAttributes instanceof Error) {
+ return false;
+ }
+
+ // Validate server timestamp (not used to update clock since it is done via the SNPT client)
+
+ if (wwwAttributes.ts) {
+ var tsm = Crypto.calculateTsMac(wwwAttributes.ts, credentials);
+ if (tsm !== wwwAttributes.tsm) {
+ return false;
+ }
+ }
+ }
+
+ // Parse HTTP Server-Authorization header
+
+ if (!res.headers['server-authorization'] &&
+ !options.required) {
+
+ return true;
+ }
+
+ var attributes = Utils.parseAuthorizationHeader(res.headers['server-authorization'], ['mac', 'ext', 'hash']);
+ if (attributes instanceof Error) {
+ return false;
+ }
+
+ artifacts.ext = attributes.ext;
+ artifacts.hash = attributes.hash;
+
+ var mac = Crypto.calculateMac('response', credentials, artifacts);
+ if (mac !== attributes.mac) {
+ return false;
+ }
+
+ if (!options.payload &&
+ options.payload !== '') {
+
+ return true;
+ }
+
+ if (!attributes.hash) {
+ return false;
+ }
+
+ var calculatedHash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, res.headers['content-type']);
+ return (calculatedHash === attributes.hash);
+};
+
+
+// Generate a bewit value for a given URI
+
+/*
+ uri: 'http://example.com/resource?a=b' or object from Url.parse()
+ options: {
+
+ // Required
+
+ credentials: {
+ id: 'dh37fgj492je',
+ key: 'aoijedoaijsdlaksjdl',
+ algorithm: 'sha256' // 'sha1', 'sha256'
+ },
+ ttlSec: 60 * 60, // TTL in seconds
+
+ // Optional
+
+ ext: 'application-specific', // Application specific data sent via the ext attribute
+ localtimeOffsetMsec: 400 // Time offset to sync with server time
+ };
+*/
+
+exports.getBewit = function (uri, options) {
+
+ // Validate inputs
+
+ if (!uri ||
+ (typeof uri !== 'string' && typeof uri !== 'object') ||
+ !options ||
+ typeof options !== 'object' ||
+ !options.ttlSec) {
+
+ return '';
+ }
+
+ options.ext = (options.ext === null || options.ext === undefined ? '' : options.ext); // Zero is valid value
+
+ // Application time
+
+ var now = Utils.now(options.localtimeOffsetMsec);
+
+ // Validate credentials
+
+ var credentials = options.credentials;
+ if (!credentials ||
+ !credentials.id ||
+ !credentials.key ||
+ !credentials.algorithm) {
+
+ return '';
+ }
+
+ if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return '';
+ }
+
+ // Parse URI
+
+ if (typeof uri === 'string') {
+ uri = Url.parse(uri);
+ }
+
+ // Calculate signature
+
+ var exp = Math.floor(now / 1000) + options.ttlSec;
+ var mac = Crypto.calculateMac('bewit', credentials, {
+ ts: exp,
+ nonce: '',
+ method: 'GET',
+ resource: uri.pathname + (uri.search || ''), // Maintain trailing '?'
+ host: uri.hostname,
+ port: uri.port || (uri.protocol === 'http:' ? 80 : 443),
+ ext: options.ext
+ });
+
+ // Construct bewit: id\exp\mac\ext
+
+ var bewit = credentials.id + '\\' + exp + '\\' + mac + '\\' + options.ext;
+ return Hoek.base64urlEncode(bewit);
+};
+
+
+// Generate an authorization string for a message
+
+/*
+ host: 'example.com',
+ port: 8000,
+ message: '{"some":"payload"}', // UTF-8 encoded string for body hash generation
+ options: {
+
+ // Required
+
+ credentials: {
+ id: 'dh37fgj492je',
+ key: 'aoijedoaijsdlaksjdl',
+ algorithm: 'sha256' // 'sha1', 'sha256'
+ },
+
+ // Optional
+
+ timestamp: Date.now(), // A pre-calculated timestamp
+ nonce: '2334f34f', // A pre-generated nonce
+ localtimeOffsetMsec: 400, // Time offset to sync with server time (ignored if timestamp provided)
+ }
+*/
+
+exports.message = function (host, port, message, options) {
+
+ // Validate inputs
+
+ if (!host || typeof host !== 'string' ||
+ !port || typeof port !== 'number' ||
+ message === null || message === undefined || typeof message !== 'string' ||
+ !options || typeof options !== 'object') {
+
+ return null;
+ }
+
+ // Application time
+
+ var timestamp = options.timestamp || Utils.nowSecs(options.localtimeOffsetMsec);
+
+ // Validate credentials
+
+ var credentials = options.credentials;
+ if (!credentials ||
+ !credentials.id ||
+ !credentials.key ||
+ !credentials.algorithm) {
+
+ // Invalid credential object
+ return null;
+ }
+
+ if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return null;
+ }
+
+ // Calculate signature
+
+ var artifacts = {
+ ts: timestamp,
+ nonce: options.nonce || Cryptiles.randomString(6),
+ host: host,
+ port: port,
+ hash: Crypto.calculatePayloadHash(message, credentials.algorithm)
+ };
+
+ // Construct authorization
+
+ var result = {
+ id: credentials.id,
+ ts: artifacts.ts,
+ nonce: artifacts.nonce,
+ hash: artifacts.hash,
+ mac: Crypto.calculateMac('message', credentials, artifacts)
+ };
+
+ return result;
+};
+
+
+
diff --git a/node_modules/request/node_modules/hawk/lib/crypto.js b/node_modules/request/node_modules/hawk/lib/crypto.js
new file mode 100755
index 000000000..d3c8244a9
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/lib/crypto.js
@@ -0,0 +1,126 @@
+// Load modules
+
+var Crypto = require('crypto');
+var Url = require('url');
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// MAC normalization format version
+
+exports.headerVersion = '1'; // Prevent comparison of mac values generated with different normalized string formats
+
+
+// Supported HMAC algorithms
+
+exports.algorithms = ['sha1', 'sha256'];
+
+
+// Calculate the request MAC
+
+/*
+ type: 'header', // 'header', 'bewit', 'response'
+ credentials: {
+ key: 'aoijedoaijsdlaksjdl',
+ algorithm: 'sha256' // 'sha1', 'sha256'
+ },
+ options: {
+ method: 'GET',
+ resource: '/resource?a=1&b=2',
+ host: 'example.com',
+ port: 8080,
+ ts: 1357718381034,
+ nonce: 'd3d345f',
+ hash: 'U4MKKSmiVxk37JCCrAVIjV/OhB3y+NdwoCr6RShbVkE=',
+ ext: 'app-specific-data',
+ app: 'hf48hd83qwkj', // Application id (Oz)
+ dlg: 'd8djwekds9cj' // Delegated by application id (Oz), requires options.app
+ }
+*/
+
+exports.calculateMac = function (type, credentials, options) {
+
+ var normalized = exports.generateNormalizedString(type, options);
+
+ var hmac = Crypto.createHmac(credentials.algorithm, credentials.key).update(normalized);
+ var digest = hmac.digest('base64');
+ return digest;
+};
+
+
+exports.generateNormalizedString = function (type, options) {
+
+ var resource = options.resource || '';
+ if (resource &&
+ resource[0] !== '/') {
+
+ var url = Url.parse(resource, false);
+ resource = url.path; // Includes query
+ }
+
+ var normalized = 'hawk.' + exports.headerVersion + '.' + type + '\n' +
+ options.ts + '\n' +
+ options.nonce + '\n' +
+ (options.method || '').toUpperCase() + '\n' +
+ resource + '\n' +
+ options.host.toLowerCase() + '\n' +
+ options.port + '\n' +
+ (options.hash || '') + '\n';
+
+ if (options.ext) {
+ normalized += options.ext.replace('\\', '\\\\').replace('\n', '\\n');
+ }
+
+ normalized += '\n';
+
+ if (options.app) {
+ normalized += options.app + '\n' +
+ (options.dlg || '') + '\n';
+ }
+
+ return normalized;
+};
+
+
+exports.calculatePayloadHash = function (payload, algorithm, contentType) {
+
+ var hash = exports.initializePayloadHash(algorithm, contentType);
+ hash.update(payload || '');
+ return exports.finalizePayloadHash(hash);
+};
+
+
+exports.initializePayloadHash = function (algorithm, contentType) {
+
+ var hash = Crypto.createHash(algorithm);
+ hash.update('hawk.' + exports.headerVersion + '.payload\n');
+ hash.update(Utils.parseContentType(contentType) + '\n');
+ return hash;
+};
+
+
+exports.finalizePayloadHash = function (hash) {
+
+ hash.update('\n');
+ return hash.digest('base64');
+};
+
+
+exports.calculateTsMac = function (ts, credentials) {
+
+ var hmac = Crypto.createHmac(credentials.algorithm, credentials.key);
+ hmac.update('hawk.' + exports.headerVersion + '.ts\n' + ts + '\n');
+ return hmac.digest('base64');
+};
+
+
+exports.timestampMessage = function (credentials, localtimeOffsetMsec) {
+
+ var now = Utils.nowSecs(localtimeOffsetMsec);
+ var tsm = exports.calculateTsMac(now, credentials);
+ return { ts: now, tsm: tsm };
+};
diff --git a/node_modules/request/node_modules/hawk/lib/index.js b/node_modules/request/node_modules/hawk/lib/index.js
new file mode 100755
index 000000000..a883882c8
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/lib/index.js
@@ -0,0 +1,15 @@
+// Export sub-modules
+
+exports.error = exports.Error = require('boom');
+exports.sntp = require('sntp');
+
+exports.server = require('./server');
+exports.client = require('./client');
+exports.crypto = require('./crypto');
+exports.utils = require('./utils');
+
+exports.uri = {
+ authenticate: exports.server.authenticateBewit,
+ getBewit: exports.client.getBewit
+};
+
diff --git a/node_modules/request/node_modules/hawk/lib/server.js b/node_modules/request/node_modules/hawk/lib/server.js
new file mode 100755
index 000000000..a325d56a5
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/lib/server.js
@@ -0,0 +1,540 @@
+// Load modules
+
+var Boom = require('boom');
+var Hoek = require('hoek');
+var Cryptiles = require('cryptiles');
+var Crypto = require('./crypto');
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Hawk authentication
+
+/*
+ req: node's HTTP request object or an object as follows:
+
+ var request = {
+ method: 'GET',
+ url: '/resource/4?a=1&b=2',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="'
+ };
+
+ credentialsFunc: required function to lookup the set of Hawk credentials based on the provided credentials id.
+ The credentials include the MAC key, MAC algorithm, and other attributes (such as username)
+ needed by the application. This function is the equivalent of verifying the username and
+ password in Basic authentication.
+
+ var credentialsFunc = function (id, callback) {
+
+ // Lookup credentials in database
+ db.lookup(id, function (err, item) {
+
+ if (err || !item) {
+ return callback(err);
+ }
+
+ var credentials = {
+ // Required
+ key: item.key,
+ algorithm: item.algorithm,
+ // Application specific
+ user: item.user
+ };
+
+ return callback(null, credentials);
+ });
+ };
+
+ options: {
+
+ hostHeaderName: optional header field name, used to override the default 'Host' header when used
+ behind a cache of a proxy. Apache2 changes the value of the 'Host' header while preserving
+ the original (which is what the module must verify) in the 'x-forwarded-host' header field.
+ Only used when passed a node Http.ServerRequest object.
+
+ nonceFunc: optional nonce validation function. The function signature is function(key, nonce, ts, callback)
+ where 'callback' must be called using the signature function(err).
+
+ timestampSkewSec: optional number of seconds of permitted clock skew for incoming timestamps. Defaults to 60 seconds.
+ Provides a +/- skew which means actual allowed window is double the number of seconds.
+
+ localtimeOffsetMsec: optional local clock time offset express in a number of milliseconds (positive or negative).
+ Defaults to 0.
+
+ payload: optional payload for validation. The client calculates the hash value and includes it via the 'hash'
+ header attribute. The server always ensures the value provided has been included in the request
+ MAC. When this option is provided, it validates the hash value itself. Validation is done by calculating
+ a hash value over the entire payload (assuming it has already be normalized to the same format and
+ encoding used by the client to calculate the hash on request). If the payload is not available at the time
+ of authentication, the authenticatePayload() method can be used by passing it the credentials and
+ attributes.hash returned in the authenticate callback.
+
+ host: optional host name override. Only used when passed a node request object.
+ port: optional port override. Only used when passed a node request object.
+ }
+
+ callback: function (err, credentials, artifacts) { }
+ */
+
+exports.authenticate = function (req, credentialsFunc, options, callback) {
+
+ callback = Hoek.nextTick(callback);
+
+ // Default options
+
+ options.nonceFunc = options.nonceFunc || internals.nonceFunc;
+ options.timestampSkewSec = options.timestampSkewSec || 60; // 60 seconds
+
+ // Application time
+
+ var now = Utils.now(options.localtimeOffsetMsec); // Measure now before any other processing
+
+ // Convert node Http request object to a request configuration object
+
+ var request = Utils.parseRequest(req, options);
+ if (request instanceof Error) {
+ return callback(Boom.badRequest(request.message));
+ }
+
+ // Parse HTTP Authorization header
+
+ var attributes = Utils.parseAuthorizationHeader(request.authorization);
+ if (attributes instanceof Error) {
+ return callback(attributes);
+ }
+
+ // Construct artifacts container
+
+ var artifacts = {
+ method: request.method,
+ host: request.host,
+ port: request.port,
+ resource: request.url,
+ ts: attributes.ts,
+ nonce: attributes.nonce,
+ hash: attributes.hash,
+ ext: attributes.ext,
+ app: attributes.app,
+ dlg: attributes.dlg,
+ mac: attributes.mac,
+ id: attributes.id
+ };
+
+ // Verify required header attributes
+
+ if (!attributes.id ||
+ !attributes.ts ||
+ !attributes.nonce ||
+ !attributes.mac) {
+
+ return callback(Boom.badRequest('Missing attributes'), null, artifacts);
+ }
+
+ // Fetch Hawk credentials
+
+ credentialsFunc(attributes.id, function (err, credentials) {
+
+ if (err) {
+ return callback(err, credentials || null, artifacts);
+ }
+
+ if (!credentials) {
+ return callback(Boom.unauthorized('Unknown credentials', 'Hawk'), null, artifacts);
+ }
+
+ if (!credentials.key ||
+ !credentials.algorithm) {
+
+ return callback(Boom.internal('Invalid credentials'), credentials, artifacts);
+ }
+
+ if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return callback(Boom.internal('Unknown algorithm'), credentials, artifacts);
+ }
+
+ // Calculate MAC
+
+ var mac = Crypto.calculateMac('header', credentials, artifacts);
+ if (!Cryptiles.fixedTimeComparison(mac, attributes.mac)) {
+ return callback(Boom.unauthorized('Bad mac', 'Hawk'), credentials, artifacts);
+ }
+
+ // Check payload hash
+
+ if (options.payload ||
+ options.payload === '') {
+
+ if (!attributes.hash) {
+ return callback(Boom.unauthorized('Missing required payload hash', 'Hawk'), credentials, artifacts);
+ }
+
+ var hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, request.contentType);
+ if (!Cryptiles.fixedTimeComparison(hash, attributes.hash)) {
+ return callback(Boom.unauthorized('Bad payload hash', 'Hawk'), credentials, artifacts);
+ }
+ }
+
+ // Check nonce
+
+ options.nonceFunc(credentials.key, attributes.nonce, attributes.ts, function (err) {
+
+ if (err) {
+ return callback(Boom.unauthorized('Invalid nonce', 'Hawk'), credentials, artifacts);
+ }
+
+ // Check timestamp staleness
+
+ if (Math.abs((attributes.ts * 1000) - now) > (options.timestampSkewSec * 1000)) {
+ var tsm = Crypto.timestampMessage(credentials, options.localtimeOffsetMsec);
+ return callback(Boom.unauthorized('Stale timestamp', 'Hawk', tsm), credentials, artifacts);
+ }
+
+ // Successful authentication
+
+ return callback(null, credentials, artifacts);
+ });
+ });
+};
+
+
+// Authenticate payload hash - used when payload cannot be provided during authenticate()
+
+/*
+ payload: raw request payload
+ credentials: from authenticate callback
+ artifacts: from authenticate callback
+ contentType: req.headers['content-type']
+*/
+
+exports.authenticatePayload = function (payload, credentials, artifacts, contentType) {
+
+ var calculatedHash = Crypto.calculatePayloadHash(payload, credentials.algorithm, contentType);
+ return Cryptiles.fixedTimeComparison(calculatedHash, artifacts.hash);
+};
+
+
+// Authenticate payload hash - used when payload cannot be provided during authenticate()
+
+/*
+ calculatedHash: the payload hash calculated using Crypto.calculatePayloadHash()
+ artifacts: from authenticate callback
+*/
+
+exports.authenticatePayloadHash = function (calculatedHash, artifacts) {
+
+ return Cryptiles.fixedTimeComparison(calculatedHash, artifacts.hash);
+};
+
+
+// Generate a Server-Authorization header for a given response
+
+/*
+ credentials: {}, // Object received from authenticate()
+ artifacts: {} // Object received from authenticate(); 'mac', 'hash', and 'ext' - ignored
+ options: {
+ ext: 'application-specific', // Application specific data sent via the ext attribute
+ payload: '{"some":"payload"}', // UTF-8 encoded string for body hash generation (ignored if hash provided)
+ contentType: 'application/json', // Payload content-type (ignored if hash provided)
+ hash: 'U4MKKSmiVxk37JCCrAVIjV=' // Pre-calculated payload hash
+ }
+*/
+
+exports.header = function (credentials, artifacts, options) {
+
+ // Prepare inputs
+
+ options = options || {};
+
+ if (!artifacts ||
+ typeof artifacts !== 'object' ||
+ typeof options !== 'object') {
+
+ return '';
+ }
+
+ artifacts = Hoek.clone(artifacts);
+ delete artifacts.mac;
+ artifacts.hash = options.hash;
+ artifacts.ext = options.ext;
+
+ // Validate credentials
+
+ if (!credentials ||
+ !credentials.key ||
+ !credentials.algorithm) {
+
+ // Invalid credential object
+ return '';
+ }
+
+ if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return '';
+ }
+
+ // Calculate payload hash
+
+ if (!artifacts.hash &&
+ (options.payload || options.payload === '')) {
+
+ artifacts.hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
+ }
+
+ var mac = Crypto.calculateMac('response', credentials, artifacts);
+
+ // Construct header
+
+ var header = 'Hawk mac="' + mac + '"' +
+ (artifacts.hash ? ', hash="' + artifacts.hash + '"' : '');
+
+ if (artifacts.ext !== null &&
+ artifacts.ext !== undefined &&
+ artifacts.ext !== '') { // Other falsey values allowed
+
+ header += ', ext="' + Hoek.escapeHeaderAttribute(artifacts.ext) + '"';
+ }
+
+ return header;
+};
+
+
+/*
+ * Arguments and options are the same as authenticate() with the exception that the only supported options are:
+ * 'hostHeaderName', 'localtimeOffsetMsec', 'host', 'port'
+ */
+
+exports.authenticateBewit = function (req, credentialsFunc, options, callback) {
+
+ callback = Hoek.nextTick(callback);
+
+ // Application time
+
+ var now = Utils.now(options.localtimeOffsetMsec);
+
+ // Convert node Http request object to a request configuration object
+
+ var request = Utils.parseRequest(req, options);
+ if (request instanceof Error) {
+ return callback(Boom.badRequest(request.message));
+ }
+
+ // Extract bewit
+
+ // 1 2 3 4
+ var resource = request.url.match(/^(\/.*)([\?&])bewit\=([^&$]*)(?:&(.+))?$/);
+ if (!resource) {
+ return callback(Boom.unauthorized(null, 'Hawk'));
+ }
+
+ // Bewit not empty
+
+ if (!resource[3]) {
+ return callback(Boom.unauthorized('Empty bewit', 'Hawk'));
+ }
+
+ // Verify method is GET
+
+ if (request.method !== 'GET' &&
+ request.method !== 'HEAD') {
+
+ return callback(Boom.unauthorized('Invalid method', 'Hawk'));
+ }
+
+ // No other authentication
+
+ if (request.authorization) {
+ return callback(Boom.badRequest('Multiple authentications'));
+ }
+
+ // Parse bewit
+
+ var bewitString = Hoek.base64urlDecode(resource[3]);
+ if (bewitString instanceof Error) {
+ return callback(Boom.badRequest('Invalid bewit encoding'));
+ }
+
+ // Bewit format: id\exp\mac\ext ('\' is used because it is a reserved header attribute character)
+
+ var bewitParts = bewitString.split('\\');
+ if (bewitParts.length !== 4) {
+ return callback(Boom.badRequest('Invalid bewit structure'));
+ }
+
+ var bewit = {
+ id: bewitParts[0],
+ exp: parseInt(bewitParts[1], 10),
+ mac: bewitParts[2],
+ ext: bewitParts[3] || ''
+ };
+
+ if (!bewit.id ||
+ !bewit.exp ||
+ !bewit.mac) {
+
+ return callback(Boom.badRequest('Missing bewit attributes'));
+ }
+
+ // Construct URL without bewit
+
+ var url = resource[1];
+ if (resource[4]) {
+ url += resource[2] + resource[4];
+ }
+
+ // Check expiration
+
+ if (bewit.exp * 1000 <= now) {
+ return callback(Boom.unauthorized('Access expired', 'Hawk'), null, bewit);
+ }
+
+ // Fetch Hawk credentials
+
+ credentialsFunc(bewit.id, function (err, credentials) {
+
+ if (err) {
+ return callback(err, credentials || null, bewit.ext);
+ }
+
+ if (!credentials) {
+ return callback(Boom.unauthorized('Unknown credentials', 'Hawk'), null, bewit);
+ }
+
+ if (!credentials.key ||
+ !credentials.algorithm) {
+
+ return callback(Boom.internal('Invalid credentials'), credentials, bewit);
+ }
+
+ if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return callback(Boom.internal('Unknown algorithm'), credentials, bewit);
+ }
+
+ // Calculate MAC
+
+ var mac = Crypto.calculateMac('bewit', credentials, {
+ ts: bewit.exp,
+ nonce: '',
+ method: 'GET',
+ resource: url,
+ host: request.host,
+ port: request.port,
+ ext: bewit.ext
+ });
+
+ if (!Cryptiles.fixedTimeComparison(mac, bewit.mac)) {
+ return callback(Boom.unauthorized('Bad mac', 'Hawk'), credentials, bewit);
+ }
+
+ // Successful authentication
+
+ return callback(null, credentials, bewit);
+ });
+};
+
+
+/*
+ * options are the same as authenticate() with the exception that the only supported options are:
+ * 'nonceFunc', 'timestampSkewSec', 'localtimeOffsetMsec'
+ */
+
+exports.authenticateMessage = function (host, port, message, authorization, credentialsFunc, options, callback) {
+
+ callback = Hoek.nextTick(callback);
+
+ // Default options
+
+ options.nonceFunc = options.nonceFunc || internals.nonceFunc;
+ options.timestampSkewSec = options.timestampSkewSec || 60; // 60 seconds
+
+ // Application time
+
+ var now = Utils.now(options.localtimeOffsetMsec); // Measure now before any other processing
+
+ // Validate authorization
+
+ if (!authorization.id ||
+ !authorization.ts ||
+ !authorization.nonce ||
+ !authorization.hash ||
+ !authorization.mac) {
+
+ return callback(Boom.badRequest('Invalid authorization'));
+ }
+
+ // Fetch Hawk credentials
+
+ credentialsFunc(authorization.id, function (err, credentials) {
+
+ if (err) {
+ return callback(err, credentials || null);
+ }
+
+ if (!credentials) {
+ return callback(Boom.unauthorized('Unknown credentials', 'Hawk'));
+ }
+
+ if (!credentials.key ||
+ !credentials.algorithm) {
+
+ return callback(Boom.internal('Invalid credentials'), credentials);
+ }
+
+ if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ return callback(Boom.internal('Unknown algorithm'), credentials);
+ }
+
+ // Construct artifacts container
+
+ var artifacts = {
+ ts: authorization.ts,
+ nonce: authorization.nonce,
+ host: host,
+ port: port,
+ hash: authorization.hash
+ };
+
+ // Calculate MAC
+
+ var mac = Crypto.calculateMac('message', credentials, artifacts);
+ if (!Cryptiles.fixedTimeComparison(mac, authorization.mac)) {
+ return callback(Boom.unauthorized('Bad mac', 'Hawk'), credentials);
+ }
+
+ // Check payload hash
+
+ var hash = Crypto.calculatePayloadHash(message, credentials.algorithm);
+ if (!Cryptiles.fixedTimeComparison(hash, authorization.hash)) {
+ return callback(Boom.unauthorized('Bad message hash', 'Hawk'), credentials);
+ }
+
+ // Check nonce
+
+ options.nonceFunc(credentials.key, authorization.nonce, authorization.ts, function (err) {
+
+ if (err) {
+ return callback(Boom.unauthorized('Invalid nonce', 'Hawk'), credentials);
+ }
+
+ // Check timestamp staleness
+
+ if (Math.abs((authorization.ts * 1000) - now) > (options.timestampSkewSec * 1000)) {
+ return callback(Boom.unauthorized('Stale timestamp'), credentials);
+ }
+
+ // Successful authentication
+
+ return callback(null, credentials);
+ });
+ });
+};
+
+
+internals.nonceFunc = function (key, nonce, ts, nonceCallback) {
+
+ return nonceCallback(); // No validation
+};
diff --git a/node_modules/request/node_modules/hawk/lib/utils.js b/node_modules/request/node_modules/hawk/lib/utils.js
new file mode 100755
index 000000000..8d2719abc
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/lib/utils.js
@@ -0,0 +1,164 @@
+// Load modules
+
+var Sntp = require('sntp');
+var Boom = require('boom');
+
+
+// Declare internals
+
+var internals = {};
+
+
+exports.version = function () {
+
+ return require('../package.json').version;
+};
+
+
+// Extract host and port from request
+
+// $1 $2
+internals.hostHeaderRegex = /^(?:(?:\r\n)?\s)*((?:[^:]+)|(?:\[[^\]]+\]))(?::(\d+))?(?:(?:\r\n)?\s)*$/; // (IPv4, hostname)|(IPv6)
+
+
+exports.parseHost = function (req, hostHeaderName) {
+
+ hostHeaderName = (hostHeaderName ? hostHeaderName.toLowerCase() : 'host');
+ var hostHeader = req.headers[hostHeaderName];
+ if (!hostHeader) {
+ return null;
+ }
+
+ var hostParts = hostHeader.match(internals.hostHeaderRegex);
+ if (!hostParts) {
+ return null;
+ }
+
+ return {
+ name: hostParts[1],
+ port: (hostParts[2] ? hostParts[2] : (req.connection && req.connection.encrypted ? 443 : 80))
+ };
+};
+
+
+// Parse Content-Type header content
+
+exports.parseContentType = function (header) {
+
+ if (!header) {
+ return '';
+ }
+
+ return header.split(';')[0].trim().toLowerCase();
+};
+
+
+// Convert node's to request configuration object
+
+exports.parseRequest = function (req, options) {
+
+ if (!req.headers) {
+ return req;
+ }
+
+ // Obtain host and port information
+
+ if (!options.host || !options.port) {
+ var host = exports.parseHost(req, options.hostHeaderName);
+ if (!host) {
+ return new Error('Invalid Host header');
+ }
+ }
+
+ var request = {
+ method: req.method,
+ url: req.url,
+ host: options.host || host.name,
+ port: options.port || host.port,
+ authorization: req.headers.authorization,
+ contentType: req.headers['content-type'] || ''
+ };
+
+ return request;
+};
+
+
+exports.now = function (localtimeOffsetMsec) {
+
+ return Sntp.now() + (localtimeOffsetMsec || 0);
+};
+
+
+exports.nowSecs = function (localtimeOffsetMsec) {
+
+ return Math.floor(exports.now(localtimeOffsetMsec) / 1000);
+};
+
+
+// Parse Hawk HTTP Authorization header
+
+exports.parseAuthorizationHeader = function (header, keys) {
+
+ keys = keys || ['id', 'ts', 'nonce', 'hash', 'ext', 'mac', 'app', 'dlg'];
+
+ if (!header) {
+ return Boom.unauthorized(null, 'Hawk');
+ }
+
+ var headerParts = header.match(/^(\w+)(?:\s+(.*))?$/); // Header: scheme[ something]
+ if (!headerParts) {
+ return Boom.badRequest('Invalid header syntax');
+ }
+
+ var scheme = headerParts[1];
+ if (scheme.toLowerCase() !== 'hawk') {
+ return Boom.unauthorized(null, 'Hawk');
+ }
+
+ var attributesString = headerParts[2];
+ if (!attributesString) {
+ return Boom.badRequest('Invalid header syntax');
+ }
+
+ var attributes = {};
+ var errorMessage = '';
+ var verify = attributesString.replace(/(\w+)="([^"\\]*)"\s*(?:,\s*|$)/g, function ($0, $1, $2) {
+
+ // Check valid attribute names
+
+ if (keys.indexOf($1) === -1) {
+ errorMessage = 'Unknown attribute: ' + $1;
+ return;
+ }
+
+ // Allowed attribute value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9
+
+ if ($2.match(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~]+$/) === null) {
+ errorMessage = 'Bad attribute value: ' + $1;
+ return;
+ }
+
+ // Check for duplicates
+
+ if (attributes.hasOwnProperty($1)) {
+ errorMessage = 'Duplicate attribute: ' + $1;
+ return;
+ }
+
+ attributes[$1] = $2;
+ return '';
+ });
+
+ if (verify !== '') {
+ return Boom.badRequest(errorMessage || 'Bad header format');
+ }
+
+ return attributes;
+};
+
+
+exports.unauthorized = function (message, attributes) {
+
+ return Boom.unauthorized(message, 'Hawk', attributes);
+};
+
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore b/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore
new file mode 100644
index 000000000..77ba16cb0
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore
@@ -0,0 +1,18 @@
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml b/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml
new file mode 100755
index 000000000..dd1b24f13
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml
@@ -0,0 +1,8 @@
+language: node_js
+
+node_js:
+ - 0.10
+ - 4.0
+
+sudo: false
+
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/CONTRIBUTING.md b/node_modules/request/node_modules/hawk/node_modules/boom/CONTRIBUTING.md
new file mode 100644
index 000000000..892836159
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/boom/CONTRIBUTING.md
@@ -0,0 +1 @@
+Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md).
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE b/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE
new file mode 100755
index 000000000..394688939
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE
@@ -0,0 +1,28 @@
+Copyright (c) 2012-2014, Walmart and other contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The names of any contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ * * *
+
+The complete list of contributors can be found at: https://github.com/hapijs/boom/graphs/contributors \ No newline at end of file
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/README.md b/node_modules/request/node_modules/hawk/node_modules/boom/README.md
new file mode 100755
index 000000000..cb1e9089f
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/boom/README.md
@@ -0,0 +1,597 @@
+![boom Logo](https://raw.github.com/hapijs/boom/master/images/boom.png)
+
+HTTP-friendly error objects
+
+[![Build Status](https://secure.travis-ci.org/hapijs/boom.png)](http://travis-ci.org/hapijs/boom)
+[![Current Version](https://img.shields.io/npm/v/boom.svg)](https://www.npmjs.com/package/boom)
+
+Lead Maintainer: [Adam Bretz](https://github.com/arb)
+
+**boom** provides a set of utilities for returning HTTP errors. Each utility returns a `Boom` error response
+object (instance of `Error`) which includes the following properties:
+- `isBoom` - if `true`, indicates this is a `Boom` object instance.
+- `isServer` - convenience bool indicating status code >= 500.
+- `message` - the error message.
+- `output` - the formatted response. Can be directly manipulated after object construction to return a custom
+ error response. Allowed root keys:
+ - `statusCode` - the HTTP status code (typically 4xx or 5xx).
+ - `headers` - an object containing any HTTP headers where each key is a header name and value is the header content.
+ - `payload` - the formatted object used as the response payload (stringified). Can be directly manipulated but any
+ changes will be lost
+ if `reformat()` is called. Any content allowed and by default includes the following content:
+ - `statusCode` - the HTTP status code, derived from `error.output.statusCode`.
+ - `error` - the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from `statusCode`.
+ - `message` - the error message derived from `error.message`.
+- inherited `Error` properties.
+
+The `Boom` object also supports the following method:
+- `reformat()` - rebuilds `error.output` using the other object properties.
+
+## Helper Methods
+
+### `wrap(error, [statusCode], [message])`
+
+Decorates an error with the **boom** properties where:
+- `error` - the error object to wrap. If `error` is already a **boom** object, returns back the same object.
+- `statusCode` - optional HTTP status code. Defaults to `500`.
+- `message` - optional message string. If the error already has a message, it adds the message as a prefix.
+ Defaults to no message.
+
+```js
+var error = new Error('Unexpected input');
+Boom.wrap(error, 400);
+```
+
+### `create(statusCode, [message], [data])`
+
+Generates an `Error` object with the **boom** decorations where:
+- `statusCode` - an HTTP error code number. Must be greater or equal 400.
+- `message` - optional message string.
+- `data` - additional error data set to `error.data` property.
+
+```js
+var error = Boom.create(400, 'Bad request', { timestamp: Date.now() });
+```
+
+## HTTP 4xx Errors
+
+### `Boom.badRequest([message], [data])`
+
+Returns a 400 Bad Request error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.badRequest('invalid query');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 400,
+ "error": "Bad Request",
+ "message": "invalid query"
+}
+```
+
+### `Boom.unauthorized([message], [scheme], [attributes])`
+
+Returns a 401 Unauthorized error where:
+- `message` - optional message.
+- `scheme` can be one of the following:
+ - an authentication scheme name
+ - an array of string values. These values will be separated by ', ' and set to the 'WWW-Authenticate' header.
+- `attributes` - an object of values to use while setting the 'WWW-Authenticate' header. This value is only used
+ when `schema` is a string, otherwise it is ignored. Every key/value pair will be included in the
+ 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the `attributes` key.
+ `null` and `undefined` will be replaced with an empty string. If `attributes` is set, `message` will be used as
+ the 'error' segment of the 'WWW-Authenticate' header. If `message` is unset, the 'error' segment of the header
+ will not be present and `isMissing` will be true on the error object.
+
+If either `scheme` or `attributes` are set, the resultant `Boom` object will have the 'WWW-Authenticate' header set for the response.
+
+```js
+Boom.unauthorized('invalid password');
+```
+
+Generates the following response:
+
+```json
+"payload": {
+ "statusCode": 401,
+ "error": "Unauthorized",
+ "message": "invalid password"
+},
+"headers" {}
+```
+
+```js
+Boom.unauthorized('invalid password', 'sample');
+```
+
+Generates the following response:
+
+```json
+"payload": {
+ "statusCode": 401,
+ "error": "Unauthorized",
+ "message": "invalid password",
+ "attributes": {
+ "error": "invalid password"
+ }
+},
+"headers" {
+ "WWW-Authenticate": "sample error=\"invalid password\""
+}
+```
+
+```js
+Boom.unauthorized('invalid password', 'sample', { ttl: 0, cache: null, foo: 'bar' });
+```
+
+Generates the following response:
+
+```json
+"payload": {
+ "statusCode": 401,
+ "error": "Unauthorized",
+ "message": "invalid password",
+ "attributes": {
+ "error": "invalid password",
+ "ttl": 0,
+ "cache": "",
+ "foo": "bar"
+ }
+},
+"headers" {
+ "WWW-Authenticate": "sample ttl=\"0\", cache=\"\", foo=\"bar\", error=\"invalid password\""
+}
+```
+
+### `Boom.forbidden([message], [data])`
+
+Returns a 403 Forbidden error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.forbidden('try again some time');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 403,
+ "error": "Forbidden",
+ "message": "try again some time"
+}
+```
+
+### `Boom.notFound([message], [data])`
+
+Returns a 404 Not Found error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.notFound('missing');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 404,
+ "error": "Not Found",
+ "message": "missing"
+}
+```
+
+### `Boom.methodNotAllowed([message], [data])`
+
+Returns a 405 Method Not Allowed error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.methodNotAllowed('that method is not allowed');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 405,
+ "error": "Method Not Allowed",
+ "message": "that method is not allowed"
+}
+```
+
+### `Boom.notAcceptable([message], [data])`
+
+Returns a 406 Not Acceptable error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.notAcceptable('unacceptable');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 406,
+ "error": "Not Acceptable",
+ "message": "unacceptable"
+}
+```
+
+### `Boom.proxyAuthRequired([message], [data])`
+
+Returns a 407 Proxy Authentication Required error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.proxyAuthRequired('auth missing');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 407,
+ "error": "Proxy Authentication Required",
+ "message": "auth missing"
+}
+```
+
+### `Boom.clientTimeout([message], [data])`
+
+Returns a 408 Request Time-out error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.clientTimeout('timed out');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 408,
+ "error": "Request Time-out",
+ "message": "timed out"
+}
+```
+
+### `Boom.conflict([message], [data])`
+
+Returns a 409 Conflict error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.conflict('there was a conflict');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 409,
+ "error": "Conflict",
+ "message": "there was a conflict"
+}
+```
+
+### `Boom.resourceGone([message], [data])`
+
+Returns a 410 Gone error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.resourceGone('it is gone');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 410,
+ "error": "Gone",
+ "message": "it is gone"
+}
+```
+
+### `Boom.lengthRequired([message], [data])`
+
+Returns a 411 Length Required error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.lengthRequired('length needed');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 411,
+ "error": "Length Required",
+ "message": "length needed"
+}
+```
+
+### `Boom.preconditionFailed([message], [data])`
+
+Returns a 412 Precondition Failed error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.preconditionFailed();
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 412,
+ "error": "Precondition Failed"
+}
+```
+
+### `Boom.entityTooLarge([message], [data])`
+
+Returns a 413 Request Entity Too Large error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.entityTooLarge('too big');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 413,
+ "error": "Request Entity Too Large",
+ "message": "too big"
+}
+```
+
+### `Boom.uriTooLong([message], [data])`
+
+Returns a 414 Request-URI Too Large error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.uriTooLong('uri is too long');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 414,
+ "error": "Request-URI Too Large",
+ "message": "uri is too long"
+}
+```
+
+### `Boom.unsupportedMediaType([message], [data])`
+
+Returns a 415 Unsupported Media Type error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.unsupportedMediaType('that media is not supported');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 415,
+ "error": "Unsupported Media Type",
+ "message": "that media is not supported"
+}
+```
+
+### `Boom.rangeNotSatisfiable([message], [data])`
+
+Returns a 416 Requested Range Not Satisfiable error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.rangeNotSatisfiable();
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 416,
+ "error": "Requested Range Not Satisfiable"
+}
+```
+
+### `Boom.expectationFailed([message], [data])`
+
+Returns a 417 Expectation Failed error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.expectationFailed('expected this to work');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 417,
+ "error": "Expectation Failed",
+ "message": "expected this to work"
+}
+```
+
+### `Boom.badData([message], [data])`
+
+Returns a 422 Unprocessable Entity error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.badData('your data is bad and you should feel bad');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 422,
+ "error": "Unprocessable Entity",
+ "message": "your data is bad and you should feel bad"
+}
+```
+
+### `Boom.tooManyRequests([message], [data])`
+
+Returns a 429 Too Many Requests error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.tooManyRequests('you have exceeded your request limit');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 429,
+ "error": "Too Many Requests",
+ "message": "you have exceeded your request limit"
+}
+```
+
+## HTTP 5xx Errors
+
+All 500 errors hide your message from the end user. Your message is recorded in the server log.
+
+### `Boom.notImplemented([message], [data])`
+
+Returns a 501 Not Implemented error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.notImplemented('method not implemented');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 501,
+ "error": "Not Implemented",
+ "message": "method not implemented"
+}
+```
+
+### `Boom.badGateway([message], [data])`
+
+Returns a 502 Bad Gateway error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.badGateway('that is a bad gateway');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 502,
+ "error": "Bad Gateway",
+ "message": "that is a bad gateway"
+}
+```
+
+### `Boom.serverTimeout([message], [data])`
+
+Returns a 503 Service Unavailable error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.serverTimeout('unavailable');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 503,
+ "error": "Service Unavailable",
+ "message": "unavailable"
+}
+```
+
+### `Boom.gatewayTimeout([message], [data])`
+
+Returns a 504 Gateway Time-out error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.gatewayTimeout();
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 504,
+ "error": "Gateway Time-out"
+}
+```
+
+### `Boom.badImplementation([message], [data])`
+
+Returns a 500 Internal Server Error error where:
+- `message` - optional message.
+- `data` - optional additional error data.
+
+```js
+Boom.badImplementation('terrible implementation');
+```
+
+Generates the following response payload:
+
+```json
+{
+ "statusCode": 500,
+ "error": "Internal Server Error",
+ "message": "An internal server error occurred"
+}
+```
+
+## F.A.Q.
+
+###### How do I include extra information in my responses? `output.payload` is missing `data`, what gives?
+
+There is a reason the values passed back in the response payloads are pretty locked down. It's mostly for security and to not leak any important information back to the client. This means you will need to put in a little more effort to include extra information about your custom error. Check out the ["Error transformation"](https://github.com/hapijs/hapi/blob/master/API.md#error-transformation) section in the hapi documentation.
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png b/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png
new file mode 100755
index 000000000..373bc1345
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png
Binary files differ
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js b/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js
new file mode 100755
index 000000000..239a441e8
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js
@@ -0,0 +1,312 @@
+// Load modules
+
+var Http = require('http');
+var Hoek = require('hoek');
+
+
+// Declare internals
+
+var internals = {};
+
+exports.wrap = function (error, statusCode, message) {
+
+ Hoek.assert(error instanceof Error, 'Cannot wrap non-Error object');
+ return (error.isBoom ? error : internals.initialize(error, statusCode || 500, message));
+};
+
+
+exports.create = function (statusCode, message, data) {
+
+ return internals.create(statusCode, message, data, exports.create);
+};
+
+internals.create = function (statusCode, message, data, ctor) {
+
+ var error = new Error(message ? message : undefined); // Avoids settings null message
+ Error.captureStackTrace(error, ctor); // Filter the stack to our external API
+ error.data = data || null;
+ internals.initialize(error, statusCode);
+ return error;
+};
+
+internals.initialize = function (error, statusCode, message) {
+
+ var numberCode = parseInt(statusCode, 10);
+ Hoek.assert(!isNaN(numberCode) && numberCode >= 400, 'First argument must be a number (400+):', statusCode);
+
+ error.isBoom = true;
+ error.isServer = numberCode >= 500;
+
+ if (!error.hasOwnProperty('data')) {
+ error.data = null;
+ }
+
+ error.output = {
+ statusCode: numberCode,
+ payload: {},
+ headers: {}
+ };
+
+ error.reformat = internals.reformat;
+ error.reformat();
+
+ if (!message &&
+ !error.message) {
+
+ message = error.output.payload.error;
+ }
+
+ if (message) {
+ error.message = (message + (error.message ? ': ' + error.message : ''));
+ }
+
+ return error;
+};
+
+
+internals.reformat = function () {
+
+ this.output.payload.statusCode = this.output.statusCode;
+ this.output.payload.error = Http.STATUS_CODES[this.output.statusCode] || 'Unknown';
+
+ if (this.output.statusCode === 500) {
+ this.output.payload.message = 'An internal server error occurred'; // Hide actual error from user
+ }
+ else if (this.message) {
+ this.output.payload.message = this.message;
+ }
+};
+
+
+// 4xx Client Errors
+
+exports.badRequest = function (message, data) {
+
+ return internals.create(400, message, data, exports.badRequest);
+};
+
+
+exports.unauthorized = function (message, scheme, attributes) { // Or function (message, wwwAuthenticate[])
+
+ var err = internals.create(401, message, undefined, exports.unauthorized);
+
+ if (!scheme) {
+ return err;
+ }
+
+ var wwwAuthenticate = '';
+ var i = 0;
+ var il = 0;
+
+ if (typeof scheme === 'string') {
+
+ // function (message, scheme, attributes)
+
+ wwwAuthenticate = scheme;
+
+ if (attributes || message) {
+ err.output.payload.attributes = {};
+ }
+
+ if (attributes) {
+ var names = Object.keys(attributes);
+ for (i = 0, il = names.length; i < il; ++i) {
+ var name = names[i];
+ if (i) {
+ wwwAuthenticate += ',';
+ }
+
+ var value = attributes[name];
+ if (value === null ||
+ value === undefined) { // Value can be zero
+
+ value = '';
+ }
+ wwwAuthenticate += ' ' + name + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"';
+ err.output.payload.attributes[name] = value;
+ }
+ }
+
+ if (message) {
+ if (attributes) {
+ wwwAuthenticate += ',';
+ }
+ wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(message) + '"';
+ err.output.payload.attributes.error = message;
+ }
+ else {
+ err.isMissing = true;
+ }
+ }
+ else {
+
+ // function (message, wwwAuthenticate[])
+
+ var wwwArray = scheme;
+ for (i = 0, il = wwwArray.length; i < il; ++i) {
+ if (i) {
+ wwwAuthenticate += ', ';
+ }
+
+ wwwAuthenticate += wwwArray[i];
+ }
+ }
+
+ err.output.headers['WWW-Authenticate'] = wwwAuthenticate;
+
+ return err;
+};
+
+
+exports.forbidden = function (message, data) {
+
+ return internals.create(403, message, data, exports.forbidden);
+};
+
+
+exports.notFound = function (message, data) {
+
+ return internals.create(404, message, data, exports.notFound);
+};
+
+
+exports.methodNotAllowed = function (message, data) {
+
+ return internals.create(405, message, data, exports.methodNotAllowed);
+};
+
+
+exports.notAcceptable = function (message, data) {
+
+ return internals.create(406, message, data, exports.notAcceptable);
+};
+
+
+exports.proxyAuthRequired = function (message, data) {
+
+ return internals.create(407, message, data, exports.proxyAuthRequired);
+};
+
+
+exports.clientTimeout = function (message, data) {
+
+ return internals.create(408, message, data, exports.clientTimeout);
+};
+
+
+exports.conflict = function (message, data) {
+
+ return internals.create(409, message, data, exports.conflict);
+};
+
+
+exports.resourceGone = function (message, data) {
+
+ return internals.create(410, message, data, exports.resourceGone);
+};
+
+
+exports.lengthRequired = function (message, data) {
+
+ return internals.create(411, message, data, exports.lengthRequired);
+};
+
+
+exports.preconditionFailed = function (message, data) {
+
+ return internals.create(412, message, data, exports.preconditionFailed);
+};
+
+
+exports.entityTooLarge = function (message, data) {
+
+ return internals.create(413, message, data, exports.entityTooLarge);
+};
+
+
+exports.uriTooLong = function (message, data) {
+
+ return internals.create(414, message, data, exports.uriTooLong);
+};
+
+
+exports.unsupportedMediaType = function (message, data) {
+
+ return internals.create(415, message, data, exports.unsupportedMediaType);
+};
+
+
+exports.rangeNotSatisfiable = function (message, data) {
+
+ return internals.create(416, message, data, exports.rangeNotSatisfiable);
+};
+
+
+exports.expectationFailed = function (message, data) {
+
+ return internals.create(417, message, data, exports.expectationFailed);
+};
+
+exports.badData = function (message, data) {
+
+ return internals.create(422, message, data, exports.badData);
+};
+
+
+exports.tooManyRequests = function (message, data) {
+
+ return internals.create(429, message, data, exports.tooManyRequests);
+};
+
+
+// 5xx Server Errors
+
+exports.internal = function (message, data, statusCode) {
+
+ return internals.serverError(message, data, statusCode, exports.internal);
+};
+
+internals.serverError = function (message, data, statusCode, ctor) {
+
+ var error;
+ if (data instanceof Error) {
+ error = exports.wrap(data, statusCode, message);
+ } else {
+ error = internals.create(statusCode || 500, message, ctor);
+ error.data = data;
+ }
+
+ return error;
+};
+
+
+exports.notImplemented = function (message, data) {
+
+ return internals.serverError(message, data, 501, exports.notImplemented);
+};
+
+
+exports.badGateway = function (message, data) {
+
+ return internals.serverError(message, data, 502, exports.badGateway);
+};
+
+
+exports.serverTimeout = function (message, data) {
+
+ return internals.serverError(message, data, 503, exports.serverTimeout);
+};
+
+
+exports.gatewayTimeout = function (message, data) {
+
+ return internals.serverError(message, data, 504, exports.gatewayTimeout);
+};
+
+
+exports.badImplementation = function (message, data) {
+
+ var err = internals.serverError(message, data, 500, exports.badImplementation);
+ err.isDeveloperError = true;
+ return err;
+};
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/package.json b/node_modules/request/node_modules/hawk/node_modules/boom/package.json
new file mode 100644
index 000000000..c9d3f09b6
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/boom/package.json
@@ -0,0 +1,64 @@
+{
+ "name": "boom",
+ "description": "HTTP-friendly error objects",
+ "version": "2.9.0",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/hapijs/boom.git"
+ },
+ "main": "lib/index.js",
+ "keywords": [
+ "error",
+ "http"
+ ],
+ "engines": {
+ "node": ">=0.10.40"
+ },
+ "dependencies": {
+ "hoek": "2.x.x"
+ },
+ "devDependencies": {
+ "code": "1.x.x",
+ "lab": "5.x.x"
+ },
+ "scripts": {
+ "test": "lab -a code -t 100 -L",
+ "test-cov-html": "lab -a code -r html -o coverage.html -L"
+ },
+ "license": "BSD-3-Clause",
+ "gitHead": "2ffee0e9d9868140911d30c7acfd7925e534623e",
+ "bugs": {
+ "url": "https://github.com/hapijs/boom/issues"
+ },
+ "homepage": "https://github.com/hapijs/boom#readme",
+ "_id": "boom@2.9.0",
+ "_shasum": "a54b7fd2fee477d351bf9e371680cbea67f12715",
+ "_from": "boom@>=2.8.0 <3.0.0",
+ "_npmVersion": "2.11.1",
+ "_nodeVersion": "0.10.40",
+ "_npmUser": {
+ "name": "arb",
+ "email": "arbretz@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ },
+ {
+ "name": "wyatt",
+ "email": "wpreul@gmail.com"
+ },
+ {
+ "name": "arb",
+ "email": "arbretz@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "a54b7fd2fee477d351bf9e371680cbea67f12715",
+ "tarball": "http://registry.npmjs.org/boom/-/boom-2.9.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/boom/-/boom-2.9.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js b/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js
new file mode 100755
index 000000000..6c261ac07
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js
@@ -0,0 +1,616 @@
+// Load modules
+
+var Util = require('util');
+var Code = require('code');
+var Boom = require('../lib');
+var Lab = require('lab');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.describe;
+var it = lab.it;
+var expect = Code.expect;
+
+
+it('returns the same object when already boom', function (done) {
+
+ var error = Boom.badRequest();
+ var wrapped = Boom.wrap(error);
+ expect(error).to.equal(wrapped);
+ done();
+});
+
+it('returns an error with info when constructed using another error', function (done) {
+
+ var error = new Error('ka-boom');
+ error.xyz = 123;
+ var err = Boom.wrap(error);
+ expect(err.xyz).to.equal(123);
+ expect(err.message).to.equal('ka-boom');
+ expect(err.output).to.deep.equal({
+ statusCode: 500,
+ payload: {
+ statusCode: 500,
+ error: 'Internal Server Error',
+ message: 'An internal server error occurred'
+ },
+ headers: {}
+ });
+ expect(err.data).to.equal(null);
+ done();
+});
+
+it('does not override data when constructed using another error', function (done) {
+
+ var error = new Error('ka-boom');
+ error.data = { useful: 'data' };
+ var err = Boom.wrap(error);
+ expect(err.data).to.equal(error.data);
+ done();
+});
+
+it('sets new message when none exists', function (done) {
+
+ var error = new Error();
+ var wrapped = Boom.wrap(error, 400, 'something bad');
+ expect(wrapped.message).to.equal('something bad');
+ done();
+});
+
+it('throws when statusCode is not a number', function (done) {
+
+ expect(function () {
+
+ Boom.create('x');
+ }).to.throw('First argument must be a number (400+): x');
+ done();
+});
+
+it('will cast a number-string to an integer', function (done) {
+
+ var codes = [
+ { input: '404', result: 404 },
+ { input: '404.1', result: 404 },
+ { input: 400, result: 400 },
+ { input: 400.123, result: 400 }];
+ for (var i = 0, il = codes.length; i < il; ++i) {
+ var code = codes[i];
+ var err = Boom.create(code.input);
+ expect(err.output.statusCode).to.equal(code.result);
+ }
+
+ done();
+});
+
+it('throws when statusCode is not finite', function (done) {
+
+ expect(function () {
+
+ Boom.create(1 / 0);
+ }).to.throw('First argument must be a number (400+): null');
+ done();
+});
+
+it('sets error code to unknown', function (done) {
+
+ var err = Boom.create(999);
+ expect(err.output.payload.error).to.equal('Unknown');
+ done();
+});
+
+describe('create()', function () {
+
+ it('does not sets null message', function (done) {
+
+ var error = Boom.unauthorized(null);
+ expect(error.output.payload.message).to.not.exist();
+ expect(error.isServer).to.be.false();
+ done();
+ });
+
+ it('sets message and data', function (done) {
+
+ var error = Boom.badRequest('Missing data', { type: 'user' });
+ expect(error.data.type).to.equal('user');
+ expect(error.output.payload.message).to.equal('Missing data');
+ done();
+ });
+});
+
+describe('isBoom()', function () {
+
+ it('returns true for Boom object', function (done) {
+
+ expect(Boom.badRequest().isBoom).to.equal(true);
+ done();
+ });
+
+ it('returns false for Error object', function (done) {
+
+ expect((new Error()).isBoom).to.not.exist();
+ done();
+ });
+});
+
+describe('badRequest()', function () {
+
+ it('returns a 400 error statusCode', function (done) {
+
+ var error = Boom.badRequest();
+
+ expect(error.output.statusCode).to.equal(400);
+ expect(error.isServer).to.be.false();
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.badRequest('my message').message).to.equal('my message');
+ done();
+ });
+
+ it('sets the message to HTTP status if none provided', function (done) {
+
+ expect(Boom.badRequest().message).to.equal('Bad Request');
+ done();
+ });
+});
+
+describe('unauthorized()', function () {
+
+ it('returns a 401 error statusCode', function (done) {
+
+ var err = Boom.unauthorized();
+ expect(err.output.statusCode).to.equal(401);
+ expect(err.output.headers).to.deep.equal({});
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.unauthorized('my message').message).to.equal('my message');
+ done();
+ });
+
+ it('returns a WWW-Authenticate header when passed a scheme', function (done) {
+
+ var err = Boom.unauthorized('boom', 'Test');
+ expect(err.output.statusCode).to.equal(401);
+ expect(err.output.headers['WWW-Authenticate']).to.equal('Test error="boom"');
+ done();
+ });
+
+ it('returns a WWW-Authenticate header set to the schema array value', function (done) {
+
+ var err = Boom.unauthorized(null, ['Test','one','two']);
+ expect(err.output.statusCode).to.equal(401);
+ expect(err.output.headers['WWW-Authenticate']).to.equal('Test, one, two');
+ done();
+ });
+
+ it('returns a WWW-Authenticate header when passed a scheme and attributes', function (done) {
+
+ var err = Boom.unauthorized('boom', 'Test', { a: 1, b: 'something', c: null, d: 0 });
+ expect(err.output.statusCode).to.equal(401);
+ expect(err.output.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0", error="boom"');
+ expect(err.output.payload.attributes).to.deep.equal({ a: 1, b: 'something', c: '', d: 0, error: 'boom' });
+ done();
+ });
+
+ it('returns a WWW-Authenticate header when passed attributes, missing error', function (done) {
+
+ var err = Boom.unauthorized(null, 'Test', { a: 1, b: 'something', c: null, d: 0 });
+ expect(err.output.statusCode).to.equal(401);
+ expect(err.output.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0"');
+ expect(err.isMissing).to.equal(true);
+ done();
+ });
+
+ it('sets the isMissing flag when error message is empty', function (done) {
+
+ var err = Boom.unauthorized('', 'Basic');
+ expect(err.isMissing).to.equal(true);
+ done();
+ });
+
+ it('does not set the isMissing flag when error message is not empty', function (done) {
+
+ var err = Boom.unauthorized('message', 'Basic');
+ expect(err.isMissing).to.equal(undefined);
+ done();
+ });
+
+ it('sets a WWW-Authenticate when passed as an array', function (done) {
+
+ var err = Boom.unauthorized('message', ['Basic', 'Example e="1"', 'Another x="3", y="4"']);
+ expect(err.output.headers['WWW-Authenticate']).to.equal('Basic, Example e="1", Another x="3", y="4"');
+ done();
+ });
+});
+
+
+describe('methodNotAllowed()', function () {
+
+ it('returns a 405 error statusCode', function (done) {
+
+ expect(Boom.methodNotAllowed().output.statusCode).to.equal(405);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.methodNotAllowed('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('notAcceptable()', function () {
+
+ it('returns a 406 error statusCode', function (done) {
+
+ expect(Boom.notAcceptable().output.statusCode).to.equal(406);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.notAcceptable('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('proxyAuthRequired()', function () {
+
+ it('returns a 407 error statusCode', function (done) {
+
+ expect(Boom.proxyAuthRequired().output.statusCode).to.equal(407);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.proxyAuthRequired('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('clientTimeout()', function () {
+
+ it('returns a 408 error statusCode', function (done) {
+
+ expect(Boom.clientTimeout().output.statusCode).to.equal(408);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.clientTimeout('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('conflict()', function () {
+
+ it('returns a 409 error statusCode', function (done) {
+
+ expect(Boom.conflict().output.statusCode).to.equal(409);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.conflict('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('resourceGone()', function () {
+
+ it('returns a 410 error statusCode', function (done) {
+
+ expect(Boom.resourceGone().output.statusCode).to.equal(410);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.resourceGone('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('lengthRequired()', function () {
+
+ it('returns a 411 error statusCode', function (done) {
+
+ expect(Boom.lengthRequired().output.statusCode).to.equal(411);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.lengthRequired('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('preconditionFailed()', function () {
+
+ it('returns a 412 error statusCode', function (done) {
+
+ expect(Boom.preconditionFailed().output.statusCode).to.equal(412);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.preconditionFailed('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('entityTooLarge()', function () {
+
+ it('returns a 413 error statusCode', function (done) {
+
+ expect(Boom.entityTooLarge().output.statusCode).to.equal(413);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.entityTooLarge('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('uriTooLong()', function () {
+
+ it('returns a 414 error statusCode', function (done) {
+
+ expect(Boom.uriTooLong().output.statusCode).to.equal(414);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.uriTooLong('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('unsupportedMediaType()', function () {
+
+ it('returns a 415 error statusCode', function (done) {
+
+ expect(Boom.unsupportedMediaType().output.statusCode).to.equal(415);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.unsupportedMediaType('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('rangeNotSatisfiable()', function () {
+
+ it('returns a 416 error statusCode', function (done) {
+
+ expect(Boom.rangeNotSatisfiable().output.statusCode).to.equal(416);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.rangeNotSatisfiable('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('expectationFailed()', function () {
+
+ it('returns a 417 error statusCode', function (done) {
+
+ expect(Boom.expectationFailed().output.statusCode).to.equal(417);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.expectationFailed('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('badData()', function () {
+
+ it('returns a 422 error statusCode', function (done) {
+
+ expect(Boom.badData().output.statusCode).to.equal(422);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.badData('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('tooManyRequests()', function () {
+
+ it('returns a 429 error statusCode', function (done) {
+
+ expect(Boom.tooManyRequests().output.statusCode).to.equal(429);
+ done();
+ });
+
+ it('sets the message with the passed-in message', function (done) {
+
+ expect(Boom.tooManyRequests('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+describe('serverTimeout()', function () {
+
+ it('returns a 503 error statusCode', function (done) {
+
+ expect(Boom.serverTimeout().output.statusCode).to.equal(503);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.serverTimeout('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+describe('forbidden()', function () {
+
+ it('returns a 403 error statusCode', function (done) {
+
+ expect(Boom.forbidden().output.statusCode).to.equal(403);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.forbidden('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+describe('notFound()', function () {
+
+ it('returns a 404 error statusCode', function (done) {
+
+ expect(Boom.notFound().output.statusCode).to.equal(404);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.notFound('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+describe('internal()', function () {
+
+ it('returns a 500 error statusCode', function (done) {
+
+ expect(Boom.internal().output.statusCode).to.equal(500);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ var err = Boom.internal('my message');
+ expect(err.message).to.equal('my message');
+ expect(err.isServer).to.true();
+ expect(err.output.payload.message).to.equal('An internal server error occurred');
+ done();
+ });
+
+ it('passes data on the callback if its passed in', function (done) {
+
+ expect(Boom.internal('my message', { my: 'data' }).data.my).to.equal('data');
+ done();
+ });
+
+ it('returns an error with composite message', function (done) {
+
+ try {
+ JSON.parse('{');
+ }
+ catch (err) {
+ var boom = Boom.internal('Someting bad', err);
+ expect(boom.message).to.equal('Someting bad: Unexpected end of input');
+ expect(boom.isServer).to.be.true();
+ done();
+ }
+ });
+});
+
+describe('notImplemented()', function () {
+
+ it('returns a 501 error statusCode', function (done) {
+
+ expect(Boom.notImplemented().output.statusCode).to.equal(501);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.notImplemented('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+
+describe('badGateway()', function () {
+
+ it('returns a 502 error statusCode', function (done) {
+
+ expect(Boom.badGateway().output.statusCode).to.equal(502);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.badGateway('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+describe('gatewayTimeout()', function () {
+
+ it('returns a 504 error statusCode', function (done) {
+
+ expect(Boom.gatewayTimeout().output.statusCode).to.equal(504);
+ done();
+ });
+
+ it('sets the message with the passed in message', function (done) {
+
+ expect(Boom.gatewayTimeout('my message').message).to.equal('my message');
+ done();
+ });
+});
+
+describe('badImplementation()', function () {
+
+ it('returns a 500 error statusCode', function (done) {
+
+ var err = Boom.badImplementation();
+ expect(err.output.statusCode).to.equal(500);
+ expect(err.isDeveloperError).to.equal(true);
+ expect(err.isServer).to.be.true();
+ done();
+ });
+});
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore b/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore
new file mode 100644
index 000000000..b3bb51763
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore
@@ -0,0 +1,18 @@
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml b/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml
new file mode 100755
index 000000000..4d8269258
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml
@@ -0,0 +1,8 @@
+language: node_js
+
+node_js:
+ - 0.10
+ - 4.0
+
+sudo: false
+
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE b/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE
new file mode 100755
index 000000000..cda44736a
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE
@@ -0,0 +1,28 @@
+Copyright (c) 2014, Eran Hammer and other contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The names of any contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ * * *
+
+The complete list of contributors can be found at: https://github.com/hueniverse/cryptiles/graphs/contributors
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md b/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md
new file mode 100644
index 000000000..400830501
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md
@@ -0,0 +1,16 @@
+cryptiles
+=========
+
+General purpose crypto utilities
+
+[![Build Status](https://secure.travis-ci.org/hapijs/cryptiles.png)](http://travis-ci.org/hapijs/cryptiles)
+
+Lead Maintainer - [C J Silverio](https://github.com/ceejbot)
+
+## Methods
+
+### `randomString(<Number> size)`
+Returns a cryptographically strong pseudo-random data string. Takes a size argument for the length of the string.
+
+### `fixedTimeComparison(<String> a, <String> b)`
+Compare two strings using fixed time algorithm (to prevent time-based analysis of MAC digest match). Returns `true` if the strings match, `false` if they differ.
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js b/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js
new file mode 100755
index 000000000..f385870ee
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js
@@ -0,0 +1,68 @@
+// Load modules
+
+var Crypto = require('crypto');
+var Boom = require('boom');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Generate a cryptographically strong pseudo-random data
+
+exports.randomString = function (size) {
+
+ var buffer = exports.randomBits((size + 1) * 6);
+ if (buffer instanceof Error) {
+ return buffer;
+ }
+
+ var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
+ return string.slice(0, size);
+};
+
+
+exports.randomBits = function (bits) {
+
+ if (!bits ||
+ bits < 0) {
+
+ return Boom.internal('Invalid random bits count');
+ }
+
+ var bytes = Math.ceil(bits / 8);
+ try {
+ return Crypto.randomBytes(bytes);
+ }
+ catch (err) {
+ return Boom.internal('Failed generating random bits: ' + err.message);
+ }
+};
+
+
+// Compare two strings using fixed time algorithm (to prevent time-based analysis of MAC digest match)
+
+exports.fixedTimeComparison = function (a, b) {
+
+ if (typeof a !== 'string' ||
+ typeof b !== 'string') {
+
+ return false;
+ }
+
+ var mismatch = (a.length === b.length ? 0 : 1);
+ if (mismatch) {
+ b = a;
+ }
+
+ for (var i = 0, il = a.length; i < il; ++i) {
+ var ac = a.charCodeAt(i);
+ var bc = b.charCodeAt(i);
+ mismatch |= (ac ^ bc);
+ }
+
+ return (mismatch === 0);
+};
+
+
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json b/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json
new file mode 100644
index 000000000..c65fd0940
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json
@@ -0,0 +1,61 @@
+{
+ "name": "cryptiles",
+ "description": "General purpose crypto utilities",
+ "version": "2.0.5",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/hapijs/cryptiles.git"
+ },
+ "main": "lib/index.js",
+ "keywords": [
+ "cryptography",
+ "security",
+ "utilites"
+ ],
+ "engines": {
+ "node": ">=0.10.40"
+ },
+ "dependencies": {
+ "boom": "2.x.x"
+ },
+ "devDependencies": {
+ "code": "1.x.x",
+ "lab": "5.x.x"
+ },
+ "scripts": {
+ "test": "lab -a code -t 100 -L",
+ "test-cov-html": "lab -a code -r html -o coverage.html"
+ },
+ "license": "BSD-3-Clause",
+ "gitHead": "9bc5a852f01cd51e615814e1cb255fe2df810649",
+ "bugs": {
+ "url": "https://github.com/hapijs/cryptiles/issues"
+ },
+ "homepage": "https://github.com/hapijs/cryptiles#readme",
+ "_id": "cryptiles@2.0.5",
+ "_shasum": "3bdfecdc608147c1c67202fa291e7dca59eaa3b8",
+ "_from": "cryptiles@>=2.0.0 <3.0.0",
+ "_npmVersion": "2.14.2",
+ "_nodeVersion": "4.0.0",
+ "_npmUser": {
+ "name": "hueniverse",
+ "email": "eran@hammer.io"
+ },
+ "dist": {
+ "shasum": "3bdfecdc608147c1c67202fa291e7dca59eaa3b8",
+ "tarball": "http://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ },
+ {
+ "name": "ceejbot",
+ "email": "ceejceej@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js b/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js
new file mode 100755
index 000000000..170393f9b
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js
@@ -0,0 +1,102 @@
+// Load modules
+
+var Code = require('code');
+var Cryptiles = require('..');
+var Lab = require('lab');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.describe;
+var it = lab.it;
+var expect = Code.expect;
+
+
+describe('randomString()', function () {
+
+ it('should generate the right length string', function (done) {
+
+ for (var i = 1; i <= 1000; ++i) {
+ expect(Cryptiles.randomString(i).length).to.equal(i);
+ }
+
+ done();
+ });
+
+ it('returns an error on invalid bits size', function (done) {
+
+ expect(Cryptiles.randomString(99999999999999999999).message).to.match(/Failed generating random bits/);
+ done();
+ });
+});
+
+describe('randomBits()', function () {
+
+ it('returns an error on invalid input', function (done) {
+
+ expect(Cryptiles.randomBits(0).message).to.equal('Invalid random bits count');
+ done();
+ });
+});
+
+describe('fixedTimeComparison()', function () {
+
+ var a = Cryptiles.randomString(50000);
+ var b = Cryptiles.randomString(150000);
+
+ it('should take the same amount of time comparing different string sizes', function (done) {
+
+ var now = Date.now();
+ Cryptiles.fixedTimeComparison(b, a);
+ var t1 = Date.now() - now;
+
+ now = Date.now();
+ Cryptiles.fixedTimeComparison(b, b);
+ var t2 = Date.now() - now;
+
+ expect(t2 - t1).to.be.within(-20, 20);
+ done();
+ });
+
+ it('should return true for equal strings', function (done) {
+
+ expect(Cryptiles.fixedTimeComparison(a, a)).to.equal(true);
+ done();
+ });
+
+ it('should return false for different strings (size, a < b)', function (done) {
+
+ expect(Cryptiles.fixedTimeComparison(a, a + 'x')).to.equal(false);
+ done();
+ });
+
+ it('should return false for different strings (size, a > b)', function (done) {
+
+ expect(Cryptiles.fixedTimeComparison(a + 'x', a)).to.equal(false);
+ done();
+ });
+
+ it('should return false for different strings (size, a = b)', function (done) {
+
+ expect(Cryptiles.fixedTimeComparison(a + 'x', a + 'y')).to.equal(false);
+ done();
+ });
+
+ it('should return false when not a string', function (done) {
+
+ expect(Cryptiles.fixedTimeComparison('x', null)).to.equal(false);
+ done();
+ });
+
+ it('should return false when not a string (left)', function (done) {
+
+ expect(Cryptiles.fixedTimeComparison(null, 'x')).to.equal(false);
+ done();
+ });
+});
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore b/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore
new file mode 100644
index 000000000..7e1574dc5
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore
@@ -0,0 +1,18 @@
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+complexity.md
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml b/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml
new file mode 100644
index 000000000..7a64dd221
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml
@@ -0,0 +1,7 @@
+language: node_js
+
+node_js:
+ - 0.10
+ - 4.0
+
+sudo: false
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/CONTRIBUTING.md b/node_modules/request/node_modules/hawk/node_modules/hoek/CONTRIBUTING.md
new file mode 100644
index 000000000..892836159
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/CONTRIBUTING.md
@@ -0,0 +1 @@
+Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md).
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE b/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE
new file mode 100644
index 000000000..553090425
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE
@@ -0,0 +1,31 @@
+Copyright (c) 2011-2014, Walmart and other contributors.
+Copyright (c) 2011, Yahoo Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The names of any contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ * * *
+
+The complete list of contributors can be found at: https://github.com/hapijs/hapi/graphs/contributors
+Portions of this project were initially based on the Yahoo! Inc. Postmile project,
+published at https://github.com/yahoo/postmile.
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/README.md b/node_modules/request/node_modules/hawk/node_modules/hoek/README.md
new file mode 100644
index 000000000..92c4912c7
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/README.md
@@ -0,0 +1,584 @@
+![hoek Logo](https://raw.github.com/hapijs/hoek/master/images/hoek.png)
+
+Utility methods for the hapi ecosystem. This module is not intended to solve every problem for everyone, but rather as a central place to store hapi-specific methods. If you're looking for a general purpose utility module, check out [lodash](https://github.com/lodash/lodash) or [underscore](https://github.com/jashkenas/underscore).
+
+[![Build Status](https://secure.travis-ci.org/hapijs/hoek.svg)](http://travis-ci.org/hapijs/hoek)
+
+Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf)
+
+# Table of Contents
+
+* [Introduction](#introduction "Introduction")
+* [Object](#object "Object")
+ * [clone](#cloneobj "clone")
+ * [cloneWithShallow](#clonewithshallowobj-keys "cloneWithShallow")
+ * [merge](#mergetarget-source-isnulloverride-ismergearrays "merge")
+ * [applyToDefaults](#applytodefaultsdefaults-options-isnulloverride "applyToDefaults")
+ * [applyToDefaultsWithShallow](#applytodefaultswithshallowdefaults-options-keys "applyToDefaultsWithShallow")
+ * [deepEqual](#deepequala-b "deepEqual")
+ * [unique](#uniquearray-key "unique")
+ * [mapToObject](#maptoobjectarray-key "mapToObject")
+ * [intersect](#intersectarray1-array2 "intersect")
+ * [contain](#containref-values-options "contain")
+ * [flatten](#flattenarray-target "flatten")
+ * [reach](#reachobj-chain-options "reach")
+ * [reachTemplate](#reachtemplateobj-template-options "reachTemplate")
+ * [transform](#transformobj-transform-options "transform")
+ * [shallow](#shallowobj "shallow")
+ * [stringify](#stringifyobj "stringify")
+* [Timer](#timer "Timer")
+* [Bench](#bench "Bench")
+* [Binary Encoding/Decoding](#binary-encodingdecoding "Binary Encoding/Decoding")
+ * [base64urlEncode](#base64urlencodevalue "binary64urlEncode")
+ * [base64urlDecode](#base64urldecodevalue "binary64urlDecode")
+* [Escaping Characters](#escaping-characters "Escaping Characters")
+ * [escapeHtml](#escapehtmlstring "escapeHtml")
+ * [escapeHeaderAttribute](#escapeheaderattributeattribute "escapeHeaderAttribute")
+ * [escapeRegex](#escaperegexstring "escapeRegex")
+* [Errors](#errors "Errors")
+ * [assert](#assertcondition-message "assert")
+ * [abort](#abortmessage "abort")
+ * [displayStack](#displaystackslice "displayStack")
+ * [callStack](#callstackslice "callStack")
+* [Function](#function "Function")
+ * [nextTick](#nexttickfn "nextTick")
+ * [once](#oncefn "once")
+ * [ignore](#ignore "ignore")
+* [Miscellaneous](#miscellaneous "Miscellaneous")
+ * [uniqueFilename](#uniquefilenamepath-extension "uniqueFilename")
+ * [isAbsolutePath](#isabsolutepathpath-platform "isAbsolutePath")
+ * [isInteger](#isintegervalue "isInteger")
+
+
+
+# Introduction
+
+The *Hoek* library contains some common functions used within the hapi ecosystem. It comes with useful methods for Arrays (clone, merge, applyToDefaults), Objects (removeKeys, copy), Asserting and more.
+
+For example, to use Hoek to set configuration with default options:
+```javascript
+var Hoek = require('hoek');
+
+var default = {url : "www.github.com", port : "8000", debug : true};
+
+var config = Hoek.applyToDefaults(default, {port : "3000", admin : true});
+
+// In this case, config would be { url: 'www.github.com', port: '3000', debug: true, admin: true }
+```
+
+Under each of the sections (such as Array), there are subsections which correspond to Hoek methods. Each subsection will explain how to use the corresponding method. In each js excerpt below, the `var Hoek = require('hoek');` is omitted for brevity.
+
+## Object
+
+Hoek provides several helpful methods for objects and arrays.
+
+### clone(obj)
+
+This method is used to clone an object or an array. A *deep copy* is made (duplicates everything, including values that are objects, as well as non-enumerable properties).
+
+```javascript
+
+var nestedObj = {
+ w: /^something$/ig,
+ x: {
+ a: [1, 2, 3],
+ b: 123456,
+ c: new Date()
+ },
+ y: 'y',
+ z: new Date()
+ };
+
+var copy = Hoek.clone(nestedObj);
+
+copy.x.b = 100;
+
+console.log(copy.y); // results in 'y'
+console.log(nestedObj.x.b); // results in 123456
+console.log(copy.x.b); // results in 100
+```
+
+### cloneWithShallow(obj, keys)
+keys is an array of key names to shallow copy
+
+This method is also used to clone an object or array, however any keys listed in the `keys` array are shallow copied while those not listed are deep copied.
+
+```javascript
+
+var nestedObj = {
+ w: /^something$/ig,
+ x: {
+ a: [1, 2, 3],
+ b: 123456,
+ c: new Date()
+ },
+ y: 'y',
+ z: new Date()
+ };
+
+var copy = Hoek.cloneWithShallow(nestedObj, ['x']);
+
+copy.x.b = 100;
+
+console.log(copy.y); // results in 'y'
+console.log(nestedObj.x.b); // results in 100
+console.log(copy.x.b); // results in 100
+```
+
+### merge(target, source, isNullOverride, isMergeArrays)
+isNullOverride, isMergeArrays default to true
+
+Merge all the properties of source into target, source wins in conflict, and by default null and undefined from source are applied.
+Merge is destructive where the target is modified. For non destructive merge, use `applyToDefaults`.
+
+
+```javascript
+
+var target = {a: 1, b : 2};
+var source = {a: 0, c: 5};
+var source2 = {a: null, c: 5};
+
+Hoek.merge(target, source); // results in {a: 0, b: 2, c: 5}
+Hoek.merge(target, source2); // results in {a: null, b: 2, c: 5}
+Hoek.merge(target, source2, false); // results in {a: 1, b: 2, c: 5}
+
+var targetArray = [1, 2, 3];
+var sourceArray = [4, 5];
+
+Hoek.merge(targetArray, sourceArray); // results in [1, 2, 3, 4, 5]
+Hoek.merge(targetArray, sourceArray, true, false); // results in [4, 5]
+```
+
+### applyToDefaults(defaults, options, isNullOverride)
+isNullOverride defaults to false
+
+Apply options to a copy of the defaults
+
+```javascript
+
+var defaults = { host: "localhost", port: 8000 };
+var options = { port: 8080 };
+
+var config = Hoek.applyToDefaults(defaults, options); // results in { host: "localhost", port: 8080 }
+```
+
+Apply options with a null value to a copy of the defaults
+
+```javascript
+
+var defaults = { host: "localhost", port: 8000 };
+var options = { host: null, port: 8080 };
+
+var config = Hoek.applyToDefaults(defaults, options, true); // results in { host: null, port: 8080 }
+```
+
+### applyToDefaultsWithShallow(defaults, options, keys)
+keys is an array of key names to shallow copy
+
+Apply options to a copy of the defaults. Keys specified in the last parameter are shallow copied from options instead of merged.
+
+```javascript
+
+var defaults = {
+ server: {
+ host: "localhost",
+ port: 8000
+ },
+ name: 'example'
+ };
+
+var options = { server: { port: 8080 } };
+
+var config = Hoek.applyToDefaultsWithShallow(defaults, options, ['server']); // results in { server: { port: 8080 }, name: 'example' }
+```
+
+### deepEqual(b, a, [options])
+
+Performs a deep comparison of the two values including support for circular dependencies, prototype, and properties. To skip prototype comparisons, use `options.prototype = false`
+
+```javascript
+Hoek.deepEqual({ a: [1, 2], b: 'string', c: { d: true } }, { a: [1, 2], b: 'string', c: { d: true } }); //results in true
+Hoek.deepEqual(Object.create(null), {}, { prototype: false }); //results in true
+Hoek.deepEqual(Object.create(null), {}); //results in false
+```
+
+### unique(array, key)
+
+Remove duplicate items from Array
+
+```javascript
+
+var array = [1, 2, 2, 3, 3, 4, 5, 6];
+
+var newArray = Hoek.unique(array); // results in [1,2,3,4,5,6]
+
+array = [{id: 1}, {id: 1}, {id: 2}];
+
+newArray = Hoek.unique(array, "id"); // results in [{id: 1}, {id: 2}]
+```
+
+### mapToObject(array, key)
+
+Convert an Array into an Object
+
+```javascript
+
+var array = [1,2,3];
+var newObject = Hoek.mapToObject(array); // results in [{"1": true}, {"2": true}, {"3": true}]
+
+array = [{id: 1}, {id: 2}];
+newObject = Hoek.mapToObject(array, "id"); // results in [{"id": 1}, {"id": 2}]
+```
+
+### intersect(array1, array2)
+
+Find the common unique items in two arrays
+
+```javascript
+
+var array1 = [1, 2, 3];
+var array2 = [1, 4, 5];
+
+var newArray = Hoek.intersect(array1, array2); // results in [1]
+```
+
+### contain(ref, values, [options])
+
+Tests if the reference value contains the provided values where:
+- `ref` - the reference string, array, or object.
+- `values` - a single or array of values to find within the `ref` value. If `ref` is an object, `values` can be a key name,
+ an array of key names, or an object with key-value pairs to compare.
+- `options` - an optional object with the following optional settings:
+ - `deep` - if `true`, performed a deep comparison of the values.
+ - `once` - if `true`, allows only one occurrence of each value.
+ - `only` - if `true`, does not allow values not explicitly listed.
+ - `part` - if `true`, allows partial match of the values (at least one must always match).
+
+Note: comparing a string to overlapping values will result in failed comparison (e.g. `contain('abc', ['ab', 'bc'])`).
+Also, if an object key's value does not match the provided value, `false` is returned even when `part` is specified.
+
+```javascript
+Hoek.contain('aaa', 'a', { only: true }); // true
+Hoek.contain([{ a: 1 }], [{ a: 1 }], { deep: true }); // true
+Hoek.contain([1, 2, 2], [1, 2], { once: true }); // false
+Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 }, { part: true }); // true
+```
+
+### flatten(array, [target])
+
+Flatten an array
+
+```javascript
+
+var array = [1, [2, 3]];
+
+var flattenedArray = Hoek.flatten(array); // results in [1, 2, 3]
+
+array = [1, [2, 3]];
+target = [4, [5]];
+
+flattenedArray = Hoek.flatten(array, target); // results in [4, [5], 1, 2, 3]
+```
+
+### reach(obj, chain, [options])
+
+Converts an object key chain string to reference
+
+- `options` - optional settings
+ - `separator` - string to split chain path on, defaults to '.'
+ - `default` - value to return if the path or value is not present, default is `undefined`
+ - `strict` - if `true`, will throw an error on missing member, default is `false`
+ - `functions` - if `true` allow traversing functions for properties. `false` will throw an error if a function is part of the chain.
+
+A chain including negative numbers will work like negative indices on an
+array.
+
+If chain is `null`, `undefined` or `false`, the object itself will be returned.
+
+```javascript
+
+var chain = 'a.b.c';
+var obj = {a : {b : { c : 1}}};
+
+Hoek.reach(obj, chain); // returns 1
+
+var chain = 'a.b.-1';
+var obj = {a : {b : [2,3,6]}};
+
+Hoek.reach(obj, chain); // returns 6
+```
+
+### reachTemplate(obj, template, [options])
+
+Replaces string parameters (`{name}`) with their corresponding object key values by applying the
+(`reach()`)[#reachobj-chain-options] method where:
+
+- `obj` - the context object used for key lookup.
+- `template` - a string containing `{}` parameters.
+- `options` - optional (`reach()`)[#reachobj-chain-options] options.
+
+```javascript
+
+var chain = 'a.b.c';
+var obj = {a : {b : { c : 1}}};
+
+Hoek.reachTemplate(obj, '1+{a.b.c}=2'); // returns '1+1=2'
+```
+
+### transform(obj, transform, [options])
+
+Transforms an existing object into a new one based on the supplied `obj` and `transform` map. `options` are the same as the `reach` options. The first argument can also be an array of objects. In that case the method will return an array of transformed objects.
+
+```javascript
+var source = {
+ address: {
+ one: '123 main street',
+ two: 'PO Box 1234'
+ },
+ title: 'Warehouse',
+ state: 'CA'
+};
+
+var result = Hoek.transform(source, {
+ 'person.address.lineOne': 'address.one',
+ 'person.address.lineTwo': 'address.two',
+ 'title': 'title',
+ 'person.address.region': 'state'
+});
+// Results in
+// {
+// person: {
+// address: {
+// lineOne: '123 main street',
+// lineTwo: 'PO Box 1234',
+// region: 'CA'
+// }
+// },
+// title: 'Warehouse'
+// }
+```
+
+### shallow(obj)
+
+Performs a shallow copy by copying the references of all the top level children where:
+- `obj` - the object to be copied.
+
+```javascript
+var shallow = Hoek.shallow({ a: { b: 1 } });
+```
+
+### stringify(obj)
+
+Converts an object to string using the built-in `JSON.stringify()` method with the difference that any errors are caught
+and reported back in the form of the returned string. Used as a shortcut for displaying information to the console (e.g. in
+error message) without the need to worry about invalid conversion.
+
+```javascript
+var a = {};
+a.b = a;
+Hoek.stringify(a); // Returns '[Cannot display object: Converting circular structure to JSON]'
+```
+
+# Timer
+
+A Timer object. Initializing a new timer object sets the ts to the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
+
+```javascript
+
+var timerObj = new Hoek.Timer();
+console.log("Time is now: " + timerObj.ts);
+console.log("Elapsed time from initialization: " + timerObj.elapsed() + 'milliseconds');
+```
+
+
+# Bench
+
+Same as Timer with the exception that `ts` stores the internal node clock which is not related to `Date.now()` and cannot be used to display
+human-readable timestamps. More accurate for benchmarking or internal timers.
+
+# Binary Encoding/Decoding
+
+### base64urlEncode(value)
+
+Encodes value in Base64 or URL encoding
+
+### base64urlDecode(value)
+
+Decodes data in Base64 or URL encoding.
+# Escaping Characters
+
+Hoek provides convenient methods for escaping html characters. The escaped characters are as followed:
+
+```javascript
+
+internals.htmlEscaped = {
+ '&': '&amp;',
+ '<': '&lt;',
+ '>': '&gt;',
+ '"': '&quot;',
+ "'": '&#x27;',
+ '`': '&#x60;'
+};
+```
+
+### escapeHtml(string)
+
+```javascript
+
+var string = '<html> hey </html>';
+var escapedString = Hoek.escapeHtml(string); // returns &lt;html&gt; hey &lt;/html&gt;
+```
+
+### escapeHeaderAttribute(attribute)
+
+Escape attribute value for use in HTTP header
+
+```javascript
+
+var a = Hoek.escapeHeaderAttribute('I said "go w\\o me"'); //returns I said \"go w\\o me\"
+```
+
+
+### escapeRegex(string)
+
+Escape string for Regex construction
+
+```javascript
+
+var a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\/`"(>)[<]d{}s,'); // returns 4\^f\$s\.4\*5\+\-_\?%\=#\!\:@\|~\\\/`"\(>\)\[<\]d\{\}s\,
+```
+
+# Errors
+
+### assert(condition, message)
+
+```javascript
+
+var a = 1, b = 2;
+
+Hoek.assert(a === b, 'a should equal b'); // Throws 'a should equal b'
+```
+
+Note that you may also pass an already created Error object as the second parameter, and `assert` will throw that object.
+
+```javascript
+
+var a = 1, b = 2;
+
+Hoek.assert(a === b, new Error('a should equal b')); // Throws the given error object
+```
+
+### abort(message)
+
+First checks if `process.env.NODE_ENV === 'test'`, and if so, throws error message. Otherwise,
+displays most recent stack and then exits process.
+
+
+
+### displayStack(slice)
+
+Displays the trace stack
+
+```javascript
+
+var stack = Hoek.displayStack();
+console.log(stack); // returns something like:
+
+[ 'null (/Users/user/Desktop/hoek/test.js:4:18)',
+ 'Module._compile (module.js:449:26)',
+ 'Module._extensions..js (module.js:467:10)',
+ 'Module.load (module.js:356:32)',
+ 'Module._load (module.js:312:12)',
+ 'Module.runMain (module.js:492:10)',
+ 'startup.processNextTick.process._tickCallback (node.js:244:9)' ]
+```
+
+### callStack(slice)
+
+Returns a trace stack array.
+
+```javascript
+
+var stack = Hoek.callStack();
+console.log(stack); // returns something like:
+
+[ [ '/Users/user/Desktop/hoek/test.js', 4, 18, null, false ],
+ [ 'module.js', 449, 26, 'Module._compile', false ],
+ [ 'module.js', 467, 10, 'Module._extensions..js', false ],
+ [ 'module.js', 356, 32, 'Module.load', false ],
+ [ 'module.js', 312, 12, 'Module._load', false ],
+ [ 'module.js', 492, 10, 'Module.runMain', false ],
+ [ 'node.js',
+ 244,
+ 9,
+ 'startup.processNextTick.process._tickCallback',
+ false ] ]
+```
+
+## Function
+
+### nextTick(fn)
+
+Returns a new function that wraps `fn` in `process.nextTick`.
+
+```javascript
+
+var myFn = function () {
+ console.log('Do this later');
+};
+
+var nextFn = Hoek.nextTick(myFn);
+
+nextFn();
+console.log('Do this first');
+
+// Results in:
+//
+// Do this first
+// Do this later
+```
+
+### once(fn)
+
+Returns a new function that can be run multiple times, but makes sure `fn` is only run once.
+
+```javascript
+
+var myFn = function () {
+ console.log('Ran myFn');
+};
+
+var onceFn = Hoek.once(myFn);
+onceFn(); // results in "Ran myFn"
+onceFn(); // results in undefined
+```
+
+### ignore
+
+A simple no-op function. It does nothing at all.
+
+## Miscellaneous
+
+### uniqueFilename(path, extension)
+`path` to prepend with the randomly generated file name. `extension` is the optional file extension, defaults to `''`.
+
+Returns a randomly generated file name at the specified `path`. The result is a fully resolved path to a file.
+
+```javascript
+var result = Hoek.uniqueFilename('./test/modules', 'txt'); // results in "full/path/test/modules/{random}.txt"
+```
+
+### isAbsolutePath(path, [platform])
+
+Determines whether `path` is an absolute path. Returns `true` or `false`.
+
+- `path` - A file path to test for whether it is absolute or not.
+- `platform` - An optional parameter used for specifying the platform. Defaults to `process.platform`.
+
+### isInteger(value)
+
+Check `value` to see if it is an integer. Returns true/false.
+
+```javascript
+var result = Hoek.isInteger('23')
+```
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png b/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png
new file mode 100644
index 000000000..6ccfcb12b
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png
Binary files differ
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js b/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js
new file mode 100644
index 000000000..9ecde6666
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js
@@ -0,0 +1,132 @@
+// Declare internals
+
+var internals = {};
+
+
+exports.escapeJavaScript = function (input) {
+
+ if (!input) {
+ return '';
+ }
+
+ var escaped = '';
+
+ for (var i = 0, il = input.length; i < il; ++i) {
+
+ var charCode = input.charCodeAt(i);
+
+ if (internals.isSafe(charCode)) {
+ escaped += input[i];
+ }
+ else {
+ escaped += internals.escapeJavaScriptChar(charCode);
+ }
+ }
+
+ return escaped;
+};
+
+
+exports.escapeHtml = function (input) {
+
+ if (!input) {
+ return '';
+ }
+
+ var escaped = '';
+
+ for (var i = 0, il = input.length; i < il; ++i) {
+
+ var charCode = input.charCodeAt(i);
+
+ if (internals.isSafe(charCode)) {
+ escaped += input[i];
+ }
+ else {
+ escaped += internals.escapeHtmlChar(charCode);
+ }
+ }
+
+ return escaped;
+};
+
+
+internals.escapeJavaScriptChar = function (charCode) {
+
+ if (charCode >= 256) {
+ return '\\u' + internals.padLeft('' + charCode, 4);
+ }
+
+ var hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex');
+ return '\\x' + internals.padLeft(hexValue, 2);
+};
+
+
+internals.escapeHtmlChar = function (charCode) {
+
+ var namedEscape = internals.namedHtml[charCode];
+ if (typeof namedEscape !== 'undefined') {
+ return namedEscape;
+ }
+
+ if (charCode >= 256) {
+ return '&#' + charCode + ';';
+ }
+
+ var hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex');
+ return '&#x' + internals.padLeft(hexValue, 2) + ';';
+};
+
+
+internals.padLeft = function (str, len) {
+
+ while (str.length < len) {
+ str = '0' + str;
+ }
+
+ return str;
+};
+
+
+internals.isSafe = function (charCode) {
+
+ return (typeof internals.safeCharCodes[charCode] !== 'undefined');
+};
+
+
+internals.namedHtml = {
+ '38': '&amp;',
+ '60': '&lt;',
+ '62': '&gt;',
+ '34': '&quot;',
+ '160': '&nbsp;',
+ '162': '&cent;',
+ '163': '&pound;',
+ '164': '&curren;',
+ '169': '&copy;',
+ '174': '&reg;'
+};
+
+
+internals.safeCharCodes = (function () {
+
+ var safe = {};
+
+ for (var i = 32; i < 123; ++i) {
+
+ if ((i >= 97) || // a-z
+ (i >= 65 && i <= 90) || // A-Z
+ (i >= 48 && i <= 57) || // 0-9
+ i === 32 || // space
+ i === 46 || // .
+ i === 44 || // ,
+ i === 45 || // -
+ i === 58 || // :
+ i === 95) { // _
+
+ safe[i] = null;
+ }
+ }
+
+ return safe;
+}());
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js b/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js
new file mode 100644
index 000000000..9a5ffe18f
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js
@@ -0,0 +1,993 @@
+// Load modules
+
+var Crypto = require('crypto');
+var Path = require('path');
+var Util = require('util');
+var Escape = require('./escape');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Clone object or array
+
+exports.clone = function (obj, seen) {
+
+ if (typeof obj !== 'object' ||
+ obj === null) {
+
+ return obj;
+ }
+
+ seen = seen || { orig: [], copy: [] };
+
+ var lookup = seen.orig.indexOf(obj);
+ if (lookup !== -1) {
+ return seen.copy[lookup];
+ }
+
+ var newObj;
+ var cloneDeep = false;
+
+ if (!Array.isArray(obj)) {
+ if (Buffer.isBuffer(obj)) {
+ newObj = new Buffer(obj);
+ }
+ else if (obj instanceof Date) {
+ newObj = new Date(obj.getTime());
+ }
+ else if (obj instanceof RegExp) {
+ newObj = new RegExp(obj);
+ }
+ else {
+ var proto = Object.getPrototypeOf(obj);
+ if (proto &&
+ proto.isImmutable) {
+
+ newObj = obj;
+ }
+ else {
+ newObj = Object.create(proto);
+ cloneDeep = true;
+ }
+ }
+ }
+ else {
+ newObj = [];
+ cloneDeep = true;
+ }
+
+ seen.orig.push(obj);
+ seen.copy.push(newObj);
+
+ if (cloneDeep) {
+ var keys = Object.getOwnPropertyNames(obj);
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ var descriptor = Object.getOwnPropertyDescriptor(obj, key);
+ if (descriptor &&
+ (descriptor.get ||
+ descriptor.set)) {
+
+ Object.defineProperty(newObj, key, descriptor);
+ }
+ else {
+ newObj[key] = exports.clone(obj[key], seen);
+ }
+ }
+ }
+
+ return newObj;
+};
+
+
+// Merge all the properties of source into target, source wins in conflict, and by default null and undefined from source are applied
+/*eslint-disable */
+exports.merge = function (target, source, isNullOverride /* = true */, isMergeArrays /* = true */) {
+/*eslint-enable */
+ exports.assert(target && typeof target === 'object', 'Invalid target value: must be an object');
+ exports.assert(source === null || source === undefined || typeof source === 'object', 'Invalid source value: must be null, undefined, or an object');
+
+ if (!source) {
+ return target;
+ }
+
+ if (Array.isArray(source)) {
+ exports.assert(Array.isArray(target), 'Cannot merge array onto an object');
+ if (isMergeArrays === false) { // isMergeArrays defaults to true
+ target.length = 0; // Must not change target assignment
+ }
+
+ for (var i = 0, il = source.length; i < il; ++i) {
+ target.push(exports.clone(source[i]));
+ }
+
+ return target;
+ }
+
+ var keys = Object.keys(source);
+ for (var k = 0, kl = keys.length; k < kl; ++k) {
+ var key = keys[k];
+ var value = source[key];
+ if (value &&
+ typeof value === 'object') {
+
+ if (!target[key] ||
+ typeof target[key] !== 'object' ||
+ (Array.isArray(target[key]) ^ Array.isArray(value)) ||
+ value instanceof Date ||
+ Buffer.isBuffer(value) ||
+ value instanceof RegExp) {
+
+ target[key] = exports.clone(value);
+ }
+ else {
+ exports.merge(target[key], value, isNullOverride, isMergeArrays);
+ }
+ }
+ else {
+ if (value !== null &&
+ value !== undefined) { // Explicit to preserve empty strings
+
+ target[key] = value;
+ }
+ else if (isNullOverride !== false) { // Defaults to true
+ target[key] = value;
+ }
+ }
+ }
+
+ return target;
+};
+
+
+// Apply options to a copy of the defaults
+
+exports.applyToDefaults = function (defaults, options, isNullOverride) {
+
+ exports.assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object');
+ exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object');
+
+ if (!options) { // If no options, return null
+ return null;
+ }
+
+ var copy = exports.clone(defaults);
+
+ if (options === true) { // If options is set to true, use defaults
+ return copy;
+ }
+
+ return exports.merge(copy, options, isNullOverride === true, false);
+};
+
+
+// Clone an object except for the listed keys which are shallow copied
+
+exports.cloneWithShallow = function (source, keys) {
+
+ if (!source ||
+ typeof source !== 'object') {
+
+ return source;
+ }
+
+ var storage = internals.store(source, keys); // Move shallow copy items to storage
+ var copy = exports.clone(source); // Deep copy the rest
+ internals.restore(copy, source, storage); // Shallow copy the stored items and restore
+ return copy;
+};
+
+
+internals.store = function (source, keys) {
+
+ var storage = {};
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ var value = exports.reach(source, key);
+ if (value !== undefined) {
+ storage[key] = value;
+ internals.reachSet(source, key, undefined);
+ }
+ }
+
+ return storage;
+};
+
+
+internals.restore = function (copy, source, storage) {
+
+ var keys = Object.keys(storage);
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ internals.reachSet(copy, key, storage[key]);
+ internals.reachSet(source, key, storage[key]);
+ }
+};
+
+
+internals.reachSet = function (obj, key, value) {
+
+ var path = key.split('.');
+ var ref = obj;
+ for (var i = 0, il = path.length; i < il; ++i) {
+ var segment = path[i];
+ if (i + 1 === il) {
+ ref[segment] = value;
+ }
+
+ ref = ref[segment];
+ }
+};
+
+
+// Apply options to defaults except for the listed keys which are shallow copied from option without merging
+
+exports.applyToDefaultsWithShallow = function (defaults, options, keys) {
+
+ exports.assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object');
+ exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object');
+ exports.assert(keys && Array.isArray(keys), 'Invalid keys');
+
+ if (!options) { // If no options, return null
+ return null;
+ }
+
+ var copy = exports.cloneWithShallow(defaults, keys);
+
+ if (options === true) { // If options is set to true, use defaults
+ return copy;
+ }
+
+ var storage = internals.store(options, keys); // Move shallow copy items to storage
+ exports.merge(copy, options, false, false); // Deep copy the rest
+ internals.restore(copy, options, storage); // Shallow copy the stored items and restore
+ return copy;
+};
+
+
+// Deep object or array comparison
+
+exports.deepEqual = function (obj, ref, options, seen) {
+
+ options = options || { prototype: true };
+
+ var type = typeof obj;
+
+ if (type !== typeof ref) {
+ return false;
+ }
+
+ if (type !== 'object' ||
+ obj === null ||
+ ref === null) {
+
+ if (obj === ref) { // Copied from Deep-eql, copyright(c) 2013 Jake Luer, jake@alogicalparadox.com, MIT Licensed, https://github.com/chaijs/deep-eql
+ return obj !== 0 || 1 / obj === 1 / ref; // -0 / +0
+ }
+
+ return obj !== obj && ref !== ref; // NaN
+ }
+
+ seen = seen || [];
+ if (seen.indexOf(obj) !== -1) {
+ return true; // If previous comparison failed, it would have stopped execution
+ }
+
+ seen.push(obj);
+
+ if (Array.isArray(obj)) {
+ if (!Array.isArray(ref)) {
+ return false;
+ }
+
+ if (!options.part && obj.length !== ref.length) {
+ return false;
+ }
+
+ for (var i = 0, il = obj.length; i < il; ++i) {
+ if (options.part) {
+ var found = false;
+ for (var r = 0, rl = ref.length; r < rl; ++r) {
+ if (exports.deepEqual(obj[i], ref[r], options, seen)) {
+ found = true;
+ break;
+ }
+ }
+
+ return found;
+ }
+
+ if (!exports.deepEqual(obj[i], ref[i], options, seen)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ if (Buffer.isBuffer(obj)) {
+ if (!Buffer.isBuffer(ref)) {
+ return false;
+ }
+
+ if (obj.length !== ref.length) {
+ return false;
+ }
+
+ for (var j = 0, jl = obj.length; j < jl; ++j) {
+ if (obj[j] !== ref[j]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ if (obj instanceof Date) {
+ return (ref instanceof Date && obj.getTime() === ref.getTime());
+ }
+
+ if (obj instanceof RegExp) {
+ return (ref instanceof RegExp && obj.toString() === ref.toString());
+ }
+
+ if (options.prototype) {
+ if (Object.getPrototypeOf(obj) !== Object.getPrototypeOf(ref)) {
+ return false;
+ }
+ }
+
+ var keys = Object.getOwnPropertyNames(obj);
+
+ if (!options.part && keys.length !== Object.getOwnPropertyNames(ref).length) {
+ return false;
+ }
+
+ for (var k = 0, kl = keys.length; k < kl; ++k) {
+ var key = keys[k];
+ var descriptor = Object.getOwnPropertyDescriptor(obj, key);
+ if (descriptor.get) {
+ if (!exports.deepEqual(descriptor, Object.getOwnPropertyDescriptor(ref, key), options, seen)) {
+ return false;
+ }
+ }
+ else if (!exports.deepEqual(obj[key], ref[key], options, seen)) {
+ return false;
+ }
+ }
+
+ return true;
+};
+
+
+// Remove duplicate items from array
+
+exports.unique = function (array, key) {
+
+ var index = {};
+ var result = [];
+
+ for (var i = 0, il = array.length; i < il; ++i) {
+ var id = (key ? array[i][key] : array[i]);
+ if (index[id] !== true) {
+
+ result.push(array[i]);
+ index[id] = true;
+ }
+ }
+
+ return result;
+};
+
+
+// Convert array into object
+
+exports.mapToObject = function (array, key) {
+
+ if (!array) {
+ return null;
+ }
+
+ var obj = {};
+ for (var i = 0, il = array.length; i < il; ++i) {
+ if (key) {
+ if (array[i][key]) {
+ obj[array[i][key]] = true;
+ }
+ }
+ else {
+ obj[array[i]] = true;
+ }
+ }
+
+ return obj;
+};
+
+
+// Find the common unique items in two arrays
+
+exports.intersect = function (array1, array2, justFirst) {
+
+ if (!array1 || !array2) {
+ return [];
+ }
+
+ var common = [];
+ var hash = (Array.isArray(array1) ? exports.mapToObject(array1) : array1);
+ var found = {};
+ for (var i = 0, il = array2.length; i < il; ++i) {
+ if (hash[array2[i]] && !found[array2[i]]) {
+ if (justFirst) {
+ return array2[i];
+ }
+
+ common.push(array2[i]);
+ found[array2[i]] = true;
+ }
+ }
+
+ return (justFirst ? null : common);
+};
+
+
+// Test if the reference contains the values
+
+exports.contain = function (ref, values, options) {
+
+ /*
+ string -> string(s)
+ array -> item(s)
+ object -> key(s)
+ object -> object (key:value)
+ */
+
+ var valuePairs = null;
+ if (typeof ref === 'object' &&
+ typeof values === 'object' &&
+ !Array.isArray(ref) &&
+ !Array.isArray(values)) {
+
+ valuePairs = values;
+ values = Object.keys(values);
+ }
+ else {
+ values = [].concat(values);
+ }
+
+ options = options || {}; // deep, once, only, part
+
+ exports.assert(arguments.length >= 2, 'Insufficient arguments');
+ exports.assert(typeof ref === 'string' || typeof ref === 'object', 'Reference must be string or an object');
+ exports.assert(values.length, 'Values array cannot be empty');
+
+ var compare, compareFlags;
+ if (options.deep) {
+ compare = exports.deepEqual;
+
+ var hasOnly = options.hasOwnProperty('only'), hasPart = options.hasOwnProperty('part');
+
+ compareFlags = {
+ prototype: hasOnly ? options.only : hasPart ? !options.part : false,
+ part: hasOnly ? !options.only : hasPart ? options.part : true
+ };
+ }
+ else {
+ compare = function (a, b) {
+
+ return a === b;
+ };
+ }
+
+ var misses = false;
+ var matches = new Array(values.length);
+ for (var i = 0, il = matches.length; i < il; ++i) {
+ matches[i] = 0;
+ }
+
+ if (typeof ref === 'string') {
+ var pattern = '(';
+ for (i = 0, il = values.length; i < il; ++i) {
+ var value = values[i];
+ exports.assert(typeof value === 'string', 'Cannot compare string reference to non-string value');
+ pattern += (i ? '|' : '') + exports.escapeRegex(value);
+ }
+
+ var regex = new RegExp(pattern + ')', 'g');
+ var leftovers = ref.replace(regex, function ($0, $1) {
+
+ var index = values.indexOf($1);
+ ++matches[index];
+ return ''; // Remove from string
+ });
+
+ misses = !!leftovers;
+ }
+ else if (Array.isArray(ref)) {
+ for (i = 0, il = ref.length; i < il; ++i) {
+ for (var j = 0, jl = values.length, matched = false; j < jl && matched === false; ++j) {
+ matched = compare(values[j], ref[i], compareFlags) && j;
+ }
+
+ if (matched !== false) {
+ ++matches[matched];
+ }
+ else {
+ misses = true;
+ }
+ }
+ }
+ else {
+ var keys = Object.keys(ref);
+ for (i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ var pos = values.indexOf(key);
+ if (pos !== -1) {
+ if (valuePairs &&
+ !compare(valuePairs[key], ref[key], compareFlags)) {
+
+ return false;
+ }
+
+ ++matches[pos];
+ }
+ else {
+ misses = true;
+ }
+ }
+ }
+
+ var result = false;
+ for (i = 0, il = matches.length; i < il; ++i) {
+ result = result || !!matches[i];
+ if ((options.once && matches[i] > 1) ||
+ (!options.part && !matches[i])) {
+
+ return false;
+ }
+ }
+
+ if (options.only &&
+ misses) {
+
+ return false;
+ }
+
+ return result;
+};
+
+
+// Flatten array
+
+exports.flatten = function (array, target) {
+
+ var result = target || [];
+
+ for (var i = 0, il = array.length; i < il; ++i) {
+ if (Array.isArray(array[i])) {
+ exports.flatten(array[i], result);
+ }
+ else {
+ result.push(array[i]);
+ }
+ }
+
+ return result;
+};
+
+
+// Convert an object key chain string ('a.b.c') to reference (object[a][b][c])
+
+exports.reach = function (obj, chain, options) {
+
+ if (chain === false ||
+ chain === null ||
+ typeof chain === 'undefined') {
+
+ return obj;
+ }
+
+ options = options || {};
+ if (typeof options === 'string') {
+ options = { separator: options };
+ }
+
+ var path = chain.split(options.separator || '.');
+ var ref = obj;
+ for (var i = 0, il = path.length; i < il; ++i) {
+ var key = path[i];
+ if (key[0] === '-' && Array.isArray(ref)) {
+ key = key.slice(1, key.length);
+ key = ref.length - key;
+ }
+
+ if (!ref ||
+ !ref.hasOwnProperty(key) ||
+ (typeof ref !== 'object' && options.functions === false)) { // Only object and function can have properties
+
+ exports.assert(!options.strict || i + 1 === il, 'Missing segment', key, 'in reach path ', chain);
+ exports.assert(typeof ref === 'object' || options.functions === true || typeof ref !== 'function', 'Invalid segment', key, 'in reach path ', chain);
+ ref = options.default;
+ break;
+ }
+
+ ref = ref[key];
+ }
+
+ return ref;
+};
+
+
+exports.reachTemplate = function (obj, template, options) {
+
+ return template.replace(/{([^}]+)}/g, function ($0, chain) {
+
+ var value = exports.reach(obj, chain, options);
+ return (value === undefined || value === null ? '' : value);
+ });
+};
+
+
+exports.formatStack = function (stack) {
+
+ var trace = [];
+ for (var i = 0, il = stack.length; i < il; ++i) {
+ var item = stack[i];
+ trace.push([item.getFileName(), item.getLineNumber(), item.getColumnNumber(), item.getFunctionName(), item.isConstructor()]);
+ }
+
+ return trace;
+};
+
+
+exports.formatTrace = function (trace) {
+
+ var display = [];
+
+ for (var i = 0, il = trace.length; i < il; ++i) {
+ var row = trace[i];
+ display.push((row[4] ? 'new ' : '') + row[3] + ' (' + row[0] + ':' + row[1] + ':' + row[2] + ')');
+ }
+
+ return display;
+};
+
+
+exports.callStack = function (slice) {
+
+ // http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
+
+ var v8 = Error.prepareStackTrace;
+ Error.prepareStackTrace = function (err, stack) {
+
+ return stack;
+ };
+
+ var capture = {};
+ Error.captureStackTrace(capture, arguments.callee); /*eslint no-caller:0 */
+ var stack = capture.stack;
+
+ Error.prepareStackTrace = v8;
+
+ var trace = exports.formatStack(stack);
+
+ if (slice) {
+ return trace.slice(slice);
+ }
+
+ return trace;
+};
+
+
+exports.displayStack = function (slice) {
+
+ var trace = exports.callStack(slice === undefined ? 1 : slice + 1);
+
+ return exports.formatTrace(trace);
+};
+
+
+exports.abortThrow = false;
+
+
+exports.abort = function (message, hideStack) {
+
+ if (process.env.NODE_ENV === 'test' || exports.abortThrow === true) {
+ throw new Error(message || 'Unknown error');
+ }
+
+ var stack = '';
+ if (!hideStack) {
+ stack = exports.displayStack(1).join('\n\t');
+ }
+ console.log('ABORT: ' + message + '\n\t' + stack);
+ process.exit(1);
+};
+
+
+exports.assert = function (condition /*, msg1, msg2, msg3 */) {
+
+ if (condition) {
+ return;
+ }
+
+ if (arguments.length === 2 && arguments[1] instanceof Error) {
+ throw arguments[1];
+ }
+
+ var msgs = [];
+ for (var i = 1, il = arguments.length; i < il; ++i) {
+ if (arguments[i] !== '') {
+ msgs.push(arguments[i]); // Avoids Array.slice arguments leak, allowing for V8 optimizations
+ }
+ }
+
+ msgs = msgs.map(function (msg) {
+
+ return typeof msg === 'string' ? msg : msg instanceof Error ? msg.message : exports.stringify(msg);
+ });
+ throw new Error(msgs.join(' ') || 'Unknown error');
+};
+
+
+exports.Timer = function () {
+
+ this.ts = 0;
+ this.reset();
+};
+
+
+exports.Timer.prototype.reset = function () {
+
+ this.ts = Date.now();
+};
+
+
+exports.Timer.prototype.elapsed = function () {
+
+ return Date.now() - this.ts;
+};
+
+
+exports.Bench = function () {
+
+ this.ts = 0;
+ this.reset();
+};
+
+
+exports.Bench.prototype.reset = function () {
+
+ this.ts = exports.Bench.now();
+};
+
+
+exports.Bench.prototype.elapsed = function () {
+
+ return exports.Bench.now() - this.ts;
+};
+
+
+exports.Bench.now = function () {
+
+ var ts = process.hrtime();
+ return (ts[0] * 1e3) + (ts[1] / 1e6);
+};
+
+
+// Escape string for Regex construction
+
+exports.escapeRegex = function (string) {
+
+ // Escape ^$.*+-?=!:|\/()[]{},
+ return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&');
+};
+
+
+// Base64url (RFC 4648) encode
+
+exports.base64urlEncode = function (value, encoding) {
+
+ var buf = (Buffer.isBuffer(value) ? value : new Buffer(value, encoding || 'binary'));
+ return buf.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
+};
+
+
+// Base64url (RFC 4648) decode
+
+exports.base64urlDecode = function (value, encoding) {
+
+ if (value &&
+ !/^[\w\-]*$/.test(value)) {
+
+ return new Error('Invalid character');
+ }
+
+ try {
+ var buf = new Buffer(value, 'base64');
+ return (encoding === 'buffer' ? buf : buf.toString(encoding || 'binary'));
+ }
+ catch (err) {
+ return err;
+ }
+};
+
+
+// Escape attribute value for use in HTTP header
+
+exports.escapeHeaderAttribute = function (attribute) {
+
+ // Allowed value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9, \, "
+
+ exports.assert(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(attribute), 'Bad attribute value (' + attribute + ')');
+
+ return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"'); // Escape quotes and slash
+};
+
+
+exports.escapeHtml = function (string) {
+
+ return Escape.escapeHtml(string);
+};
+
+
+exports.escapeJavaScript = function (string) {
+
+ return Escape.escapeJavaScript(string);
+};
+
+
+exports.nextTick = function (callback) {
+
+ return function () {
+
+ var args = arguments;
+ process.nextTick(function () {
+
+ callback.apply(null, args);
+ });
+ };
+};
+
+
+exports.once = function (method) {
+
+ if (method._hoekOnce) {
+ return method;
+ }
+
+ var once = false;
+ var wrapped = function () {
+
+ if (!once) {
+ once = true;
+ method.apply(null, arguments);
+ }
+ };
+
+ wrapped._hoekOnce = true;
+
+ return wrapped;
+};
+
+
+exports.isAbsolutePath = function (path, platform) {
+
+ if (!path) {
+ return false;
+ }
+
+ if (Path.isAbsolute) { // node >= 0.11
+ return Path.isAbsolute(path);
+ }
+
+ platform = platform || process.platform;
+
+ // Unix
+
+ if (platform !== 'win32') {
+ return path[0] === '/';
+ }
+
+ // Windows
+
+ return !!/^(?:[a-zA-Z]:[\\\/])|(?:[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/])/.test(path); // C:\ or \\something\something
+};
+
+
+exports.isInteger = function (value) {
+
+ return (typeof value === 'number' &&
+ parseFloat(value) === parseInt(value, 10) &&
+ !isNaN(value));
+};
+
+
+exports.ignore = function () { };
+
+
+exports.inherits = Util.inherits;
+
+
+exports.format = Util.format;
+
+
+exports.transform = function (source, transform, options) {
+
+ exports.assert(source === null || source === undefined || typeof source === 'object' || Array.isArray(source), 'Invalid source object: must be null, undefined, an object, or an array');
+
+ if (Array.isArray(source)) {
+ var results = [];
+ for (var i = 0, il = source.length; i < il; ++i) {
+ results.push(exports.transform(source[i], transform, options));
+ }
+ return results;
+ }
+
+ var result = {};
+ var keys = Object.keys(transform);
+
+ for (var k = 0, kl = keys.length; k < kl; ++k) {
+ var key = keys[k];
+ var path = key.split('.');
+ var sourcePath = transform[key];
+
+ exports.assert(typeof sourcePath === 'string', 'All mappings must be "." delineated strings');
+
+ var segment;
+ var res = result;
+
+ while (path.length > 1) {
+ segment = path.shift();
+ if (!res[segment]) {
+ res[segment] = {};
+ }
+ res = res[segment];
+ }
+ segment = path.shift();
+ res[segment] = exports.reach(source, sourcePath, options);
+ }
+
+ return result;
+};
+
+
+exports.uniqueFilename = function (path, extension) {
+
+ if (extension) {
+ extension = extension[0] !== '.' ? '.' + extension : extension;
+ }
+ else {
+ extension = '';
+ }
+
+ path = Path.resolve(path);
+ var name = [Date.now(), process.pid, Crypto.randomBytes(8).toString('hex')].join('-') + extension;
+ return Path.join(path, name);
+};
+
+
+exports.stringify = function () {
+
+ try {
+ return JSON.stringify.apply(null, arguments);
+ }
+ catch (err) {
+ return '[Cannot display object: ' + err.message + ']';
+ }
+};
+
+
+exports.shallow = function (source) {
+
+ var target = {};
+ var keys = Object.keys(source);
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ target[key] = source[key];
+ }
+
+ return target;
+};
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/package.json b/node_modules/request/node_modules/hawk/node_modules/hoek/package.json
new file mode 100644
index 000000000..6e76778c7
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "hoek",
+ "description": "General purpose node utilities",
+ "version": "2.16.3",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/hapijs/hoek.git"
+ },
+ "main": "lib/index.js",
+ "keywords": [
+ "utilities"
+ ],
+ "engines": {
+ "node": ">=0.10.40"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "code": "1.x.x",
+ "lab": "5.x.x"
+ },
+ "scripts": {
+ "test": "lab -a code -t 100 -L",
+ "test-cov-html": "lab -a code -t 100 -L -r html -o coverage.html"
+ },
+ "license": "BSD-3-Clause",
+ "readme": "![hoek Logo](https://raw.github.com/hapijs/hoek/master/images/hoek.png)\n\nUtility methods for the hapi ecosystem. This module is not intended to solve every problem for everyone, but rather as a central place to store hapi-specific methods. If you're looking for a general purpose utility module, check out [lodash](https://github.com/lodash/lodash) or [underscore](https://github.com/jashkenas/underscore).\n\n[![Build Status](https://secure.travis-ci.org/hapijs/hoek.svg)](http://travis-ci.org/hapijs/hoek)\n\nLead Maintainer: [Nathan LaFreniere](https://github.com/nlf)\n\n# Table of Contents\n\n* [Introduction](#introduction \"Introduction\")\n* [Object](#object \"Object\")\n * [clone](#cloneobj \"clone\")\n * [cloneWithShallow](#clonewithshallowobj-keys \"cloneWithShallow\")\n * [merge](#mergetarget-source-isnulloverride-ismergearrays \"merge\")\n * [applyToDefaults](#applytodefaultsdefaults-options-isnulloverride \"applyToDefaults\")\n * [applyToDefaultsWithShallow](#applytodefaultswithshallowdefaults-options-keys \"applyToDefaultsWithShallow\")\n * [deepEqual](#deepequala-b \"deepEqual\")\n * [unique](#uniquearray-key \"unique\")\n * [mapToObject](#maptoobjectarray-key \"mapToObject\")\n * [intersect](#intersectarray1-array2 \"intersect\")\n * [contain](#containref-values-options \"contain\")\n * [flatten](#flattenarray-target \"flatten\")\n * [reach](#reachobj-chain-options \"reach\")\n * [reachTemplate](#reachtemplateobj-template-options \"reachTemplate\")\n * [transform](#transformobj-transform-options \"transform\")\n * [shallow](#shallowobj \"shallow\")\n * [stringify](#stringifyobj \"stringify\")\n* [Timer](#timer \"Timer\")\n* [Bench](#bench \"Bench\")\n* [Binary Encoding/Decoding](#binary-encodingdecoding \"Binary Encoding/Decoding\")\n * [base64urlEncode](#base64urlencodevalue \"binary64urlEncode\")\n * [base64urlDecode](#base64urldecodevalue \"binary64urlDecode\")\n* [Escaping Characters](#escaping-characters \"Escaping Characters\")\n * [escapeHtml](#escapehtmlstring \"escapeHtml\")\n * [escapeHeaderAttribute](#escapeheaderattributeattribute \"escapeHeaderAttribute\")\n * [escapeRegex](#escaperegexstring \"escapeRegex\")\n* [Errors](#errors \"Errors\")\n * [assert](#assertcondition-message \"assert\")\n * [abort](#abortmessage \"abort\")\n * [displayStack](#displaystackslice \"displayStack\")\n * [callStack](#callstackslice \"callStack\")\n* [Function](#function \"Function\")\n * [nextTick](#nexttickfn \"nextTick\")\n * [once](#oncefn \"once\")\n * [ignore](#ignore \"ignore\")\n* [Miscellaneous](#miscellaneous \"Miscellaneous\")\n * [uniqueFilename](#uniquefilenamepath-extension \"uniqueFilename\")\n * [isAbsolutePath](#isabsolutepathpath-platform \"isAbsolutePath\")\n * [isInteger](#isintegervalue \"isInteger\")\n\n\n\n# Introduction\n\nThe *Hoek* library contains some common functions used within the hapi ecosystem. It comes with useful methods for Arrays (clone, merge, applyToDefaults), Objects (removeKeys, copy), Asserting and more.\n\nFor example, to use Hoek to set configuration with default options:\n```javascript\nvar Hoek = require('hoek');\n\nvar default = {url : \"www.github.com\", port : \"8000\", debug : true};\n\nvar config = Hoek.applyToDefaults(default, {port : \"3000\", admin : true});\n\n// In this case, config would be { url: 'www.github.com', port: '3000', debug: true, admin: true }\n```\n\nUnder each of the sections (such as Array), there are subsections which correspond to Hoek methods. Each subsection will explain how to use the corresponding method. In each js excerpt below, the `var Hoek = require('hoek');` is omitted for brevity.\n\n## Object\n\nHoek provides several helpful methods for objects and arrays.\n\n### clone(obj)\n\nThis method is used to clone an object or an array. A *deep copy* is made (duplicates everything, including values that are objects, as well as non-enumerable properties).\n\n```javascript\n\nvar nestedObj = {\n w: /^something$/ig,\n x: {\n a: [1, 2, 3],\n b: 123456,\n c: new Date()\n },\n y: 'y',\n z: new Date()\n };\n\nvar copy = Hoek.clone(nestedObj);\n\ncopy.x.b = 100;\n\nconsole.log(copy.y); // results in 'y'\nconsole.log(nestedObj.x.b); // results in 123456\nconsole.log(copy.x.b); // results in 100\n```\n\n### cloneWithShallow(obj, keys)\nkeys is an array of key names to shallow copy\n\nThis method is also used to clone an object or array, however any keys listed in the `keys` array are shallow copied while those not listed are deep copied.\n\n```javascript\n\nvar nestedObj = {\n w: /^something$/ig,\n x: {\n a: [1, 2, 3],\n b: 123456,\n c: new Date()\n },\n y: 'y',\n z: new Date()\n };\n\nvar copy = Hoek.cloneWithShallow(nestedObj, ['x']);\n\ncopy.x.b = 100;\n\nconsole.log(copy.y); // results in 'y'\nconsole.log(nestedObj.x.b); // results in 100\nconsole.log(copy.x.b); // results in 100\n```\n\n### merge(target, source, isNullOverride, isMergeArrays)\nisNullOverride, isMergeArrays default to true\n\nMerge all the properties of source into target, source wins in conflict, and by default null and undefined from source are applied.\nMerge is destructive where the target is modified. For non destructive merge, use `applyToDefaults`.\n\n\n```javascript\n\nvar target = {a: 1, b : 2};\nvar source = {a: 0, c: 5};\nvar source2 = {a: null, c: 5};\n\nHoek.merge(target, source); // results in {a: 0, b: 2, c: 5}\nHoek.merge(target, source2); // results in {a: null, b: 2, c: 5}\nHoek.merge(target, source2, false); // results in {a: 1, b: 2, c: 5}\n\nvar targetArray = [1, 2, 3];\nvar sourceArray = [4, 5];\n\nHoek.merge(targetArray, sourceArray); // results in [1, 2, 3, 4, 5]\nHoek.merge(targetArray, sourceArray, true, false); // results in [4, 5]\n```\n\n### applyToDefaults(defaults, options, isNullOverride)\nisNullOverride defaults to false\n\nApply options to a copy of the defaults\n\n```javascript\n\nvar defaults = { host: \"localhost\", port: 8000 };\nvar options = { port: 8080 };\n\nvar config = Hoek.applyToDefaults(defaults, options); // results in { host: \"localhost\", port: 8080 }\n```\n\nApply options with a null value to a copy of the defaults\n\n```javascript\n\nvar defaults = { host: \"localhost\", port: 8000 };\nvar options = { host: null, port: 8080 };\n\nvar config = Hoek.applyToDefaults(defaults, options, true); // results in { host: null, port: 8080 }\n```\n\n### applyToDefaultsWithShallow(defaults, options, keys)\nkeys is an array of key names to shallow copy\n\nApply options to a copy of the defaults. Keys specified in the last parameter are shallow copied from options instead of merged.\n\n```javascript\n\nvar defaults = {\n server: {\n host: \"localhost\",\n port: 8000\n },\n name: 'example'\n };\n\nvar options = { server: { port: 8080 } };\n\nvar config = Hoek.applyToDefaultsWithShallow(defaults, options, ['server']); // results in { server: { port: 8080 }, name: 'example' }\n```\n\n### deepEqual(b, a, [options])\n\nPerforms a deep comparison of the two values including support for circular dependencies, prototype, and properties. To skip prototype comparisons, use `options.prototype = false`\n\n```javascript\nHoek.deepEqual({ a: [1, 2], b: 'string', c: { d: true } }, { a: [1, 2], b: 'string', c: { d: true } }); //results in true\nHoek.deepEqual(Object.create(null), {}, { prototype: false }); //results in true\nHoek.deepEqual(Object.create(null), {}); //results in false\n```\n\n### unique(array, key)\n\nRemove duplicate items from Array\n\n```javascript\n\nvar array = [1, 2, 2, 3, 3, 4, 5, 6];\n\nvar newArray = Hoek.unique(array); // results in [1,2,3,4,5,6]\n\narray = [{id: 1}, {id: 1}, {id: 2}];\n\nnewArray = Hoek.unique(array, \"id\"); // results in [{id: 1}, {id: 2}]\n```\n\n### mapToObject(array, key)\n\nConvert an Array into an Object\n\n```javascript\n\nvar array = [1,2,3];\nvar newObject = Hoek.mapToObject(array); // results in [{\"1\": true}, {\"2\": true}, {\"3\": true}]\n\narray = [{id: 1}, {id: 2}];\nnewObject = Hoek.mapToObject(array, \"id\"); // results in [{\"id\": 1}, {\"id\": 2}]\n```\n\n### intersect(array1, array2)\n\nFind the common unique items in two arrays\n\n```javascript\n\nvar array1 = [1, 2, 3];\nvar array2 = [1, 4, 5];\n\nvar newArray = Hoek.intersect(array1, array2); // results in [1]\n```\n\n### contain(ref, values, [options])\n\nTests if the reference value contains the provided values where:\n- `ref` - the reference string, array, or object.\n- `values` - a single or array of values to find within the `ref` value. If `ref` is an object, `values` can be a key name,\n an array of key names, or an object with key-value pairs to compare.\n- `options` - an optional object with the following optional settings:\n - `deep` - if `true`, performed a deep comparison of the values.\n - `once` - if `true`, allows only one occurrence of each value.\n - `only` - if `true`, does not allow values not explicitly listed.\n - `part` - if `true`, allows partial match of the values (at least one must always match).\n\nNote: comparing a string to overlapping values will result in failed comparison (e.g. `contain('abc', ['ab', 'bc'])`).\nAlso, if an object key's value does not match the provided value, `false` is returned even when `part` is specified.\n\n```javascript\nHoek.contain('aaa', 'a', { only: true });\t\t\t\t\t\t\t// true\nHoek.contain([{ a: 1 }], [{ a: 1 }], { deep: true });\t\t\t\t// true\nHoek.contain([1, 2, 2], [1, 2], { once: true });\t\t\t\t\t// false\nHoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 }, { part: true }); // true\n```\n\n### flatten(array, [target])\n\nFlatten an array\n\n```javascript\n\nvar array = [1, [2, 3]];\n\nvar flattenedArray = Hoek.flatten(array); // results in [1, 2, 3]\n\narray = [1, [2, 3]];\ntarget = [4, [5]];\n\nflattenedArray = Hoek.flatten(array, target); // results in [4, [5], 1, 2, 3]\n```\n\n### reach(obj, chain, [options])\n\nConverts an object key chain string to reference\n\n- `options` - optional settings\n - `separator` - string to split chain path on, defaults to '.'\n - `default` - value to return if the path or value is not present, default is `undefined`\n - `strict` - if `true`, will throw an error on missing member, default is `false`\n - `functions` - if `true` allow traversing functions for properties. `false` will throw an error if a function is part of the chain.\n\nA chain including negative numbers will work like negative indices on an\narray.\n\nIf chain is `null`, `undefined` or `false`, the object itself will be returned.\n\n```javascript\n\nvar chain = 'a.b.c';\nvar obj = {a : {b : { c : 1}}};\n\nHoek.reach(obj, chain); // returns 1\n\nvar chain = 'a.b.-1';\nvar obj = {a : {b : [2,3,6]}};\n\nHoek.reach(obj, chain); // returns 6\n```\n\n### reachTemplate(obj, template, [options])\n\nReplaces string parameters (`{name}`) with their corresponding object key values by applying the\n(`reach()`)[#reachobj-chain-options] method where:\n\n- `obj` - the context object used for key lookup.\n- `template` - a string containing `{}` parameters.\n- `options` - optional (`reach()`)[#reachobj-chain-options] options.\n\n```javascript\n\nvar chain = 'a.b.c';\nvar obj = {a : {b : { c : 1}}};\n\nHoek.reachTemplate(obj, '1+{a.b.c}=2'); // returns '1+1=2'\n```\n\n### transform(obj, transform, [options])\n\nTransforms an existing object into a new one based on the supplied `obj` and `transform` map. `options` are the same as the `reach` options. The first argument can also be an array of objects. In that case the method will return an array of transformed objects.\n\n```javascript\nvar source = {\n address: {\n one: '123 main street',\n two: 'PO Box 1234'\n },\n title: 'Warehouse',\n state: 'CA'\n};\n\nvar result = Hoek.transform(source, {\n 'person.address.lineOne': 'address.one',\n 'person.address.lineTwo': 'address.two',\n 'title': 'title',\n 'person.address.region': 'state'\n});\n// Results in\n// {\n// person: {\n// address: {\n// lineOne: '123 main street',\n// lineTwo: 'PO Box 1234',\n// region: 'CA'\n// }\n// },\n// title: 'Warehouse'\n// }\n```\n\n### shallow(obj)\n\nPerforms a shallow copy by copying the references of all the top level children where:\n- `obj` - the object to be copied.\n\n```javascript\nvar shallow = Hoek.shallow({ a: { b: 1 } });\n```\n\n### stringify(obj)\n\nConverts an object to string using the built-in `JSON.stringify()` method with the difference that any errors are caught\nand reported back in the form of the returned string. Used as a shortcut for displaying information to the console (e.g. in\nerror message) without the need to worry about invalid conversion.\n\n```javascript\nvar a = {};\na.b = a;\nHoek.stringify(a);\t\t// Returns '[Cannot display object: Converting circular structure to JSON]'\n```\n\n# Timer\n\nA Timer object. Initializing a new timer object sets the ts to the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.\n\n```javascript\n\nvar timerObj = new Hoek.Timer();\nconsole.log(\"Time is now: \" + timerObj.ts);\nconsole.log(\"Elapsed time from initialization: \" + timerObj.elapsed() + 'milliseconds');\n```\n\n\n# Bench\n\nSame as Timer with the exception that `ts` stores the internal node clock which is not related to `Date.now()` and cannot be used to display\nhuman-readable timestamps. More accurate for benchmarking or internal timers.\n\n# Binary Encoding/Decoding\n\n### base64urlEncode(value)\n\nEncodes value in Base64 or URL encoding\n\n### base64urlDecode(value)\n\nDecodes data in Base64 or URL encoding.\n# Escaping Characters\n\nHoek provides convenient methods for escaping html characters. The escaped characters are as followed:\n\n```javascript\n\ninternals.htmlEscaped = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#x27;',\n '`': '&#x60;'\n};\n```\n\n### escapeHtml(string)\n\n```javascript\n\nvar string = '<html> hey </html>';\nvar escapedString = Hoek.escapeHtml(string); // returns &lt;html&gt; hey &lt;/html&gt;\n```\n\n### escapeHeaderAttribute(attribute)\n\nEscape attribute value for use in HTTP header\n\n```javascript\n\nvar a = Hoek.escapeHeaderAttribute('I said \"go w\\\\o me\"'); //returns I said \\\"go w\\\\o me\\\"\n```\n\n\n### escapeRegex(string)\n\nEscape string for Regex construction\n\n```javascript\n\nvar a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\\\/`\"(>)[<]d{}s,'); // returns 4\\^f\\$s\\.4\\*5\\+\\-_\\?%\\=#\\!\\:@\\|~\\\\\\/`\"\\(>\\)\\[<\\]d\\{\\}s\\,\n```\n\n# Errors\n\n### assert(condition, message)\n\n```javascript\n\nvar a = 1, b = 2;\n\nHoek.assert(a === b, 'a should equal b'); // Throws 'a should equal b'\n```\n\nNote that you may also pass an already created Error object as the second parameter, and `assert` will throw that object.\n\n```javascript\n\nvar a = 1, b = 2;\n\nHoek.assert(a === b, new Error('a should equal b')); // Throws the given error object\n```\n\n### abort(message)\n\nFirst checks if `process.env.NODE_ENV === 'test'`, and if so, throws error message. Otherwise,\ndisplays most recent stack and then exits process.\n\n\n\n### displayStack(slice)\n\nDisplays the trace stack\n\n```javascript\n\nvar stack = Hoek.displayStack();\nconsole.log(stack); // returns something like:\n\n[ 'null (/Users/user/Desktop/hoek/test.js:4:18)',\n 'Module._compile (module.js:449:26)',\n 'Module._extensions..js (module.js:467:10)',\n 'Module.load (module.js:356:32)',\n 'Module._load (module.js:312:12)',\n 'Module.runMain (module.js:492:10)',\n 'startup.processNextTick.process._tickCallback (node.js:244:9)' ]\n```\n\n### callStack(slice)\n\nReturns a trace stack array.\n\n```javascript\n\nvar stack = Hoek.callStack();\nconsole.log(stack); // returns something like:\n\n[ [ '/Users/user/Desktop/hoek/test.js', 4, 18, null, false ],\n [ 'module.js', 449, 26, 'Module._compile', false ],\n [ 'module.js', 467, 10, 'Module._extensions..js', false ],\n [ 'module.js', 356, 32, 'Module.load', false ],\n [ 'module.js', 312, 12, 'Module._load', false ],\n [ 'module.js', 492, 10, 'Module.runMain', false ],\n [ 'node.js',\n 244,\n 9,\n 'startup.processNextTick.process._tickCallback',\n false ] ]\n```\n\n## Function\n\n### nextTick(fn)\n\nReturns a new function that wraps `fn` in `process.nextTick`.\n\n```javascript\n\nvar myFn = function () {\n console.log('Do this later');\n};\n\nvar nextFn = Hoek.nextTick(myFn);\n\nnextFn();\nconsole.log('Do this first');\n\n// Results in:\n//\n// Do this first\n// Do this later\n```\n\n### once(fn)\n\nReturns a new function that can be run multiple times, but makes sure `fn` is only run once.\n\n```javascript\n\nvar myFn = function () {\n console.log('Ran myFn');\n};\n\nvar onceFn = Hoek.once(myFn);\nonceFn(); // results in \"Ran myFn\"\nonceFn(); // results in undefined\n```\n\n### ignore\n\nA simple no-op function. It does nothing at all.\n\n## Miscellaneous\n\n### uniqueFilename(path, extension)\n`path` to prepend with the randomly generated file name. `extension` is the optional file extension, defaults to `''`.\n\nReturns a randomly generated file name at the specified `path`. The result is a fully resolved path to a file.\n\n```javascript\nvar result = Hoek.uniqueFilename('./test/modules', 'txt'); // results in \"full/path/test/modules/{random}.txt\"\n```\n\n### isAbsolutePath(path, [platform])\n\nDetermines whether `path` is an absolute path. Returns `true` or `false`.\n\n- `path` - A file path to test for whether it is absolute or not.\n- `platform` - An optional parameter used for specifying the platform. Defaults to `process.platform`.\n\n### isInteger(value)\n\nCheck `value` to see if it is an integer. Returns true/false.\n\n```javascript\nvar result = Hoek.isInteger('23')\n```\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/hapijs/hoek/issues"
+ },
+ "homepage": "https://github.com/hapijs/hoek#readme",
+ "_id": "hoek@2.16.3",
+ "_shasum": "20bb7403d3cea398e91dc4710a8ff1b8274a25ed",
+ "_resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
+ "_from": "hoek@>=2.0.0 <3.0.0"
+}
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js b/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js
new file mode 100644
index 000000000..a5d048f7b
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js
@@ -0,0 +1,88 @@
+// Load modules
+
+var Code = require('code');
+var Hoek = require('../lib');
+var Lab = require('lab');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.experiment;
+var it = lab.test;
+var expect = Code.expect;
+
+
+describe('escapeJavaScript()', function () {
+
+ it('encodes / characters', function (done) {
+
+ var encoded = Hoek.escapeJavaScript('<script>alert(1)</script>');
+ expect(encoded).to.equal('\\x3cscript\\x3ealert\\x281\\x29\\x3c\\x2fscript\\x3e');
+ done();
+ });
+
+ it('encodes \' characters', function (done) {
+
+ var encoded = Hoek.escapeJavaScript('something(\'param\')');
+ expect(encoded).to.equal('something\\x28\\x27param\\x27\\x29');
+ done();
+ });
+
+ it('encodes large unicode characters with the correct padding', function (done) {
+
+ var encoded = Hoek.escapeJavaScript(String.fromCharCode(500) + String.fromCharCode(1000));
+ expect(encoded).to.equal('\\u0500\\u1000');
+ done();
+ });
+
+ it('doesn\'t throw an exception when passed null', function (done) {
+
+ var encoded = Hoek.escapeJavaScript(null);
+ expect(encoded).to.equal('');
+ done();
+ });
+});
+
+describe('escapeHtml()', function () {
+
+ it('encodes / characters', function (done) {
+
+ var encoded = Hoek.escapeHtml('<script>alert(1)</script>');
+ expect(encoded).to.equal('&lt;script&gt;alert&#x28;1&#x29;&lt;&#x2f;script&gt;');
+ done();
+ });
+
+ it('encodes < and > as named characters', function (done) {
+
+ var encoded = Hoek.escapeHtml('<script><>');
+ expect(encoded).to.equal('&lt;script&gt;&lt;&gt;');
+ done();
+ });
+
+ it('encodes large unicode characters', function (done) {
+
+ var encoded = Hoek.escapeHtml(String.fromCharCode(500) + String.fromCharCode(1000));
+ expect(encoded).to.equal('&#500;&#1000;');
+ done();
+ });
+
+ it('doesn\'t throw an exception when passed null', function (done) {
+
+ var encoded = Hoek.escapeHtml(null);
+ expect(encoded).to.equal('');
+ done();
+ });
+
+ it('encodes {} characters', function (done) {
+
+ var encoded = Hoek.escapeHtml('{}');
+ expect(encoded).to.equal('&#x7b;&#x7d;');
+ done();
+ });
+});
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js b/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js
new file mode 100644
index 000000000..1e8ef620f
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js
@@ -0,0 +1,2513 @@
+// Load modules
+
+var Fs = require('fs');
+var Path = require('path');
+var Code = require('code');
+var Hoek = require('../lib');
+var Lab = require('lab');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.experiment;
+var it = lab.test;
+var expect = Code.expect;
+
+
+var nestedObj = {
+ v: [7, 8, 9],
+ w: /^something$/igm,
+ x: {
+ a: [1, 2, 3],
+ b: 123456,
+ c: new Date(),
+ d: /hi/igm,
+ e: /hello/
+ },
+ y: 'y',
+ z: new Date(1378775452757)
+};
+
+var dupsArray = [nestedObj, { z: 'z' }, nestedObj];
+var reducedDupsArray = [nestedObj, { z: 'z' }];
+
+describe('clone()', function () {
+
+ it('clones a nested object', function (done) {
+
+ var a = nestedObj;
+ var b = Hoek.clone(a);
+
+ expect(a).to.deep.equal(b);
+ expect(a.z.getTime()).to.equal(b.z.getTime());
+ done();
+ });
+
+ it('clones a null object', function (done) {
+
+ var b = Hoek.clone(null);
+
+ expect(b).to.equal(null);
+ done();
+ });
+
+ it('should not convert undefined properties to null', function (done) {
+
+ var obj = { something: undefined };
+ var b = Hoek.clone(obj);
+
+ expect(typeof b.something).to.equal('undefined');
+ done();
+ });
+
+ it('should not throw on circular reference', function (done) {
+
+ var a = {};
+ a.x = a;
+
+ var test = function () {
+
+ var b = Hoek.clone(a);
+ };
+
+ expect(test).to.not.throw();
+ done();
+ });
+
+ it('clones circular reference', function (done) {
+
+ var x = {
+ 'z': new Date()
+ };
+ x.y = x;
+
+ var b = Hoek.clone(x);
+ expect(Object.keys(b.y)).to.deep.equal(Object.keys(x));
+ expect(b.z).to.not.equal(x.z);
+ expect(b.y).to.not.equal(x.y);
+ expect(b.y.z).to.not.equal(x.y.z);
+ expect(b.y).to.equal(b);
+ expect(b.y.y.y.y).to.equal(b);
+ done();
+ });
+
+ it('clones an object with a null prototype', function (done) {
+
+ var obj = Object.create(null);
+ var b = Hoek.clone(obj);
+
+ expect(b).to.deep.equal(obj);
+ done();
+ });
+
+ it('clones deeply nested object', function (done) {
+
+ var a = {
+ x: {
+ y: {
+ a: [1, 2, 3],
+ b: 123456,
+ c: new Date(),
+ d: /hi/igm,
+ e: /hello/
+ }
+ }
+ };
+
+ var b = Hoek.clone(a);
+
+ expect(a).to.deep.equal(b);
+ expect(a.x.y.c.getTime()).to.equal(b.x.y.c.getTime());
+ done();
+ });
+
+ it('clones arrays', function (done) {
+
+ var a = [1, 2, 3];
+
+ var b = Hoek.clone(a);
+
+ expect(a).to.deep.equal(b);
+ done();
+ });
+
+ it('performs actual copy for shallow keys (no pass by reference)', function (done) {
+
+ var x = Hoek.clone(nestedObj);
+ var y = Hoek.clone(nestedObj);
+
+ // Date
+ expect(x.z).to.not.equal(nestedObj.z);
+ expect(x.z).to.not.equal(y.z);
+
+ // Regex
+ expect(x.w).to.not.equal(nestedObj.w);
+ expect(x.w).to.not.equal(y.w);
+
+ // Array
+ expect(x.v).to.not.equal(nestedObj.v);
+ expect(x.v).to.not.equal(y.v);
+
+ // Immutable(s)
+ x.y = 5;
+ expect(x.y).to.not.equal(nestedObj.y);
+ expect(x.y).to.not.equal(y.y);
+
+ done();
+ });
+
+ it('performs actual copy for deep keys (no pass by reference)', function (done) {
+
+ var x = Hoek.clone(nestedObj);
+ var y = Hoek.clone(nestedObj);
+
+ expect(x.x.c).to.not.equal(nestedObj.x.c);
+ expect(x.x.c).to.not.equal(y.x.c);
+
+ expect(x.x.c.getTime()).to.equal(nestedObj.x.c.getTime());
+ expect(x.x.c.getTime()).to.equal(y.x.c.getTime());
+ done();
+ });
+
+ it('copies functions with properties', function (done) {
+
+ var a = {
+ x: function () {
+
+ return 1;
+ },
+ y: {}
+ };
+ a.x.z = 'string in function';
+ a.x.v = function () {
+
+ return 2;
+ };
+ a.y.u = a.x;
+
+ var b = Hoek.clone(a);
+ expect(b.x()).to.equal(1);
+ expect(b.x.v()).to.equal(2);
+ expect(b.y.u).to.equal(b.x);
+ expect(b.x.z).to.equal('string in function');
+ done();
+ });
+
+ it('should copy a buffer', function (done) {
+
+ var tls = {
+ key: new Buffer([1, 2, 3, 4, 5]),
+ cert: new Buffer([1, 2, 3, 4, 5, 6, 10])
+ };
+
+ var copiedTls = Hoek.clone(tls);
+ expect(Buffer.isBuffer(copiedTls.key)).to.equal(true);
+ expect(JSON.stringify(copiedTls.key)).to.equal(JSON.stringify(tls.key));
+ expect(Buffer.isBuffer(copiedTls.cert)).to.equal(true);
+ expect(JSON.stringify(copiedTls.cert)).to.equal(JSON.stringify(tls.cert));
+ done();
+ });
+
+ it('clones an object with a prototype', function (done) {
+
+ var Obj = function () {
+
+ this.a = 5;
+ };
+
+ Obj.prototype.b = function () {
+
+ return 'c';
+ };
+
+ var a = new Obj();
+ var b = Hoek.clone(a);
+
+ expect(b.a).to.equal(5);
+ expect(b.b()).to.equal('c');
+ expect(a).to.deep.equal(b);
+ done();
+ });
+
+ it('reuses cloned Date object', function (done) {
+
+ var obj = {
+ a: new Date()
+ };
+
+ obj.b = obj.a;
+
+ var copy = Hoek.clone(obj);
+ expect(copy.a).to.equal(copy.b);
+ done();
+ });
+
+ it('shallow copies an object with a prototype and isImmutable flag', function (done) {
+
+ var Obj = function () {
+
+ this.value = 5;
+ };
+
+ Obj.prototype.b = function () {
+
+ return 'c';
+ };
+
+ Obj.prototype.isImmutable = true;
+
+ var obj = {
+ a: new Obj()
+ };
+
+ var copy = Hoek.clone(obj);
+
+ expect(obj.a.value).to.equal(5);
+ expect(copy.a.value).to.equal(5);
+ expect(copy.a.b()).to.equal('c');
+ expect(obj.a).to.equal(copy.a);
+ done();
+ });
+
+ it('clones an object with property getter without executing it', function (done) {
+
+ var obj = {};
+ var value = 1;
+ var execCount = 0;
+
+ Object.defineProperty(obj, 'test', {
+ enumerable: true,
+ configurable: true,
+ get: function () {
+
+ ++execCount;
+ return value;
+ }
+ });
+
+ var copy = Hoek.clone(obj);
+ expect(execCount).to.equal(0);
+ expect(copy.test).to.equal(1);
+ expect(execCount).to.equal(1);
+ done();
+ });
+
+ it('clones an object with property getter and setter', function (done) {
+
+ var obj = {
+ _test: 0
+ };
+
+ Object.defineProperty(obj, 'test', {
+ enumerable: true,
+ configurable: true,
+ get: function () {
+
+ return this._test;
+ },
+ set: function (value) {
+
+ this._test = value - 1;
+ }
+ });
+
+ var copy = Hoek.clone(obj);
+ expect(copy.test).to.equal(0);
+ copy.test = 5;
+ expect(copy.test).to.equal(4);
+ done();
+ });
+
+ it('clones an object with only property setter', function (done) {
+
+ var obj = {
+ _test: 0
+ };
+
+ Object.defineProperty(obj, 'test', {
+ enumerable: true,
+ configurable: true,
+ set: function (value) {
+
+ this._test = value - 1;
+ }
+ });
+
+ var copy = Hoek.clone(obj);
+ expect(copy._test).to.equal(0);
+ copy.test = 5;
+ expect(copy._test).to.equal(4);
+ done();
+ });
+
+ it('clones an object with non-enumerable properties', function (done) {
+
+ var obj = {
+ _test: 0
+ };
+
+ Object.defineProperty(obj, 'test', {
+ enumerable: false,
+ configurable: true,
+ set: function (value) {
+
+ this._test = value - 1;
+ }
+ });
+
+ var copy = Hoek.clone(obj);
+ expect(copy._test).to.equal(0);
+ copy.test = 5;
+ expect(copy._test).to.equal(4);
+ done();
+ });
+
+ it('clones an object where getOwnPropertyDescriptor returns undefined', function (done) {
+
+ var oldGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
+ var obj = { a: 'b' };
+ Object.getOwnPropertyDescriptor = function () {
+
+ return undefined;
+ };
+
+ var copy = Hoek.clone(obj);
+ Object.getOwnPropertyDescriptor = oldGetOwnPropertyDescriptor;
+ expect(copy).to.deep.equal(obj);
+ done();
+ });
+});
+
+describe('merge()', function () {
+
+ it('deep copies source items', function (done) {
+
+ var target = {
+ b: 3,
+ d: []
+ };
+
+ var source = {
+ c: {
+ d: 1
+ },
+ d: [{ e: 1 }]
+ };
+
+ Hoek.merge(target, source);
+ expect(target.c).to.not.equal(source.c);
+ expect(target.c).to.deep.equal(source.c);
+ expect(target.d).to.not.equal(source.d);
+ expect(target.d[0]).to.not.equal(source.d[0]);
+ expect(target.d).to.deep.equal(source.d);
+ done();
+ });
+
+ it('merges array over an object', function (done) {
+
+ var a = {
+ x: ['n', 'm']
+ };
+
+ var b = {
+ x: {
+ n: '1',
+ m: '2'
+ }
+ };
+
+ Hoek.merge(b, a);
+ expect(a.x[0]).to.equal('n');
+ expect(a.x.n).to.not.exist();
+ done();
+ });
+
+ it('merges object over an array', function (done) {
+
+ var a = {
+ x: ['n', 'm']
+ };
+
+ var b = {
+ x: {
+ n: '1',
+ m: '2'
+ }
+ };
+
+ Hoek.merge(a, b);
+ expect(a.x.n).to.equal('1');
+ expect(a.x[0]).to.not.exist();
+ done();
+ });
+
+ it('does not throw if source is null', function (done) {
+
+ var a = {};
+ var b = null;
+ var c = null;
+
+ expect(function () {
+
+ c = Hoek.merge(a, b);
+ }).to.not.throw();
+
+ expect(c).to.equal(a);
+ done();
+ });
+
+ it('does not throw if source is undefined', function (done) {
+
+ var a = {};
+ var b;
+ var c = null;
+
+ expect(function () {
+
+ c = Hoek.merge(a, b);
+ }).to.not.throw();
+
+ expect(c).to.equal(a);
+ done();
+ });
+
+ it('throws if source is not an object', function (done) {
+
+ expect(function () {
+
+ var a = {};
+ var b = 0;
+
+ Hoek.merge(a, b);
+ }).to.throw('Invalid source value: must be null, undefined, or an object');
+ done();
+ });
+
+ it('throws if target is not an object', function (done) {
+
+ expect(function () {
+
+ var a = 0;
+ var b = {};
+
+ Hoek.merge(a, b);
+ }).to.throw('Invalid target value: must be an object');
+ done();
+ });
+
+ it('throws if target is not an array and source is', function (done) {
+
+ expect(function () {
+
+ var a = {};
+ var b = [1, 2];
+
+ Hoek.merge(a, b);
+ }).to.throw('Cannot merge array onto an object');
+ done();
+ });
+
+ it('returns the same object when merging arrays', function (done) {
+
+ var a = [];
+ var b = [1, 2];
+
+ expect(Hoek.merge(a, b)).to.equal(a);
+ done();
+ });
+
+ it('combines an empty object with a non-empty object', function (done) {
+
+ var a = {};
+ var b = nestedObj;
+
+ var c = Hoek.merge(a, b);
+ expect(a).to.deep.equal(b);
+ expect(c).to.deep.equal(b);
+ done();
+ });
+
+ it('overrides values in target', function (done) {
+
+ var a = { x: 1, y: 2, z: 3, v: 5, t: 'test', m: 'abc' };
+ var b = { x: null, z: 4, v: 0, t: { u: 6 }, m: '123' };
+
+ var c = Hoek.merge(a, b);
+ expect(c.x).to.equal(null);
+ expect(c.y).to.equal(2);
+ expect(c.z).to.equal(4);
+ expect(c.v).to.equal(0);
+ expect(c.m).to.equal('123');
+ expect(c.t).to.deep.equal({ u: 6 });
+ done();
+ });
+
+ it('overrides values in target (flip)', function (done) {
+
+ var a = { x: 1, y: 2, z: 3, v: 5, t: 'test', m: 'abc' };
+ var b = { x: null, z: 4, v: 0, t: { u: 6 }, m: '123' };
+
+ var d = Hoek.merge(b, a);
+ expect(d.x).to.equal(1);
+ expect(d.y).to.equal(2);
+ expect(d.z).to.equal(3);
+ expect(d.v).to.equal(5);
+ expect(d.m).to.equal('abc');
+ expect(d.t).to.deep.equal('test');
+ done();
+ });
+
+ it('retains Date properties', function (done) {
+
+ var a = { x: new Date(1378776452757) };
+
+ var b = Hoek.merge({}, a);
+ expect(a.x.getTime()).to.equal(b.x.getTime());
+ done();
+ });
+
+ it('retains Date properties when merging keys', function (done) {
+
+ var a = { x: new Date(1378776452757) };
+
+ var b = Hoek.merge({ x: {} }, a);
+ expect(a.x.getTime()).to.equal(b.x.getTime());
+ done();
+ });
+
+ it('overrides Buffer', function (done) {
+
+ var a = { x: new Buffer('abc') };
+
+ var b = Hoek.merge({ x: {} }, a);
+ expect(a.x.toString()).to.equal('abc');
+ done();
+ });
+});
+
+describe('applyToDefaults()', function () {
+
+ var defaults = {
+ a: 1,
+ b: 2,
+ c: {
+ d: 3,
+ e: [5, 6]
+ },
+ f: 6,
+ g: 'test'
+ };
+
+ it('throws when target is null', function (done) {
+
+ expect(function () {
+
+ Hoek.applyToDefaults(null, {});
+ }).to.throw('Invalid defaults value: must be an object');
+ done();
+ });
+
+ it('returns null if options is false', function (done) {
+
+ var result = Hoek.applyToDefaults(defaults, false);
+ expect(result).to.equal(null);
+ done();
+ });
+
+ it('returns null if options is null', function (done) {
+
+ var result = Hoek.applyToDefaults(defaults, null);
+ expect(result).to.equal(null);
+ done();
+ });
+
+ it('returns null if options is undefined', function (done) {
+
+ var result = Hoek.applyToDefaults(defaults, undefined);
+ expect(result).to.equal(null);
+ done();
+ });
+
+ it('returns a copy of defaults if options is true', function (done) {
+
+ var result = Hoek.applyToDefaults(defaults, true);
+ expect(result).to.deep.equal(defaults);
+ done();
+ });
+
+ it('applies object to defaults', function (done) {
+
+ var obj = {
+ a: null,
+ c: {
+ e: [4]
+ },
+ f: 0,
+ g: {
+ h: 5
+ }
+ };
+
+ var result = Hoek.applyToDefaults(defaults, obj);
+ expect(result.c.e).to.deep.equal([4]);
+ expect(result.a).to.equal(1);
+ expect(result.b).to.equal(2);
+ expect(result.f).to.equal(0);
+ expect(result.g).to.deep.equal({ h: 5 });
+ done();
+ });
+
+ it('applies object to defaults with null', function (done) {
+
+ var obj = {
+ a: null,
+ c: {
+ e: [4]
+ },
+ f: 0,
+ g: {
+ h: 5
+ }
+ };
+
+ var result = Hoek.applyToDefaults(defaults, obj, true);
+ expect(result.c.e).to.deep.equal([4]);
+ expect(result.a).to.equal(null);
+ expect(result.b).to.equal(2);
+ expect(result.f).to.equal(0);
+ expect(result.g).to.deep.equal({ h: 5 });
+ done();
+ });
+});
+
+describe('cloneWithShallow()', function () {
+
+ it('deep clones except for listed keys', function (done) {
+
+ var source = {
+ a: {
+ b: 5
+ },
+ c: {
+ d: 6
+ }
+ };
+
+ var copy = Hoek.cloneWithShallow(source, ['c']);
+ expect(copy).to.deep.equal(source);
+ expect(copy).to.not.equal(source);
+ expect(copy.a).to.not.equal(source.a);
+ expect(copy.b).to.equal(source.b);
+ done();
+ });
+
+ it('returns immutable value', function (done) {
+
+ expect(Hoek.cloneWithShallow(5)).to.equal(5);
+ done();
+ });
+
+ it('returns null value', function (done) {
+
+ expect(Hoek.cloneWithShallow(null)).to.equal(null);
+ done();
+ });
+
+ it('returns undefined value', function (done) {
+
+ expect(Hoek.cloneWithShallow(undefined)).to.equal(undefined);
+ done();
+ });
+
+ it('deep clones except for listed keys (including missing keys)', function (done) {
+
+ var source = {
+ a: {
+ b: 5
+ },
+ c: {
+ d: 6
+ }
+ };
+
+ var copy = Hoek.cloneWithShallow(source, ['c', 'v']);
+ expect(copy).to.deep.equal(source);
+ expect(copy).to.not.equal(source);
+ expect(copy.a).to.not.equal(source.a);
+ expect(copy.b).to.equal(source.b);
+ done();
+ });
+});
+
+describe('applyToDefaultsWithShallow()', function () {
+
+ it('shallow copies the listed keys from options without merging', function (done) {
+
+ var defaults = {
+ a: {
+ b: 5,
+ e: 3
+ },
+ c: {
+ d: 7,
+ g: 1
+ }
+ };
+
+ var options = {
+ a: {
+ b: 4
+ },
+ c: {
+ d: 6,
+ f: 7
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['a']);
+ expect(merged).to.deep.equal({ a: { b: 4 }, c: { d: 6, g: 1, f: 7 } });
+ expect(merged.a).to.equal(options.a);
+ expect(merged.a).to.not.equal(defaults.a);
+ expect(merged.c).to.not.equal(options.c);
+ expect(merged.c).to.not.equal(defaults.c);
+ done();
+ });
+
+ it('shallow copies the nested keys (override)', function (done) {
+
+ var defaults = {
+ a: {
+ b: 5
+ },
+ c: {
+ d: 7,
+ g: 1
+ }
+ };
+
+ var options = {
+ a: {
+ b: 4
+ },
+ c: {
+ d: 6,
+ g: {
+ h: 8
+ }
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g']);
+ expect(merged).to.deep.equal({ a: { b: 4 }, c: { d: 6, g: { h: 8 } } });
+ expect(merged.c.g).to.equal(options.c.g);
+ done();
+ });
+
+ it('shallow copies the nested keys (missing)', function (done) {
+
+ var defaults = {
+ a: {
+ b: 5
+ }
+ };
+
+ var options = {
+ a: {
+ b: 4
+ },
+ c: {
+ g: {
+ h: 8
+ }
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g']);
+ expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { h: 8 } } });
+ expect(merged.c.g).to.equal(options.c.g);
+ done();
+ });
+
+ it('shallow copies the nested keys (override)', function (done) {
+
+ var defaults = {
+ a: {
+ b: 5
+ },
+ c: {
+ g: {
+ d: 7
+ }
+ }
+ };
+
+ var options = {
+ a: {
+ b: 4
+ },
+ c: {
+ g: {
+ h: 8
+ }
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g']);
+ expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { h: 8 } } });
+ expect(merged.c.g).to.equal(options.c.g);
+ done();
+ });
+
+ it('shallow copies the nested keys (deeper)', function (done) {
+
+ var defaults = {
+ a: {
+ b: 5
+ }
+ };
+
+ var options = {
+ a: {
+ b: 4
+ },
+ c: {
+ g: {
+ r: {
+ h: 8
+ }
+ }
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['c.g.r']);
+ expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { r: { h: 8 } } } });
+ expect(merged.c.g.r).to.equal(options.c.g.r);
+ done();
+ });
+
+ it('shallow copies the nested keys (not present)', function (done) {
+
+ var defaults = {
+ a: {
+ b: 5
+ }
+ };
+
+ var options = {
+ a: {
+ b: 4
+ },
+ c: {
+ g: {
+ r: {
+ h: 8
+ }
+ }
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, options, ['x.y']);
+ expect(merged).to.deep.equal({ a: { b: 4 }, c: { g: { r: { h: 8 } } } });
+ done();
+ });
+
+ it('shallow copies the listed keys in the defaults', function (done) {
+
+ var defaults = {
+ a: {
+ b: 1
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, {}, ['a']);
+ expect(merged.a).to.equal(defaults.a);
+ done();
+ });
+
+ it('shallow copies the listed keys in the defaults (true)', function (done) {
+
+ var defaults = {
+ a: {
+ b: 1
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, true, ['a']);
+ expect(merged.a).to.equal(defaults.a);
+ done();
+ });
+
+ it('returns null on false', function (done) {
+
+ var defaults = {
+ a: {
+ b: 1
+ }
+ };
+
+ var merged = Hoek.applyToDefaultsWithShallow(defaults, false, ['a']);
+ expect(merged).to.equal(null);
+ done();
+ });
+
+ it('throws on missing defaults', function (done) {
+
+ expect(function () {
+
+ Hoek.applyToDefaultsWithShallow(null, {}, ['a']);
+ }).to.throw('Invalid defaults value: must be an object');
+ done();
+ });
+
+ it('throws on invalid defaults', function (done) {
+
+ expect(function () {
+
+ Hoek.applyToDefaultsWithShallow('abc', {}, ['a']);
+ }).to.throw('Invalid defaults value: must be an object');
+ done();
+ });
+
+ it('throws on invalid options', function (done) {
+
+ expect(function () {
+
+ Hoek.applyToDefaultsWithShallow({}, 'abc', ['a']);
+ }).to.throw('Invalid options value: must be true, falsy or an object');
+ done();
+ });
+
+ it('throws on missing keys', function (done) {
+
+ expect(function () {
+
+ Hoek.applyToDefaultsWithShallow({}, true);
+ }).to.throw('Invalid keys');
+ done();
+ });
+
+ it('throws on invalid keys', function (done) {
+
+ expect(function () {
+
+ Hoek.applyToDefaultsWithShallow({}, true, 'a');
+ }).to.throw('Invalid keys');
+ done();
+ });
+});
+
+describe('deepEqual()', function () {
+
+ it('compares simple values', function (done) {
+
+ expect(Hoek.deepEqual('x', 'x')).to.be.true();
+ expect(Hoek.deepEqual('x', 'y')).to.be.false();
+ expect(Hoek.deepEqual('x1', 'x')).to.be.false();
+ expect(Hoek.deepEqual(-0, +0)).to.be.false();
+ expect(Hoek.deepEqual(-0, -0)).to.be.true();
+ expect(Hoek.deepEqual(+0, +0)).to.be.true();
+ expect(Hoek.deepEqual(+0, -0)).to.be.false();
+ expect(Hoek.deepEqual(1, 1)).to.be.true();
+ expect(Hoek.deepEqual(0, 0)).to.be.true();
+ expect(Hoek.deepEqual(-1, 1)).to.be.false();
+ expect(Hoek.deepEqual(NaN, 0)).to.be.false();
+ expect(Hoek.deepEqual(NaN, NaN)).to.be.true();
+ done();
+ });
+
+ it('compares different types', function (done) {
+
+ expect(Hoek.deepEqual([], 5)).to.be.false();
+ expect(Hoek.deepEqual(5, [])).to.be.false();
+ expect(Hoek.deepEqual({}, null)).to.be.false();
+ expect(Hoek.deepEqual(null, {})).to.be.false();
+ expect(Hoek.deepEqual('abc', {})).to.be.false();
+ expect(Hoek.deepEqual({}, 'abc')).to.be.false();
+ done();
+ });
+
+ it('compares empty structures', function (done) {
+
+ expect(Hoek.deepEqual([], [])).to.be.true();
+ expect(Hoek.deepEqual({}, {})).to.be.true();
+ expect(Hoek.deepEqual([], {})).to.be.false();
+ done();
+ });
+
+ it('compares empty arguments object', function (done) {
+
+ var compare = function () {
+
+ expect(Hoek.deepEqual([], arguments)).to.be.false();
+ };
+
+ compare();
+ done();
+ });
+
+ it('compares empty arguments objects', function (done) {
+
+ var compare = function () {
+
+ var arg1 = arguments;
+
+ var inner = function () {
+
+ expect(Hoek.deepEqual(arg1, arguments)).to.be.false(); // callee is not the same
+ };
+
+ inner();
+ };
+
+ compare();
+ done();
+ });
+
+ it('compares dates', function (done) {
+
+ expect(Hoek.deepEqual(new Date(2015, 1, 1), new Date(2015, 1, 1))).to.be.true();
+ expect(Hoek.deepEqual(new Date(100), new Date(101))).to.be.false();
+ expect(Hoek.deepEqual(new Date(), {})).to.be.false();
+ done();
+ });
+
+ it('compares regular expressions', function (done) {
+
+ expect(Hoek.deepEqual(/\s/, new RegExp('\\\s'))).to.be.true();
+ expect(Hoek.deepEqual(/\s/g, /\s/g)).to.be.true();
+ expect(Hoek.deepEqual(/a/, {})).to.be.false();
+ expect(Hoek.deepEqual(/\s/g, /\s/i)).to.be.false();
+ expect(Hoek.deepEqual(/a/g, /b/g)).to.be.false();
+ done();
+ });
+
+ it('compares arrays', function (done) {
+
+ expect(Hoek.deepEqual([[1]], [[1]])).to.be.true();
+ expect(Hoek.deepEqual([1, 2, 3], [1, 2, 3])).to.be.true();
+ expect(Hoek.deepEqual([1, 2, 3], [1, 3, 2])).to.be.false();
+ expect(Hoek.deepEqual([1, 2, 3], [1, 2])).to.be.false();
+ expect(Hoek.deepEqual([1], [1])).to.be.true();
+ done();
+ });
+
+ it('compares buffers', function (done) {
+
+ expect(Hoek.deepEqual(new Buffer([1, 2, 3]), new Buffer([1, 2, 3]))).to.be.true();
+ expect(Hoek.deepEqual(new Buffer([1, 2, 3]), new Buffer([1, 3, 2]))).to.be.false();
+ expect(Hoek.deepEqual(new Buffer([1, 2, 3]), new Buffer([1, 2]))).to.be.false();
+ expect(Hoek.deepEqual(new Buffer([1, 2, 3]), {})).to.be.false();
+ expect(Hoek.deepEqual(new Buffer([1, 2, 3]), [1, 2, 3])).to.be.false();
+ done();
+ });
+
+ it('compares objects', function (done) {
+
+ expect(Hoek.deepEqual({ a: 1, b: 2, c: 3 }, { a: 1, b: 2, c: 3 })).to.be.true();
+ expect(Hoek.deepEqual({ foo: 'bar' }, { foo: 'baz' })).to.be.false();
+ expect(Hoek.deepEqual({ foo: { bar: 'foo' } }, { foo: { bar: 'baz' } })).to.be.false();
+ done();
+ });
+
+ it('handles circular dependency', function (done) {
+
+ var a = {};
+ a.x = a;
+
+ var b = Hoek.clone(a);
+ expect(Hoek.deepEqual(a, b)).to.be.true();
+ done();
+ });
+
+ it('compares an object with property getter without executing it', function (done) {
+
+ var obj = {};
+ var value = 1;
+ var execCount = 0;
+
+ Object.defineProperty(obj, 'test', {
+ enumerable: true,
+ configurable: true,
+ get: function () {
+
+ ++execCount;
+ return value;
+ }
+ });
+
+ var copy = Hoek.clone(obj);
+ expect(Hoek.deepEqual(obj, copy)).to.be.true();
+ expect(execCount).to.equal(0);
+ expect(copy.test).to.equal(1);
+ expect(execCount).to.equal(1);
+ done();
+ });
+
+ it('compares objects with property getters', function (done) {
+
+ var obj = {};
+ Object.defineProperty(obj, 'test', {
+ enumerable: true,
+ configurable: true,
+ get: function () {
+
+ return 1;
+ }
+ });
+
+ var ref = {};
+ Object.defineProperty(ref, 'test', {
+ enumerable: true,
+ configurable: true,
+ get: function () {
+
+ return 2;
+ }
+ });
+
+ expect(Hoek.deepEqual(obj, ref)).to.be.false();
+ done();
+ });
+
+ it('compares object prototypes', function (done) {
+
+ var Obj = function () {
+
+ this.a = 5;
+ };
+
+ Obj.prototype.b = function () {
+
+ return this.a;
+ };
+
+ var Ref = function () {
+
+ this.a = 5;
+ };
+
+ Ref.prototype.b = function () {
+
+ return this.a;
+ };
+
+ expect(Hoek.deepEqual(new Obj(), new Ref())).to.be.false();
+ expect(Hoek.deepEqual(new Obj(), new Obj())).to.be.true();
+ expect(Hoek.deepEqual(new Ref(), new Ref())).to.be.true();
+ done();
+ });
+
+ it('compares plain objects', function (done) {
+
+ var a = Object.create(null);
+ var b = Object.create(null);
+
+ a.b = 'c';
+ b.b = 'c';
+
+ expect(Hoek.deepEqual(a, b)).to.be.true();
+ expect(Hoek.deepEqual(a, { b: 'c' })).to.be.false();
+ done();
+ });
+
+ it('compares an object with an empty object', function (done) {
+
+ var a = { a: 1, b: 2 };
+
+ expect(Hoek.deepEqual({}, a)).to.be.false();
+ expect(Hoek.deepEqual(a, {})).to.be.false();
+ done();
+ });
+
+ it('compares an object ignoring the prototype', function (done) {
+
+ var a = Object.create(null);
+ var b = {};
+
+ expect(Hoek.deepEqual(a, b, { prototype: false })).to.be.true();
+ done();
+ });
+
+ it('compares an object ignoring the prototype recursively', function (done) {
+
+ var a = [Object.create(null)];
+ var b = [{}];
+
+ expect(Hoek.deepEqual(a, b, { prototype: false })).to.be.true();
+ done();
+ });
+});
+
+describe('unique()', function () {
+
+ it('ensures uniqueness within array of objects based on subkey', function (done) {
+
+ var a = Hoek.unique(dupsArray, 'x');
+ expect(a).to.deep.equal(reducedDupsArray);
+ done();
+ });
+
+ it('removes duplicated without key', function (done) {
+
+ expect(Hoek.unique([1, 2, 3, 4, 2, 1, 5])).to.deep.equal([1, 2, 3, 4, 5]);
+ done();
+ });
+});
+
+describe('mapToObject()', function () {
+
+ it('returns null on null array', function (done) {
+
+ var a = Hoek.mapToObject(null);
+ expect(a).to.equal(null);
+ done();
+ });
+
+ it('converts basic array to existential object', function (done) {
+
+ var keys = [1, 2, 3, 4];
+ var a = Hoek.mapToObject(keys);
+ for (var i in keys) {
+ expect(a[keys[i]]).to.equal(true);
+ }
+ done();
+ });
+
+ it('converts array of objects to existential object', function (done) {
+
+ var keys = [{ x: 1 }, { x: 2 }, { x: 3 }, { y: 4 }];
+ var subkey = 'x';
+ var a = Hoek.mapToObject(keys, subkey);
+ expect(a).to.deep.equal({ 1: true, 2: true, 3: true });
+ done();
+ });
+});
+
+describe('intersect()', function () {
+
+ it('returns the common objects of two arrays', function (done) {
+
+ var array1 = [1, 2, 3, 4, 4, 5, 5];
+ var array2 = [5, 4, 5, 6, 7];
+ var common = Hoek.intersect(array1, array2);
+ expect(common.length).to.equal(2);
+ done();
+ });
+
+ it('returns just the first common object of two arrays', function (done) {
+
+ var array1 = [1, 2, 3, 4, 4, 5, 5];
+ var array2 = [5, 4, 5, 6, 7];
+ var common = Hoek.intersect(array1, array2, true);
+ expect(common).to.equal(5);
+ done();
+ });
+
+ it('returns null when no common and returning just the first common object of two arrays', function (done) {
+
+ var array1 = [1, 2, 3, 4, 4, 5, 5];
+ var array2 = [6, 7];
+ var common = Hoek.intersect(array1, array2, true);
+ expect(common).to.equal(null);
+ done();
+ });
+
+ it('returns an empty array if either input is null', function (done) {
+
+ expect(Hoek.intersect([1], null).length).to.equal(0);
+ expect(Hoek.intersect(null, [1]).length).to.equal(0);
+ done();
+ });
+
+ it('returns the common objects of object and array', function (done) {
+
+ var array1 = [1, 2, 3, 4, 4, 5, 5];
+ var array2 = [5, 4, 5, 6, 7];
+ var common = Hoek.intersect(Hoek.mapToObject(array1), array2);
+ expect(common.length).to.equal(2);
+ done();
+ });
+});
+
+describe('contain()', function () {
+
+ it('tests strings', function (done) {
+
+ expect(Hoek.contain('abc', 'ab')).to.be.true();
+ expect(Hoek.contain('abc', 'abc', { only: true })).to.be.true();
+ expect(Hoek.contain('aaa', 'a', { only: true })).to.be.true();
+ expect(Hoek.contain('abc', 'b', { once: true })).to.be.true();
+ expect(Hoek.contain('abc', ['a', 'c'])).to.be.true();
+ expect(Hoek.contain('abc', ['a', 'd'], { part: true })).to.be.true();
+
+ expect(Hoek.contain('abc', 'ac')).to.be.false();
+ expect(Hoek.contain('abcd', 'abc', { only: true })).to.be.false();
+ expect(Hoek.contain('aab', 'a', { only: true })).to.be.false();
+ expect(Hoek.contain('abb', 'b', { once: true })).to.be.false();
+ expect(Hoek.contain('abc', ['a', 'd'])).to.be.false();
+ expect(Hoek.contain('abc', ['ab', 'bc'])).to.be.false(); // Overlapping values not supported
+ done();
+ });
+
+ it('tests arrays', function (done) {
+
+ expect(Hoek.contain([1, 2, 3], 1)).to.be.true();
+ expect(Hoek.contain([{ a: 1 }], { a: 1 }, { deep: true })).to.be.true();
+ expect(Hoek.contain([1, 2, 3], [1, 2])).to.be.true();
+ expect(Hoek.contain([{ a: 1 }], [{ a: 1 }], { deep: true })).to.be.true();
+ expect(Hoek.contain([1, 1, 2], [1, 2], { only: true })).to.be.true();
+ expect(Hoek.contain([1, 2], [1, 2], { once: true })).to.be.true();
+ expect(Hoek.contain([1, 2, 3], [1, 4], { part: true })).to.be.true();
+ expect(Hoek.contain([[1], [2]], [[1]], { deep: true })).to.be.true();
+
+ expect(Hoek.contain([1, 2, 3], 4)).to.be.false();
+ expect(Hoek.contain([{ a: 1 }], { a: 2 }, { deep: true })).to.be.false();
+ expect(Hoek.contain([{ a: 1 }], { a: 1 })).to.be.false();
+ expect(Hoek.contain([1, 2, 3], [4, 5])).to.be.false();
+ expect(Hoek.contain([[3], [2]], [[1]])).to.be.false();
+ expect(Hoek.contain([[1], [2]], [[1]])).to.be.false();
+ expect(Hoek.contain([{ a: 1 }], [{ a: 2 }], { deep: true })).to.be.false();
+ expect(Hoek.contain([1, 3, 2], [1, 2], { only: true })).to.be.false();
+ expect(Hoek.contain([1, 2, 2], [1, 2], { once: true })).to.be.false();
+ expect(Hoek.contain([0, 2, 3], [1, 4], { part: true })).to.be.false();
+ done();
+ });
+
+ it('tests objects', function (done) {
+
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, 'a')).to.be.true();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, ['a', 'c'])).to.be.true();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, ['a', 'b', 'c'], { only: true })).to.be.true();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1 })).to.be.true();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, c: 3 })).to.be.true();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 }, { part: true })).to.be.true();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, b: 2, c: 3 }, { only: true })).to.be.true();
+ expect(Hoek.contain({ a: [1], b: [2], c: [3] }, { a: [1], c: [3] }, { deep: true })).to.be.true();
+ expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true })).to.be.true();
+ expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, part: true })).to.be.true();
+ expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, part: false })).to.be.false();
+ expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, only: true })).to.be.false();
+ expect(Hoek.contain({ a: [{ b: 1 }, { c: 2 }, { d: 3, e: 4 }] }, { a: [{ b: 1 }, { d: 3 }] }, { deep: true, only: false })).to.be.true();
+
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, 'd')).to.be.false();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, ['a', 'd'])).to.be.false();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3, d: 4 }, ['a', 'b', 'c'], { only: true })).to.be.false();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 2 })).to.be.false();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 2, b: 2 }, { part: true })).to.be.false(); // part does not ignore bad value
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 3 })).to.be.false();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 })).to.be.false();
+ expect(Hoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, b: 2 }, { only: true })).to.be.false();
+ expect(Hoek.contain({ a: [1], b: [2], c: [3] }, { a: [1], c: [3] })).to.be.false();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } })).to.be.false();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true })).to.be.true();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, only: true })).to.be.false();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, only: false })).to.be.true();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, part: true })).to.be.true();
+ expect(Hoek.contain({ a: { b: { c: 1, d: 2 } } }, { a: { b: { c: 1 } } }, { deep: true, part: false })).to.be.false();
+
+ // Getter check
+ var Foo = function (bar) {
+
+ this.bar = bar;
+ };
+
+ Object.defineProperty(Foo.prototype, 'baz', {
+ enumerable: true,
+ get: function () {
+
+ return this.bar;
+ }
+ });
+
+ expect(Hoek.contain({ a: new Foo('b') }, { a: new Foo('b') }, { deep: true })).to.be.true();
+ expect(Hoek.contain({ a: new Foo('b') }, { a: new Foo('b') }, { deep: true, part: true })).to.be.true();
+ expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true })).to.be.true();
+ expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true, only: true })).to.be.false();
+ expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true, part: false })).to.be.false();
+ expect(Hoek.contain({ a: new Foo('b') }, { a: { baz: 'b' } }, { deep: true, part: true })).to.be.true();
+
+ done();
+ });
+});
+
+describe('flatten()', function () {
+
+ it('returns a flat array', function (done) {
+
+ var result = Hoek.flatten([1, 2, [3, 4, [5, 6], [7], 8], [9], [10, [11, 12]], 13]);
+ expect(result.length).to.equal(13);
+ expect(result).to.deep.equal([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]);
+ done();
+ });
+});
+
+describe('reach()', function () {
+
+ var obj = {
+ a: {
+ b: {
+ c: {
+ d: 1,
+ e: 2
+ },
+ f: 'hello'
+ },
+ g: {
+ h: 3
+ }
+ },
+ i: function () { },
+ j: null,
+ k: [4, 8, 9, 1]
+ };
+
+ obj.i.x = 5;
+
+ it('returns object itself', function (done) {
+
+ expect(Hoek.reach(obj, null)).to.equal(obj);
+ expect(Hoek.reach(obj, false)).to.equal(obj);
+ expect(Hoek.reach(obj)).to.equal(obj);
+ done();
+ });
+
+ it('returns first value of array', function (done) {
+
+ expect(Hoek.reach(obj, 'k.0')).to.equal(4);
+ done();
+ });
+
+ it('returns last value of array using negative index', function (done) {
+
+ expect(Hoek.reach(obj, 'k.-2')).to.equal(9);
+ done();
+ });
+
+ it('returns a valid member', function (done) {
+
+ expect(Hoek.reach(obj, 'a.b.c.d')).to.equal(1);
+ done();
+ });
+
+ it('returns a valid member with separator override', function (done) {
+
+ expect(Hoek.reach(obj, 'a/b/c/d', '/')).to.equal(1);
+ done();
+ });
+
+ it('returns undefined on null object', function (done) {
+
+ expect(Hoek.reach(null, 'a.b.c.d')).to.equal(undefined);
+ done();
+ });
+
+ it('returns undefined on missing object member', function (done) {
+
+ expect(Hoek.reach(obj, 'a.b.c.d.x')).to.equal(undefined);
+ done();
+ });
+
+ it('returns undefined on missing function member', function (done) {
+
+ expect(Hoek.reach(obj, 'i.y', { functions: true })).to.equal(undefined);
+ done();
+ });
+
+ it('throws on missing member in strict mode', function (done) {
+
+ expect(function () {
+
+ Hoek.reach(obj, 'a.b.c.o.x', { strict: true });
+ }).to.throw('Missing segment o in reach path a.b.c.o.x');
+
+ done();
+ });
+
+ it('returns undefined on invalid member', function (done) {
+
+ expect(Hoek.reach(obj, 'a.b.c.d-.x')).to.equal(undefined);
+ done();
+ });
+
+ it('returns function member', function (done) {
+
+ expect(typeof Hoek.reach(obj, 'i')).to.equal('function');
+ done();
+ });
+
+ it('returns function property', function (done) {
+
+ expect(Hoek.reach(obj, 'i.x')).to.equal(5);
+ done();
+ });
+
+ it('returns null', function (done) {
+
+ expect(Hoek.reach(obj, 'j')).to.equal(null);
+ done();
+ });
+
+ it('throws on function property when functions not allowed', function (done) {
+
+ expect(function () {
+
+ Hoek.reach(obj, 'i.x', { functions: false });
+ }).to.throw('Invalid segment x in reach path i.x');
+
+ done();
+ });
+
+ it('will return a default value if property is not found', function (done) {
+
+ expect(Hoek.reach(obj, 'a.b.q', { default: 'defaultValue' })).to.equal('defaultValue');
+ done();
+ });
+
+ it('will return a default value if path is not found', function (done) {
+
+ expect(Hoek.reach(obj, 'q', { default: 'defaultValue' })).to.equal('defaultValue');
+ done();
+ });
+
+ it('allows a falsey value to be used as the default value', function (done) {
+
+ expect(Hoek.reach(obj, 'q', { default: '' })).to.equal('');
+ done();
+ });
+});
+
+describe('reachTemplate()', function () {
+
+ it('applies object to template', function (done) {
+
+ var obj = {
+ a: {
+ b: {
+ c: {
+ d: 1
+ }
+ }
+ },
+ j: null,
+ k: [4, 8, 9, 1]
+ };
+
+ var template = '{k.0}:{k.-2}:{a.b.c.d}:{x.y}:{j}';
+
+ expect(Hoek.reachTemplate(obj, template)).to.equal('4:9:1::');
+ done();
+ });
+
+ it('applies object to template (options)', function (done) {
+
+ var obj = {
+ a: {
+ b: {
+ c: {
+ d: 1
+ }
+ }
+ },
+ j: null,
+ k: [4, 8, 9, 1]
+ };
+
+ var template = '{k/0}:{k/-2}:{a/b/c/d}:{x/y}:{j}';
+
+ expect(Hoek.reachTemplate(obj, template, '/')).to.equal('4:9:1::');
+ done();
+ });
+});
+
+describe('callStack()', function () {
+
+ it('returns the full call stack', function (done) {
+
+ var stack = Hoek.callStack();
+ expect(stack[0][0]).to.contain('index.js');
+ expect(stack[0][2]).to.equal(26);
+ done();
+ });
+});
+
+describe('displayStack ()', function () {
+
+ it('returns the full call stack for display', function (done) {
+
+ var stack = Hoek.displayStack();
+ expect(stack[0]).to.contain(Path.normalize('/test/index.js') + ':');
+ done();
+ });
+
+ it('includes constructor functions correctly', function (done) {
+
+ var Something = function (next) {
+
+ next();
+ };
+
+ var something = new Something(function () {
+
+ var stack = Hoek.displayStack();
+ expect(stack[1]).to.contain('new Something');
+ done();
+ });
+ });
+});
+
+describe('abort()', function () {
+
+ it('exits process when not in test mode', function (done) {
+
+ var env = process.env.NODE_ENV;
+ var write = process.stdout.write;
+ var exit = process.exit;
+
+ process.env.NODE_ENV = 'nottatest';
+ process.stdout.write = function () { };
+ process.exit = function (state) {
+
+ process.exit = exit;
+ process.env.NODE_ENV = env;
+ process.stdout.write = write;
+
+ expect(state).to.equal(1);
+ done();
+ };
+
+ Hoek.abort('Boom');
+ });
+
+ it('throws when not in test mode and abortThrow is true', function (done) {
+
+ var env = process.env.NODE_ENV;
+ process.env.NODE_ENV = 'nottatest';
+ Hoek.abortThrow = true;
+
+ var fn = function () {
+
+ Hoek.abort('my error message');
+ };
+
+ expect(fn).to.throw('my error message');
+ Hoek.abortThrow = false;
+ process.env.NODE_ENV = env;
+
+ done();
+ });
+
+ it('respects hideStack argument', function (done) {
+
+ var env = process.env.NODE_ENV;
+ var write = process.stdout.write;
+ var exit = process.exit;
+ var output = '';
+
+ process.exit = function () { };
+ process.env.NODE_ENV = '';
+ process.stdout.write = function (message) {
+
+ output = message;
+ };
+
+ Hoek.abort('my error message', true);
+
+ process.env.NODE_ENV = env;
+ process.stdout.write = write;
+ process.exit = exit;
+
+ expect(output).to.equal('ABORT: my error message\n\t\n');
+
+ done();
+ });
+
+ it('throws in test mode', function (done) {
+
+ var env = process.env.NODE_ENV;
+ process.env.NODE_ENV = 'test';
+
+ expect(function () {
+
+ Hoek.abort('my error message', true);
+ }).to.throw('my error message');
+
+ process.env.NODE_ENV = env;
+ done();
+ });
+
+ it('throws in test mode with default message', function (done) {
+
+ var env = process.env.NODE_ENV;
+ process.env.NODE_ENV = 'test';
+
+ expect(function () {
+
+ Hoek.abort('', true);
+ }).to.throw('Unknown error');
+
+ process.env.NODE_ENV = env;
+ done();
+ });
+
+ it('defaults to showing stack', function (done) {
+
+ var env = process.env.NODE_ENV;
+ var write = process.stdout.write;
+ var exit = process.exit;
+ var output = '';
+
+ process.exit = function () { };
+ process.env.NODE_ENV = '';
+ process.stdout.write = function (message) {
+
+ output = message;
+ };
+
+ Hoek.abort('my error message');
+
+ process.env.NODE_ENV = env;
+ process.stdout.write = write;
+ process.exit = exit;
+
+ expect(output).to.contain('index.js');
+
+ done();
+ });
+});
+
+describe('assert()', function () {
+
+ it('throws an Error when using assert in a test', function (done) {
+
+ var fn = function () {
+
+ Hoek.assert(false, 'my error message');
+ };
+
+ expect(fn).to.throw('my error message');
+ done();
+ });
+
+ it('throws an Error when using assert in a test with no message', function (done) {
+
+ var fn = function () {
+
+ Hoek.assert(false);
+ };
+
+ expect(fn).to.throw('Unknown error');
+ done();
+ });
+
+ it('throws an Error when using assert in a test with multipart message', function (done) {
+
+ var fn = function () {
+
+ Hoek.assert(false, 'This', 'is', 'my message');
+ };
+
+ expect(fn).to.throw('This is my message');
+ done();
+ });
+
+ it('throws an Error when using assert in a test with multipart message (empty)', function (done) {
+
+ var fn = function () {
+
+ Hoek.assert(false, 'This', 'is', '', 'my message');
+ };
+
+ expect(fn).to.throw('This is my message');
+ done();
+ });
+
+ it('throws an Error when using assert in a test with object message', function (done) {
+
+ var fn = function () {
+
+ Hoek.assert(false, 'This', 'is', { spinal: 'tap' });
+ };
+
+ expect(fn).to.throw('This is {"spinal":"tap"}');
+ done();
+ });
+
+ it('throws an Error when using assert in a test with multipart string and error messages', function (done) {
+
+ var fn = function () {
+
+ Hoek.assert(false, 'This', 'is', new Error('spinal'), new Error('tap'));
+ };
+
+ expect(fn).to.throw('This is spinal tap');
+ done();
+ });
+
+ it('throws an Error when using assert in a test with error object message', function (done) {
+
+ var fn = function () {
+
+ Hoek.assert(false, new Error('This is spinal tap'));
+ };
+
+ expect(fn).to.throw('This is spinal tap');
+ done();
+ });
+
+ it('throws the same Error that is passed to it if there is only one error passed', function (done) {
+
+ var error = new Error('ruh roh');
+ var error2 = new Error('ruh roh');
+
+ var fn = function () {
+
+ Hoek.assert(false, error);
+ };
+
+ try {
+ fn();
+ } catch (err) {
+ expect(error).to.equal(error); // should be the same reference
+ expect(error).to.not.equal(error2); // error with the same message should not match
+ }
+
+ done();
+ });
+});
+
+describe('Timer', function () {
+
+ it('returns time elapsed', function (done) {
+
+ var timer = new Hoek.Timer();
+ setTimeout(function () {
+
+ expect(timer.elapsed()).to.be.above(9);
+ done();
+ }, 12);
+ });
+});
+
+describe('Bench', function () {
+
+ it('returns time elapsed', function (done) {
+
+ var timer = new Hoek.Bench();
+ setTimeout(function () {
+
+ expect(timer.elapsed()).to.be.above(9);
+ done();
+ }, 12);
+ });
+});
+
+describe('escapeRegex()', function () {
+
+ it('escapes all special regular expression characters', function (done) {
+
+ var a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\/`"(>)[<]d{}s,');
+ expect(a).to.equal('4\\^f\\$s\\.4\\*5\\+\\-_\\?%\\=#\\!\\:@\\|~\\\\\\/`"\\(>\\)\\[<\\]d\\{\\}s\\,');
+ done();
+ });
+});
+
+describe('Base64Url', function () {
+
+ var base64str = 'AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn-AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq-wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_w';
+ var str = unescape('%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29*+%2C-./0123456789%3A%3B%3C%3D%3E%3F@ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF');
+
+ describe('base64urlEncode()', function () {
+
+ it('should base64 URL-safe a string', function (done) {
+
+ expect(Hoek.base64urlEncode(str)).to.equal(base64str);
+ done();
+ });
+
+ it('encodes a buffer', function (done) {
+
+ expect(Hoek.base64urlEncode(new Buffer(str, 'binary'))).to.equal(base64str);
+ done();
+ });
+
+ it('should base64 URL-safe a hex string', function (done) {
+
+ var buffer = new Buffer(str, 'binary');
+ expect(Hoek.base64urlEncode(buffer.toString('hex'), 'hex')).to.equal(base64str);
+ done();
+ });
+
+ it('works on larger input strings', function (done) {
+
+ var input = Fs.readFileSync(Path.join(__dirname, 'index.js')).toString();
+ var encoded = Hoek.base64urlEncode(input);
+
+ expect(encoded).to.not.contain('+');
+ expect(encoded).to.not.contain('/');
+
+ var decoded = Hoek.base64urlDecode(encoded);
+
+ expect(decoded).to.equal(input);
+ done();
+ });
+ });
+
+ describe('base64urlDecode()', function () {
+
+ it('should un-base64 URL-safe a string', function (done) {
+
+ expect(Hoek.base64urlDecode(base64str)).to.equal(str);
+ done();
+ });
+
+ it('should un-base64 URL-safe a string into hex', function (done) {
+
+ expect(Hoek.base64urlDecode(base64str, 'hex')).to.equal(new Buffer(str, 'binary').toString('hex'));
+ done();
+ });
+
+ it('should un-base64 URL-safe a string and return a buffer', function (done) {
+
+ var buf = Hoek.base64urlDecode(base64str, 'buffer');
+ expect(buf instanceof Buffer).to.equal(true);
+ expect(buf.toString('binary')).to.equal(str);
+ done();
+ });
+
+ it('returns error on undefined input', function (done) {
+
+ expect(Hoek.base64urlDecode().message).to.exist();
+ done();
+ });
+
+ it('returns error on invalid input', function (done) {
+
+ expect(Hoek.base64urlDecode('*').message).to.exist();
+ done();
+ });
+ });
+});
+
+describe('escapeHeaderAttribute()', function () {
+
+ it('should not alter ascii values', function (done) {
+
+ var a = Hoek.escapeHeaderAttribute('My Value');
+ expect(a).to.equal('My Value');
+ done();
+ });
+
+ it('escapes all special HTTP header attribute characters', function (done) {
+
+ var a = Hoek.escapeHeaderAttribute('I said go!!!#"' + String.fromCharCode(92));
+ expect(a).to.equal('I said go!!!#\\"\\\\');
+ done();
+ });
+
+ it('throws on large unicode characters', function (done) {
+
+ var fn = function () {
+
+ Hoek.escapeHeaderAttribute('this is a test' + String.fromCharCode(500) + String.fromCharCode(300));
+ };
+
+ expect(fn).to.throw(Error);
+ done();
+ });
+
+ it('throws on CRLF to prevent response splitting', function (done) {
+
+ var fn = function () {
+
+ Hoek.escapeHeaderAttribute('this is a test\r\n');
+ };
+
+ expect(fn).to.throw(Error);
+ done();
+ });
+});
+
+describe('escapeHtml()', function () {
+
+ it('escapes all special HTML characters', function (done) {
+
+ var a = Hoek.escapeHtml('&<>"\'`');
+ expect(a).to.equal('&amp;&lt;&gt;&quot;&#x27;&#x60;');
+ done();
+ });
+
+ it('returns empty string on falsy input', function (done) {
+
+ var a = Hoek.escapeHtml('');
+ expect(a).to.equal('');
+ done();
+ });
+
+ it('returns unchanged string on no reserved input', function (done) {
+
+ var a = Hoek.escapeHtml('abc');
+ expect(a).to.equal('abc');
+ done();
+ });
+});
+
+describe('nextTick()', function () {
+
+ it('calls the provided callback on nextTick', function (done) {
+
+ var a = 0;
+
+ var inc = function (step, next) {
+
+ a += step;
+ next();
+ };
+
+ var ticked = Hoek.nextTick(inc);
+
+ ticked(5, function () {
+
+ expect(a).to.equal(6);
+ done();
+ });
+
+ expect(a).to.equal(0);
+ inc(1, function () {
+
+ expect(a).to.equal(1);
+ });
+ });
+});
+
+describe('once()', function () {
+
+ it('allows function to only execute once', function (done) {
+
+ var gen = 0;
+ var add = function (x) {
+
+ gen += x;
+ };
+
+ add(5);
+ expect(gen).to.equal(5);
+ add = Hoek.once(add);
+ add(5);
+ expect(gen).to.equal(10);
+ add(5);
+ expect(gen).to.equal(10);
+ done();
+ });
+
+ it('double once wraps one time', function (done) {
+
+ var method = function () { };
+ method = Hoek.once(method);
+ method.x = 1;
+ method = Hoek.once(method);
+ expect(method.x).to.equal(1);
+ done();
+ });
+});
+
+describe('isAbsoltePath()', function () {
+
+ it('identifies if path is absolute on Unix without node support', { parallel: false }, function (done) {
+
+ var orig = Path.isAbsolute;
+ Path.isAbsolute = undefined;
+
+ expect(Hoek.isAbsolutePath('')).to.equal(false);
+ expect(Hoek.isAbsolutePath('a')).to.equal(false);
+ expect(Hoek.isAbsolutePath('./a')).to.equal(false);
+ expect(Hoek.isAbsolutePath('/a')).to.equal(true);
+ expect(Hoek.isAbsolutePath('/')).to.equal(true);
+
+ Path.isAbsolute = orig;
+
+ done();
+ });
+
+ it('identifies if path is absolute with fake node support', { parallel: false }, function (done) {
+
+ var orig = Path.isAbsolute;
+ Path.isAbsolute = function (path) {
+
+ return path[0] === '/';
+ };
+
+ expect(Hoek.isAbsolutePath('', 'linux')).to.equal(false);
+ expect(Hoek.isAbsolutePath('a', 'linux')).to.equal(false);
+ expect(Hoek.isAbsolutePath('./a', 'linux')).to.equal(false);
+ expect(Hoek.isAbsolutePath('/a', 'linux')).to.equal(true);
+ expect(Hoek.isAbsolutePath('/', 'linux')).to.equal(true);
+
+ Path.isAbsolute = orig;
+
+ done();
+ });
+
+ it('identifies if path is absolute on Windows without node support', { parallel: false }, function (done) {
+
+ var orig = Path.isAbsolute;
+ Path.isAbsolute = undefined;
+
+ expect(Hoek.isAbsolutePath('//server/file', 'win32')).to.equal(true);
+ expect(Hoek.isAbsolutePath('//server/file', 'win32')).to.equal(true);
+ expect(Hoek.isAbsolutePath('\\\\server\\file', 'win32')).to.equal(true);
+ expect(Hoek.isAbsolutePath('C:/Users/', 'win32')).to.equal(true);
+ expect(Hoek.isAbsolutePath('C:\\Users\\', 'win32')).to.equal(true);
+ expect(Hoek.isAbsolutePath('C:cwd/another', 'win32')).to.equal(false);
+ expect(Hoek.isAbsolutePath('C:cwd\\another', 'win32')).to.equal(false);
+ expect(Hoek.isAbsolutePath('directory/directory', 'win32')).to.equal(false);
+ expect(Hoek.isAbsolutePath('directory\\directory', 'win32')).to.equal(false);
+
+ Path.isAbsolute = orig;
+
+ done();
+ });
+});
+
+describe('isInteger()', function () {
+
+ it('validates integers', function (done) {
+
+ expect(Hoek.isInteger(0)).to.equal(true);
+ expect(Hoek.isInteger(1)).to.equal(true);
+ expect(Hoek.isInteger(1394035612500)).to.equal(true);
+ expect(Hoek.isInteger('0')).to.equal(false);
+ expect(Hoek.isInteger(1.0)).to.equal(true);
+ expect(Hoek.isInteger(1.1)).to.equal(false);
+ done();
+ });
+});
+
+describe('ignore()', function () {
+
+ it('exists', function (done) {
+
+ expect(Hoek.ignore).to.exist();
+ expect(typeof Hoek.ignore).to.equal('function');
+ done();
+ });
+});
+
+describe('inherits()', function () {
+
+ it('exists', function (done) {
+
+ expect(Hoek.inherits).to.exist();
+ expect(typeof Hoek.inherits).to.equal('function');
+ done();
+ });
+});
+
+describe('format()', function () {
+
+ it('exists', function (done) {
+
+ expect(Hoek.format).to.exist();
+ expect(typeof Hoek.format).to.equal('function');
+ done();
+ });
+
+ it('is a reference to Util.format', function (done) {
+
+ expect(Hoek.format('hello %s', 'world')).to.equal('hello world');
+ done();
+ });
+});
+
+describe('transform()', function () {
+
+ var source = {
+ address: {
+ one: '123 main street',
+ two: 'PO Box 1234'
+ },
+ zip: {
+ code: 3321232,
+ province: null
+ },
+ title: 'Warehouse',
+ state: 'CA'
+ };
+
+ var sourcesArray = [{
+ address: {
+ one: '123 main street',
+ two: 'PO Box 1234'
+ },
+ zip: {
+ code: 3321232,
+ province: null
+ },
+ title: 'Warehouse',
+ state: 'CA'
+ }, {
+ address: {
+ one: '456 market street',
+ two: 'PO Box 5678'
+ },
+ zip: {
+ code: 9876,
+ province: null
+ },
+ title: 'Garage',
+ state: 'NY'
+ }];
+
+ it('transforms an object based on the input object', function (done) {
+
+ var result = Hoek.transform(source, {
+ 'person.address.lineOne': 'address.one',
+ 'person.address.lineTwo': 'address.two',
+ 'title': 'title',
+ 'person.address.region': 'state',
+ 'person.address.zip': 'zip.code',
+ 'person.address.location': 'zip.province'
+ });
+
+ expect(result).to.deep.equal({
+ person: {
+ address: {
+ lineOne: '123 main street',
+ lineTwo: 'PO Box 1234',
+ region: 'CA',
+ zip: 3321232,
+ location: null
+ }
+ },
+ title: 'Warehouse'
+ });
+
+ done();
+ });
+
+ it('transforms an array of objects based on the input object', function (done) {
+
+ var result = Hoek.transform(sourcesArray, {
+ 'person.address.lineOne': 'address.one',
+ 'person.address.lineTwo': 'address.two',
+ 'title': 'title',
+ 'person.address.region': 'state',
+ 'person.address.zip': 'zip.code',
+ 'person.address.location': 'zip.province'
+ });
+
+ expect(result).to.deep.equal([
+ {
+ person: {
+ address: {
+ lineOne: '123 main street',
+ lineTwo: 'PO Box 1234',
+ region: 'CA',
+ zip: 3321232,
+ location: null
+ }
+ },
+ title: 'Warehouse'
+ },
+ {
+ person: {
+ address: {
+ lineOne: '456 market street',
+ lineTwo: 'PO Box 5678',
+ region: 'NY',
+ zip: 9876,
+ location: null
+ }
+ },
+ title: 'Garage'
+ }
+ ]);
+
+ done();
+ });
+
+ it('uses the reach options passed into it', function (done) {
+
+ var schema = {
+ 'person.address.lineOne': 'address-one',
+ 'person.address.lineTwo': 'address-two',
+ 'title': 'title',
+ 'person.address.region': 'state',
+ 'person.prefix': 'person-title',
+ 'person.zip': 'zip-code'
+ };
+ var options = {
+ separator: '-',
+ default: 'unknown'
+ };
+ var result = Hoek.transform(source, schema, options);
+
+ expect(result).to.deep.equal({
+ person: {
+ address: {
+ lineOne: '123 main street',
+ lineTwo: 'PO Box 1234',
+ region: 'CA'
+ },
+ prefix: 'unknown',
+ zip: 3321232
+ },
+ title: 'Warehouse'
+ });
+
+ done();
+ });
+
+ it('works to create shallow objects', function (done) {
+
+ var result = Hoek.transform(source, {
+ lineOne: 'address.one',
+ lineTwo: 'address.two',
+ title: 'title',
+ region: 'state',
+ province: 'zip.province'
+ });
+
+ expect(result).to.deep.equal({
+ lineOne: '123 main street',
+ lineTwo: 'PO Box 1234',
+ title: 'Warehouse',
+ region: 'CA',
+ province: null
+ });
+
+ done();
+ });
+
+ it('only allows strings in the map', function (done) {
+
+ expect(function () {
+
+ var result = Hoek.transform(source, {
+ lineOne: {}
+ });
+ }).to.throw('All mappings must be "." delineated strings');
+
+ done();
+ });
+
+ it('throws an error on invalid arguments', function (done) {
+
+ expect(function () {
+
+ var result = Hoek.transform(NaN, {});
+ }).to.throw('Invalid source object: must be null, undefined, an object, or an array');
+
+ done();
+ });
+
+ it('is safe to pass null', function (done) {
+
+ var result = Hoek.transform(null, {});
+ expect(result).to.deep.equal({});
+
+ done();
+ });
+
+ it('is safe to pass undefined', function (done) {
+
+ var result = Hoek.transform(undefined, {});
+ expect(result).to.deep.equal({});
+
+ done();
+ });
+});
+
+describe('uniqueFilename()', function () {
+
+ it('generates a random file path', function (done) {
+
+ var result = Hoek.uniqueFilename('./test/modules');
+
+ expect(result).to.exist();
+ expect(result).to.be.a.string();
+ expect(result).to.contain('test/modules');
+ done();
+ });
+
+ it('is random enough to use in fast loops', function (done) {
+
+ var results = [];
+
+ for (var i = 0; i < 10; ++i) {
+ results[i] = Hoek.uniqueFilename('./test/modules');
+ }
+
+ var filter = results.filter(function (item, index, array) {
+
+ return array.indexOf(item) === index;
+ });
+
+ expect(filter.length).to.equal(10);
+ expect(results.length).to.equal(10);
+ done();
+
+ });
+
+ it('combines the random elements with a supplied character', function (done) {
+
+ var result = Hoek.uniqueFilename('./test', 'txt');
+
+ expect(result).to.contain('test/');
+ expect(result).to.contain('.txt');
+
+ done();
+ });
+
+ it('accepts extensions with a "." in it', function (done) {
+
+ var result = Hoek.uniqueFilename('./test', '.mp3');
+
+ expect(result).to.contain('test/');
+ expect(result).to.contain('.mp3');
+
+ done();
+ });
+});
+
+describe('stringify()', function (done) {
+
+ it('converts object to string', function (done) {
+
+ var obj = { a: 1 };
+ expect(Hoek.stringify(obj)).to.equal('{"a":1}');
+ done();
+ });
+
+ it('returns error in result string', function (done) {
+
+ var obj = { a: 1 };
+ obj.b = obj;
+ expect(Hoek.stringify(obj)).to.equal('[Cannot display object: Converting circular structure to JSON]');
+ done();
+ });
+});
+
+describe('shallow()', function (done) {
+
+ it('shallow copies an object', function (done) {
+
+ var obj = {
+ a: 5,
+ b: {
+ c: 6
+ }
+ };
+
+ var shallow = Hoek.shallow(obj);
+ expect(shallow).to.not.equal(obj);
+ expect(shallow).to.deep.equal(obj);
+ expect(shallow.b).to.equal(obj.b);
+ done();
+ });
+});
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/ignore.txt b/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/ignore.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/ignore.txt
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js b/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js
new file mode 100644
index 000000000..fa4e06abe
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js
@@ -0,0 +1 @@
+exports.x = 1;
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js b/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js
new file mode 100644
index 000000000..88e9166e8
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js
@@ -0,0 +1 @@
+exports.y = 2;
diff --git a/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js b/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js
new file mode 100644
index 000000000..670e724a6
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js
@@ -0,0 +1 @@
+exports.z = 3;
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore b/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore
new file mode 100644
index 000000000..77ba16cb0
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore
@@ -0,0 +1,18 @@
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml b/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml
new file mode 100755
index 000000000..047f7e3d5
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+
+node_js:
+ - 0.10
+
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE b/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE
new file mode 100755
index 000000000..b0d877439
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE
@@ -0,0 +1,28 @@
+Copyright (c) 2012-2014, Eran Hammer and other contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The names of any contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ * * *
+
+The complete list of contributors can be found at: https://github.com/hueniverse/sntp/graphs/contributors
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile b/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile
new file mode 100755
index 000000000..417fd9370
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile
@@ -0,0 +1,9 @@
+test:
+ @node node_modules/lab/bin/lab
+test-cov:
+ @node node_modules/lab/bin/lab -t 100 -m 3000
+test-cov-html:
+ @node node_modules/lab/bin/lab -r html -o coverage.html
+
+.PHONY: test test-cov test-cov-html
+
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/README.md b/node_modules/request/node_modules/hawk/node_modules/sntp/README.md
new file mode 100755
index 000000000..98a6e025d
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/sntp/README.md
@@ -0,0 +1,68 @@
+# sntp
+
+An SNTP v4 client (RFC4330) for node. Simpy connects to the NTP or SNTP server requested and returns the server time
+along with the roundtrip duration and clock offset. To adjust the local time to the NTP time, add the returned `t` offset
+to the local time.
+
+[![Build Status](https://secure.travis-ci.org/hueniverse/sntp.png)](http://travis-ci.org/hueniverse/sntp)
+
+# Usage
+
+```javascript
+var Sntp = require('sntp');
+
+// All options are optional
+
+var options = {
+ host: 'nist1-sj.ustiming.org', // Defaults to pool.ntp.org
+ port: 123, // Defaults to 123 (NTP)
+ resolveReference: true, // Default to false (not resolving)
+ timeout: 1000 // Defaults to zero (no timeout)
+};
+
+// Request server time
+
+Sntp.time(options, function (err, time) {
+
+ if (err) {
+ console.log('Failed: ' + err.message);
+ process.exit(1);
+ }
+
+ console.log('Local clock is off by: ' + time.t + ' milliseconds');
+ process.exit(0);
+});
+```
+
+If an application needs to maintain continuous time synchronization, the module provides a stateful method for
+querying the current offset only when the last one is too old (defaults to daily).
+
+```javascript
+// Request offset once
+
+Sntp.offset(function (err, offset) {
+
+ console.log(offset); // New (served fresh)
+
+ // Request offset again
+
+ Sntp.offset(function (err, offset) {
+
+ console.log(offset); // Identical (served from cache)
+ });
+});
+```
+
+To set a background offset refresh, start the interval and use the provided now() method. If for any reason the
+client fails to obtain an up-to-date offset, the current system clock is used.
+
+```javascript
+var before = Sntp.now(); // System time without offset
+
+Sntp.start(function () {
+
+ var now = Sntp.now(); // With offset
+ Sntp.stop();
+});
+```
+
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js b/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js
new file mode 100755
index 000000000..0303f6dcf
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js
@@ -0,0 +1,16 @@
+var Sntp = require('../lib');
+
+// Request offset once
+
+Sntp.offset(function (err, offset) {
+
+ console.log(offset); // New (served fresh)
+
+ // Request offset again
+
+ Sntp.offset(function (err, offset) {
+
+ console.log(offset); // Identical (served from cache)
+ });
+});
+
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js b/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js
new file mode 100755
index 000000000..bd70d0e6a
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js
@@ -0,0 +1,25 @@
+var Sntp = require('../lib');
+
+// All options are optional
+
+var options = {
+ host: 'nist1-sj.ustiming.org', // Defaults to pool.ntp.org
+ port: 123, // Defaults to 123 (NTP)
+ resolveReference: true, // Default to false (not resolving)
+ timeout: 1000 // Defaults to zero (no timeout)
+};
+
+// Request server time
+
+Sntp.time(options, function (err, time) {
+
+ if (err) {
+ console.log('Failed: ' + err.message);
+ process.exit(1);
+ }
+
+ console.log(time);
+ console.log('Local clock is off by: ' + time.t + ' milliseconds');
+ process.exit(0);
+});
+
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/index.js b/node_modules/request/node_modules/hawk/node_modules/sntp/index.js
new file mode 100755
index 000000000..4cc88b358
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/sntp/index.js
@@ -0,0 +1 @@
+module.exports = require('./lib'); \ No newline at end of file
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js b/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js
new file mode 100755
index 000000000..e91718b4f
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js
@@ -0,0 +1,412 @@
+// Load modules
+
+var Dgram = require('dgram');
+var Dns = require('dns');
+var Hoek = require('hoek');
+
+
+// Declare internals
+
+var internals = {};
+
+
+exports.time = function (options, callback) {
+
+ if (arguments.length !== 2) {
+ callback = arguments[0];
+ options = {};
+ }
+
+ var settings = Hoek.clone(options);
+ settings.host = settings.host || 'pool.ntp.org';
+ settings.port = settings.port || 123;
+ settings.resolveReference = settings.resolveReference || false;
+
+ // Declare variables used by callback
+
+ var timeoutId = 0;
+ var sent = 0;
+
+ // Ensure callback is only called once
+
+ var finish = function (err, result) {
+
+ if (timeoutId) {
+ clearTimeout(timeoutId);
+ timeoutId = 0;
+ }
+
+ socket.removeAllListeners();
+ socket.once('error', internals.ignore);
+ socket.close();
+ return callback(err, result);
+ };
+
+ finish = Hoek.once(finish);
+
+ // Create UDP socket
+
+ var socket = Dgram.createSocket('udp4');
+
+ socket.once('error', function (err) {
+
+ return finish(err);
+ });
+
+ // Listen to incoming messages
+
+ socket.on('message', function (buffer, rinfo) {
+
+ var received = Date.now();
+
+ var message = new internals.NtpMessage(buffer);
+ if (!message.isValid) {
+ return finish(new Error('Invalid server response'), message);
+ }
+
+ if (message.originateTimestamp !== sent) {
+ return finish(new Error('Wrong originate timestamp'), message);
+ }
+
+ // Timestamp Name ID When Generated
+ // ------------------------------------------------------------
+ // Originate Timestamp T1 time request sent by client
+ // Receive Timestamp T2 time request received by server
+ // Transmit Timestamp T3 time reply sent by server
+ // Destination Timestamp T4 time reply received by client
+ //
+ // The roundtrip delay d and system clock offset t are defined as:
+ //
+ // d = (T4 - T1) - (T3 - T2) t = ((T2 - T1) + (T3 - T4)) / 2
+
+ var T1 = message.originateTimestamp;
+ var T2 = message.receiveTimestamp;
+ var T3 = message.transmitTimestamp;
+ var T4 = received;
+
+ message.d = (T4 - T1) - (T3 - T2);
+ message.t = ((T2 - T1) + (T3 - T4)) / 2;
+ message.receivedLocally = received;
+
+ if (!settings.resolveReference ||
+ message.stratum !== 'secondary') {
+
+ return finish(null, message);
+ }
+
+ // Resolve reference IP address
+
+ Dns.reverse(message.referenceId, function (err, domains) {
+
+ if (/* $lab:coverage:off$ */ !err /* $lab:coverage:on$ */) {
+ message.referenceHost = domains[0];
+ }
+
+ return finish(null, message);
+ });
+ });
+
+ // Set timeout
+
+ if (settings.timeout) {
+ timeoutId = setTimeout(function () {
+
+ timeoutId = 0;
+ return finish(new Error('Timeout'));
+ }, settings.timeout);
+ }
+
+ // Construct NTP message
+
+ var message = new Buffer(48);
+ for (var i = 0; i < 48; i++) { // Zero message
+ message[i] = 0;
+ }
+
+ message[0] = (0 << 6) + (4 << 3) + (3 << 0) // Set version number to 4 and Mode to 3 (client)
+ sent = Date.now();
+ internals.fromMsecs(sent, message, 40); // Set transmit timestamp (returns as originate)
+
+ // Send NTP request
+
+ socket.send(message, 0, message.length, settings.port, settings.host, function (err, bytes) {
+
+ if (err ||
+ bytes !== 48) {
+
+ return finish(err || new Error('Could not send entire message'));
+ }
+ });
+};
+
+
+internals.NtpMessage = function (buffer) {
+
+ this.isValid = false;
+
+ // Validate
+
+ if (buffer.length !== 48) {
+ return;
+ }
+
+ // Leap indicator
+
+ var li = (buffer[0] >> 6);
+ switch (li) {
+ case 0: this.leapIndicator = 'no-warning'; break;
+ case 1: this.leapIndicator = 'last-minute-61'; break;
+ case 2: this.leapIndicator = 'last-minute-59'; break;
+ case 3: this.leapIndicator = 'alarm'; break;
+ }
+
+ // Version
+
+ var vn = ((buffer[0] & 0x38) >> 3);
+ this.version = vn;
+
+ // Mode
+
+ var mode = (buffer[0] & 0x7);
+ switch (mode) {
+ case 1: this.mode = 'symmetric-active'; break;
+ case 2: this.mode = 'symmetric-passive'; break;
+ case 3: this.mode = 'client'; break;
+ case 4: this.mode = 'server'; break;
+ case 5: this.mode = 'broadcast'; break;
+ case 0:
+ case 6:
+ case 7: this.mode = 'reserved'; break;
+ }
+
+ // Stratum
+
+ var stratum = buffer[1];
+ if (stratum === 0) {
+ this.stratum = 'death';
+ }
+ else if (stratum === 1) {
+ this.stratum = 'primary';
+ }
+ else if (stratum <= 15) {
+ this.stratum = 'secondary';
+ }
+ else {
+ this.stratum = 'reserved';
+ }
+
+ // Poll interval (msec)
+
+ this.pollInterval = Math.round(Math.pow(2, buffer[2])) * 1000;
+
+ // Precision (msecs)
+
+ this.precision = Math.pow(2, buffer[3]) * 1000;
+
+ // Root delay (msecs)
+
+ var rootDelay = 256 * (256 * (256 * buffer[4] + buffer[5]) + buffer[6]) + buffer[7];
+ this.rootDelay = 1000 * (rootDelay / 0x10000);
+
+ // Root dispersion (msecs)
+
+ this.rootDispersion = ((buffer[8] << 8) + buffer[9] + ((buffer[10] << 8) + buffer[11]) / Math.pow(2, 16)) * 1000;
+
+ // Reference identifier
+
+ this.referenceId = '';
+ switch (this.stratum) {
+ case 'death':
+ case 'primary':
+ this.referenceId = String.fromCharCode(buffer[12]) + String.fromCharCode(buffer[13]) + String.fromCharCode(buffer[14]) + String.fromCharCode(buffer[15]);
+ break;
+ case 'secondary':
+ this.referenceId = '' + buffer[12] + '.' + buffer[13] + '.' + buffer[14] + '.' + buffer[15];
+ break;
+ }
+
+ // Reference timestamp
+
+ this.referenceTimestamp = internals.toMsecs(buffer, 16);
+
+ // Originate timestamp
+
+ this.originateTimestamp = internals.toMsecs(buffer, 24);
+
+ // Receive timestamp
+
+ this.receiveTimestamp = internals.toMsecs(buffer, 32);
+
+ // Transmit timestamp
+
+ this.transmitTimestamp = internals.toMsecs(buffer, 40);
+
+ // Validate
+
+ if (this.version === 4 &&
+ this.stratum !== 'reserved' &&
+ this.mode === 'server' &&
+ this.originateTimestamp &&
+ this.receiveTimestamp &&
+ this.transmitTimestamp) {
+
+ this.isValid = true;
+ }
+
+ return this;
+};
+
+
+internals.toMsecs = function (buffer, offset) {
+
+ var seconds = 0;
+ var fraction = 0;
+
+ for (var i = 0; i < 4; ++i) {
+ seconds = (seconds * 256) + buffer[offset + i];
+ }
+
+ for (i = 4; i < 8; ++i) {
+ fraction = (fraction * 256) + buffer[offset + i];
+ }
+
+ return ((seconds - 2208988800 + (fraction / Math.pow(2, 32))) * 1000);
+};
+
+
+internals.fromMsecs = function (ts, buffer, offset) {
+
+ var seconds = Math.floor(ts / 1000) + 2208988800;
+ var fraction = Math.round((ts % 1000) / 1000 * Math.pow(2, 32));
+
+ buffer[offset + 0] = (seconds & 0xFF000000) >> 24;
+ buffer[offset + 1] = (seconds & 0x00FF0000) >> 16;
+ buffer[offset + 2] = (seconds & 0x0000FF00) >> 8;
+ buffer[offset + 3] = (seconds & 0x000000FF);
+
+ buffer[offset + 4] = (fraction & 0xFF000000) >> 24;
+ buffer[offset + 5] = (fraction & 0x00FF0000) >> 16;
+ buffer[offset + 6] = (fraction & 0x0000FF00) >> 8;
+ buffer[offset + 7] = (fraction & 0x000000FF);
+};
+
+
+// Offset singleton
+
+internals.last = {
+ offset: 0,
+ expires: 0,
+ host: '',
+ port: 0
+};
+
+
+exports.offset = function (options, callback) {
+
+ if (arguments.length !== 2) {
+ callback = arguments[0];
+ options = {};
+ }
+
+ var now = Date.now();
+ var clockSyncRefresh = options.clockSyncRefresh || 24 * 60 * 60 * 1000; // Daily
+
+ if (internals.last.offset &&
+ internals.last.host === options.host &&
+ internals.last.port === options.port &&
+ now < internals.last.expires) {
+
+ process.nextTick(function () {
+
+ callback(null, internals.last.offset);
+ });
+
+ return;
+ }
+
+ exports.time(options, function (err, time) {
+
+ if (err) {
+ return callback(err, 0);
+ }
+
+ internals.last = {
+ offset: Math.round(time.t),
+ expires: now + clockSyncRefresh,
+ host: options.host,
+ port: options.port
+ };
+
+ return callback(null, internals.last.offset);
+ });
+};
+
+
+// Now singleton
+
+internals.now = {
+ intervalId: 0
+};
+
+
+exports.start = function (options, callback) {
+
+ if (arguments.length !== 2) {
+ callback = arguments[0];
+ options = {};
+ }
+
+ if (internals.now.intervalId) {
+ process.nextTick(function () {
+
+ callback();
+ });
+
+ return;
+ }
+
+ exports.offset(options, function (err, offset) {
+
+ internals.now.intervalId = setInterval(function () {
+
+ exports.offset(options, function () { });
+ }, options.clockSyncRefresh || 24 * 60 * 60 * 1000); // Daily
+
+ return callback();
+ });
+};
+
+
+exports.stop = function () {
+
+ if (!internals.now.intervalId) {
+ return;
+ }
+
+ clearInterval(internals.now.intervalId);
+ internals.now.intervalId = 0;
+};
+
+
+exports.isLive = function () {
+
+ return !!internals.now.intervalId;
+};
+
+
+exports.now = function () {
+
+ var now = Date.now();
+ if (!exports.isLive() ||
+ now >= internals.last.expires) {
+
+ return now;
+ }
+
+ return now + internals.last.offset;
+};
+
+
+internals.ignore = function () {
+
+};
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/package.json b/node_modules/request/node_modules/hawk/node_modules/sntp/package.json
new file mode 100644
index 000000000..9ae1b926e
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/sntp/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "sntp",
+ "description": "SNTP Client",
+ "version": "1.0.9",
+ "author": {
+ "name": "Eran Hammer",
+ "email": "eran@hammer.io",
+ "url": "http://hueniverse.com"
+ },
+ "contributors": [],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/hueniverse/sntp.git"
+ },
+ "main": "index",
+ "keywords": [
+ "sntp",
+ "ntp",
+ "time"
+ ],
+ "engines": {
+ "node": ">=0.8.0"
+ },
+ "dependencies": {
+ "hoek": "2.x.x"
+ },
+ "devDependencies": {
+ "lab": "4.x.x"
+ },
+ "scripts": {
+ "test": "make test-cov"
+ },
+ "licenses": [
+ {
+ "type": "BSD",
+ "url": "http://github.com/hueniverse/sntp/raw/master/LICENSE"
+ }
+ ],
+ "readme": "# sntp\n\nAn SNTP v4 client (RFC4330) for node. Simpy connects to the NTP or SNTP server requested and returns the server time\nalong with the roundtrip duration and clock offset. To adjust the local time to the NTP time, add the returned `t` offset\nto the local time.\n\n[![Build Status](https://secure.travis-ci.org/hueniverse/sntp.png)](http://travis-ci.org/hueniverse/sntp)\n\n# Usage\n\n```javascript\nvar Sntp = require('sntp');\n\n// All options are optional\n\nvar options = {\n host: 'nist1-sj.ustiming.org', // Defaults to pool.ntp.org\n port: 123, // Defaults to 123 (NTP)\n resolveReference: true, // Default to false (not resolving)\n timeout: 1000 // Defaults to zero (no timeout)\n};\n\n// Request server time\n\nSntp.time(options, function (err, time) {\n\n if (err) {\n console.log('Failed: ' + err.message);\n process.exit(1);\n }\n\n console.log('Local clock is off by: ' + time.t + ' milliseconds');\n process.exit(0);\n});\n```\n\nIf an application needs to maintain continuous time synchronization, the module provides a stateful method for\nquerying the current offset only when the last one is too old (defaults to daily).\n\n```javascript\n// Request offset once\n\nSntp.offset(function (err, offset) {\n\n console.log(offset); // New (served fresh)\n\n // Request offset again\n\n Sntp.offset(function (err, offset) {\n\n console.log(offset); // Identical (served from cache)\n });\n});\n```\n\nTo set a background offset refresh, start the interval and use the provided now() method. If for any reason the\nclient fails to obtain an up-to-date offset, the current system clock is used.\n\n```javascript\nvar before = Sntp.now(); // System time without offset\n\nSntp.start(function () {\n\n var now = Sntp.now(); // With offset\n Sntp.stop();\n});\n```\n\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/hueniverse/sntp/issues"
+ },
+ "homepage": "https://github.com/hueniverse/sntp#readme",
+ "_id": "sntp@1.0.9",
+ "_shasum": "6541184cc90aeea6c6e7b35e2659082443c66198",
+ "_resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz",
+ "_from": "sntp@>=1.0.0 <2.0.0"
+}
diff --git a/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js b/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js
new file mode 100755
index 000000000..f1d1cdabf
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js
@@ -0,0 +1,435 @@
+// Load modules
+
+var Dns = require('dns');
+var Dgram = require('dgram');
+var Lab = require('lab');
+var Sntp = require('../lib');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var before = lab.before;
+var after = lab.after;
+var describe = lab.experiment;
+var it = lab.test;
+var expect = Lab.expect;
+
+
+describe('SNTP', function () {
+
+ describe('#time', function () {
+
+ it('returns consistent result over multiple tries', function (done) {
+
+ Sntp.time(function (err, time) {
+
+ expect(err).to.not.exist;
+ expect(time).to.exist;
+ var t1 = time.t;
+
+ Sntp.time(function (err, time) {
+
+ expect(err).to.not.exist;
+ expect(time).to.exist;
+ var t2 = time.t;
+ expect(Math.abs(t1 - t2)).is.below(200);
+ done();
+ });
+ });
+ });
+
+ it('resolves reference IP', function (done) {
+
+ Sntp.time({ host: 'ntp.exnet.com', resolveReference: true }, function (err, time) {
+
+ expect(err).to.not.exist;
+ expect(time).to.exist;
+ expect(time.referenceHost).to.exist;
+ done();
+ });
+ });
+
+ it('times out on no response', function (done) {
+
+ Sntp.time({ port: 124, timeout: 100 }, function (err, time) {
+
+ expect(err).to.exist;
+ expect(time).to.not.exist;
+ expect(err.message).to.equal('Timeout');
+ done();
+ });
+ });
+
+ it('errors on error event', { parallel: false }, function (done) {
+
+ var orig = Dgram.createSocket;
+ Dgram.createSocket = function (type) {
+
+ Dgram.createSocket = orig;
+ var socket = Dgram.createSocket(type);
+ setImmediate(function () { socket.emit('error', new Error('Fake')) });
+ return socket;
+ };
+
+ Sntp.time(function (err, time) {
+
+ expect(err).to.exist;
+ expect(time).to.not.exist;
+ expect(err.message).to.equal('Fake');
+ done();
+ });
+ });
+
+ it('errors on incorrect sent size', { parallel: false }, function (done) {
+
+ var orig = Dgram.Socket.prototype.send;
+ Dgram.Socket.prototype.send = function (buf, offset, length, port, address, callback) {
+
+ Dgram.Socket.prototype.send = orig;
+ return callback(null, 40);
+ };
+
+ Sntp.time(function (err, time) {
+
+ expect(err).to.exist;
+ expect(time).to.not.exist;
+ expect(err.message).to.equal('Could not send entire message');
+ done();
+ });
+ });
+
+ it('times out on invalid host', function (done) {
+
+ Sntp.time({ host: 'error', timeout: 10000 }, function (err, time) {
+
+ expect(err).to.exist;
+ expect(time).to.not.exist;
+ expect(err.message).to.contain('getaddrinfo');
+ done();
+ });
+ });
+
+ it('fails on bad response buffer size', function (done) {
+
+ var server = Dgram.createSocket('udp4');
+ server.on('message', function (message, remote) {
+ var message = new Buffer(10);
+ server.send(message, 0, message.length, remote.port, remote.address, function (err, bytes) {
+
+ server.close();
+ });
+ });
+
+ server.bind(49123);
+
+ Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+ expect(err).to.exist;
+ expect(err.message).to.equal('Invalid server response');
+ done();
+ });
+ });
+
+ var messup = function (bytes) {
+
+ var server = Dgram.createSocket('udp4');
+ server.on('message', function (message, remote) {
+
+ var message = new Buffer([
+ 0x24, 0x01, 0x00, 0xe3,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x41, 0x43, 0x54, 0x53,
+ 0xd4, 0xa8, 0x2d, 0xc7,
+ 0x1c, 0x5d, 0x49, 0x1b,
+ 0xd4, 0xa8, 0x2d, 0xe6,
+ 0x67, 0xef, 0x9d, 0xb2,
+ 0xd4, 0xa8, 0x2d, 0xe6,
+ 0x71, 0xed, 0xb5, 0xfb,
+ 0xd4, 0xa8, 0x2d, 0xe6,
+ 0x71, 0xee, 0x6c, 0xc5
+ ]);
+
+ for (var i = 0, il = bytes.length; i < il; ++i) {
+ message[bytes[i][0]] = bytes[i][1];
+ }
+
+ server.send(message, 0, message.length, remote.port, remote.address, function (err, bytes) {
+
+ server.close();
+ });
+ });
+
+ server.bind(49123);
+ };
+
+ it('fails on bad version', function (done) {
+
+ messup([[0, (0 << 6) + (3 << 3) + (4 << 0)]]);
+
+ Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+ expect(err).to.exist;
+ expect(time.version).to.equal(3);
+ expect(err.message).to.equal('Invalid server response');
+ done();
+ });
+ });
+
+ it('fails on bad originateTimestamp', function (done) {
+
+ messup([[24, 0x83], [25, 0xaa], [26, 0x7e], [27, 0x80], [28, 0], [29, 0], [30, 0], [31, 0]]);
+
+ Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+ expect(err).to.exist;
+ expect(err.message).to.equal('Invalid server response');
+ done();
+ });
+ });
+
+ it('fails on bad receiveTimestamp', function (done) {
+
+ messup([[32, 0x83], [33, 0xaa], [34, 0x7e], [35, 0x80], [36, 0], [37, 0], [38, 0], [39, 0]]);
+
+ Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+ expect(err).to.exist;
+ expect(err.message).to.equal('Invalid server response');
+ done();
+ });
+ });
+
+ it('fails on bad originate timestamp and alarm li', function (done) {
+
+ messup([[0, (3 << 6) + (4 << 3) + (4 << 0)]]);
+
+ Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+ expect(err).to.exist;
+ expect(err.message).to.equal('Wrong originate timestamp');
+ expect(time.leapIndicator).to.equal('alarm');
+ done();
+ });
+ });
+
+ it('returns time with death stratum and last61 li', function (done) {
+
+ messup([[0, (1 << 6) + (4 << 3) + (4 << 0)], [1, 0]]);
+
+ Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+ expect(time.stratum).to.equal('death');
+ expect(time.leapIndicator).to.equal('last-minute-61');
+ done();
+ });
+ });
+
+ it('returns time with reserved stratum and last59 li', function (done) {
+
+ messup([[0, (2 << 6) + (4 << 3) + (4 << 0)], [1, 0x1f]]);
+
+ Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+ expect(time.stratum).to.equal('reserved');
+ expect(time.leapIndicator).to.equal('last-minute-59');
+ done();
+ });
+ });
+
+ it('fails on bad mode (symmetric-active)', function (done) {
+
+ messup([[0, (0 << 6) + (4 << 3) + (1 << 0)]]);
+
+ Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+ expect(err).to.exist;
+ expect(time.mode).to.equal('symmetric-active');
+ done();
+ });
+ });
+
+ it('fails on bad mode (symmetric-passive)', function (done) {
+
+ messup([[0, (0 << 6) + (4 << 3) + (2 << 0)]]);
+
+ Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+ expect(err).to.exist;
+ expect(time.mode).to.equal('symmetric-passive');
+ done();
+ });
+ });
+
+ it('fails on bad mode (client)', function (done) {
+
+ messup([[0, (0 << 6) + (4 << 3) + (3 << 0)]]);
+
+ Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+ expect(err).to.exist;
+ expect(time.mode).to.equal('client');
+ done();
+ });
+ });
+
+ it('fails on bad mode (broadcast)', function (done) {
+
+ messup([[0, (0 << 6) + (4 << 3) + (5 << 0)]]);
+
+ Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+ expect(err).to.exist;
+ expect(time.mode).to.equal('broadcast');
+ done();
+ });
+ });
+
+ it('fails on bad mode (reserved)', function (done) {
+
+ messup([[0, (0 << 6) + (4 << 3) + (6 << 0)]]);
+
+ Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+ expect(err).to.exist;
+ expect(time.mode).to.equal('reserved');
+ done();
+ });
+ });
+ });
+
+ describe('#offset', function () {
+
+ it('gets the current offset', function (done) {
+
+ Sntp.offset(function (err, offset) {
+
+ expect(err).to.not.exist;
+ expect(offset).to.not.equal(0);
+ done();
+ });
+ });
+
+ it('gets the current offset from cache', function (done) {
+
+ Sntp.offset(function (err, offset) {
+
+ expect(err).to.not.exist;
+ expect(offset).to.not.equal(0);
+ var offset1 = offset;
+ Sntp.offset({}, function (err, offset) {
+
+ expect(err).to.not.exist;
+ expect(offset).to.equal(offset1);
+ done();
+ });
+ });
+ });
+
+ it('gets the new offset on different server', function (done) {
+
+ Sntp.offset(function (err, offset) {
+
+ expect(err).to.not.exist;
+ expect(offset).to.not.equal(0);
+ var offset1 = offset;
+ Sntp.offset({ host: 'nist1-sj.ustiming.org' }, function (err, offset) {
+
+ expect(err).to.not.exist;
+ expect(offset).to.not.equal(offset1);
+ done();
+ });
+ });
+ });
+
+ it('gets the new offset on different server', function (done) {
+
+ Sntp.offset(function (err, offset) {
+
+ expect(err).to.not.exist;
+ expect(offset).to.not.equal(0);
+ var offset1 = offset;
+ Sntp.offset({ port: 123 }, function (err, offset) {
+
+ expect(err).to.not.exist;
+ expect(offset).to.not.equal(offset1);
+ done();
+ });
+ });
+ });
+
+ it('fails getting the current offset on invalid server', function (done) {
+
+ Sntp.offset({ host: 'error' }, function (err, offset) {
+
+ expect(err).to.exist;
+ expect(offset).to.equal(0);
+ done();
+ });
+ });
+ });
+
+ describe('#now', function () {
+
+ it('starts auto-sync, gets now, then stops', function (done) {
+
+ Sntp.stop();
+
+ var before = Sntp.now();
+ expect(before).to.equal(Date.now());
+
+ Sntp.start(function () {
+
+ var now = Sntp.now();
+ expect(now).to.not.equal(Date.now());
+ Sntp.stop();
+
+ done();
+ });
+ });
+
+ it('starts twice', function (done) {
+
+ Sntp.start(function () {
+
+ Sntp.start(function () {
+
+ var now = Sntp.now();
+ expect(now).to.not.equal(Date.now());
+ Sntp.stop();
+
+ done();
+ });
+ });
+ });
+
+ it('starts auto-sync, gets now, waits, gets again after timeout', function (done) {
+
+ Sntp.stop();
+
+ var before = Sntp.now();
+ expect(before).to.equal(Date.now());
+
+ Sntp.start({ clockSyncRefresh: 100 }, function () {
+
+ var now = Sntp.now();
+ expect(now).to.not.equal(Date.now());
+ expect(now).to.equal(Sntp.now());
+
+ setTimeout(function () {
+
+ expect(Sntp.now()).to.not.equal(now);
+ Sntp.stop();
+ done();
+ }, 110);
+ });
+ });
+ });
+});
+
diff --git a/node_modules/request/node_modules/hawk/package.json b/node_modules/request/node_modules/hawk/package.json
new file mode 100644
index 000000000..5a835b2e4
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/package.json
@@ -0,0 +1,68 @@
+{
+ "name": "hawk",
+ "description": "HTTP Hawk Authentication Scheme",
+ "version": "3.1.0",
+ "author": {
+ "name": "Eran Hammer",
+ "email": "eran@hammer.io",
+ "url": "http://hueniverse.com"
+ },
+ "contributors": [],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/hueniverse/hawk.git"
+ },
+ "main": "lib/index.js",
+ "keywords": [
+ "http",
+ "authentication",
+ "scheme",
+ "hawk"
+ ],
+ "engines": {
+ "node": ">=0.10.32"
+ },
+ "browser": "./lib/browser.js",
+ "dependencies": {
+ "hoek": "2.x.x",
+ "boom": "^2.8.x",
+ "cryptiles": "2.x.x",
+ "sntp": "1.x.x"
+ },
+ "devDependencies": {
+ "code": "1.x.x",
+ "lab": "5.x.x"
+ },
+ "scripts": {
+ "test": "lab -a code -t 100 -L",
+ "test-cov-html": "lab -a code -r html -o coverage.html"
+ },
+ "license": "BSD-3-Clause",
+ "gitHead": "fdb9d05e383d5237631eaddc4f51422e54fa8b52",
+ "bugs": {
+ "url": "https://github.com/hueniverse/hawk/issues"
+ },
+ "homepage": "https://github.com/hueniverse/hawk#readme",
+ "_id": "hawk@3.1.0",
+ "_shasum": "8a13ae19977ec607602f3f0b9fd676f18c384e44",
+ "_from": "hawk@>=3.1.0 <3.2.0",
+ "_npmVersion": "2.10.0",
+ "_nodeVersion": "0.10.38",
+ "_npmUser": {
+ "name": "hueniverse",
+ "email": "eran@hammer.io"
+ },
+ "dist": {
+ "shasum": "8a13ae19977ec607602f3f0b9fd676f18c384e44",
+ "tarball": "http://registry.npmjs.org/hawk/-/hawk-3.1.0.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/hawk/test/browser.js b/node_modules/request/node_modules/hawk/test/browser.js
new file mode 100755
index 000000000..49dc4cadd
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/test/browser.js
@@ -0,0 +1,1459 @@
+// Load modules
+
+var Url = require('url');
+var Code = require('code');
+var Hawk = require('../lib');
+var Hoek = require('hoek');
+var Lab = require('lab');
+var Browser = require('../lib/browser');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.experiment;
+var it = lab.test;
+var expect = Code.expect;
+
+
+describe('Browser', function () {
+
+ var credentialsFunc = function (id, callback) {
+
+ var credentials = {
+ id: id,
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: (id === '1' ? 'sha1' : 'sha256'),
+ user: 'steve'
+ };
+
+ return callback(null, credentials);
+ };
+
+ it('should generate a bewit then successfully authenticate it', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?a=1&b=2',
+ host: 'example.com',
+ port: 80
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var bewit = Browser.client.bewit('http://example.com/resource/4?a=1&b=2', { credentials: credentials, ttlSec: 60 * 60 * 24 * 365 * 100, ext: 'some-app-data' });
+ req.url += '&bewit=' + bewit;
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(attributes.ext).to.equal('some-app-data');
+ done();
+ });
+ });
+ });
+
+ it('should generate a bewit then successfully authenticate it (no ext)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?a=1&b=2',
+ host: 'example.com',
+ port: 80
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var bewit = Browser.client.bewit('http://example.com/resource/4?a=1&b=2', { credentials: credentials, ttlSec: 60 * 60 * 24 * 365 * 100 });
+ req.url += '&bewit=' + bewit;
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ done();
+ });
+ });
+ });
+
+ describe('bewit()', function () {
+
+ it('returns a valid bewit value', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
+ expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdca3NjeHdOUjJ0SnBQMVQxekRMTlBiQjVVaUtJVTl0T1NKWFRVZEc3WDloOD1ceGFuZHlhbmR6');
+ done();
+ });
+
+ it('returns a valid bewit value (explicit HTTP port)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Browser.client.bewit('http://example.com:8080/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
+ expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdcaFpiSjNQMmNLRW80a3kwQzhqa1pBa1J5Q1p1ZWc0V1NOYnhWN3ZxM3hIVT1ceGFuZHlhbmR6');
+ done();
+ });
+
+ it('returns a valid bewit value (explicit HTTPS port)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Browser.client.bewit('https://example.com:8043/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
+ expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdcL2t4UjhwK0xSaTdvQTRnUXc3cWlxa3BiVHRKYkR4OEtRMC9HRUwvVytTUT1ceGFuZHlhbmR6');
+ done();
+ });
+
+ it('returns a valid bewit value (null ext)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: null });
+ expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdcSUdZbUxnSXFMckNlOEN4dktQczRKbFdJQStValdKSm91d2dBUmlWaENBZz1c');
+ done();
+ });
+
+ it('errors on invalid options', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow', 4);
+ expect(bewit).to.equal('');
+ done();
+ });
+
+ it('errors on missing uri', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Browser.client.bewit('', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
+ expect(bewit).to.equal('');
+ done();
+ });
+
+ it('errors on invalid uri', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Browser.client.bewit(5, { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
+ expect(bewit).to.equal('');
+ done();
+ });
+
+ it('errors on invalid credentials (id)', function (done) {
+
+ var credentials = {
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 3000, ext: 'xandyandz' });
+ expect(bewit).to.equal('');
+ done();
+ });
+
+ it('errors on missing credentials', function (done) {
+
+ var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow', { ttlSec: 3000, ext: 'xandyandz' });
+ expect(bewit).to.equal('');
+ done();
+ });
+
+ it('errors on invalid credentials (key)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 3000, ext: 'xandyandz' });
+ expect(bewit).to.equal('');
+ done();
+ });
+
+ it('errors on invalid algorithm', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'hmac-sha-0'
+ };
+
+ var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, ext: 'xandyandz' });
+ expect(bewit).to.equal('');
+ done();
+ });
+
+ it('errors on missing options', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'hmac-sha-0'
+ };
+
+ var bewit = Browser.client.bewit('https://example.com/somewhere/over/the/rainbow');
+ expect(bewit).to.equal('');
+ done();
+ });
+ });
+
+ it('generates a header then successfully parse it (configuration)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' }).field;
+ expect(req.authorization).to.exist();
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it (node request)', function (done) {
+
+ var req = {
+ method: 'POST',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: 'example.com:8080',
+ 'content-type': 'text/plain;x=y'
+ }
+ };
+
+ var payload = 'some not so random text';
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var reqHeader = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+ req.headers.authorization = reqHeader.field;
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+ var res = {
+ headers: {
+ 'content-type': 'text/plain'
+ },
+ getResponseHeader: function (header) {
+
+ return res.headers[header.toLowerCase()];
+ }
+ };
+
+ res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
+ expect(res.headers['server-authorization']).to.exist();
+
+ expect(Browser.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(true);
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it (browserify)', function (done) {
+
+ var req = {
+ method: 'POST',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: 'example.com:8080',
+ 'content-type': 'text/plain;x=y'
+ }
+ };
+
+ var payload = 'some not so random text';
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var reqHeader = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+ req.headers.authorization = reqHeader.field;
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+ var res = {
+ headers: {
+ 'content-type': 'text/plain'
+ },
+ getHeader: function (header) {
+
+ return res.headers[header.toLowerCase()];
+ }
+ };
+
+ res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
+ expect(res.headers['server-authorization']).to.exist();
+
+ expect(Browser.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(true);
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it (time offset)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', localtimeOffsetMsec: 100000 }).field;
+ expect(req.authorization).to.exist();
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 100000 }, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it (no server header options)', function (done) {
+
+ var req = {
+ method: 'POST',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: 'example.com:8080',
+ 'content-type': 'text/plain;x=y'
+ }
+ };
+
+ var payload = 'some not so random text';
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var reqHeader = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+ req.headers.authorization = reqHeader.field;
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+ var res = {
+ headers: {
+ 'content-type': 'text/plain'
+ },
+ getResponseHeader: function (header) {
+
+ return res.headers[header.toLowerCase()];
+ }
+ };
+
+ res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts);
+ expect(res.headers['server-authorization']).to.exist();
+
+ expect(Browser.client.authenticate(res, credentials, artifacts)).to.equal(true);
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it (no server header)', function (done) {
+
+ var req = {
+ method: 'POST',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: 'example.com:8080',
+ 'content-type': 'text/plain;x=y'
+ }
+ };
+
+ var payload = 'some not so random text';
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var reqHeader = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+ req.headers.authorization = reqHeader.field;
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+ var res = {
+ headers: {
+ 'content-type': 'text/plain'
+ },
+ getResponseHeader: function (header) {
+
+ return res.headers[header.toLowerCase()];
+ }
+ };
+
+ expect(Browser.client.authenticate(res, credentials, artifacts)).to.equal(true);
+ done();
+ });
+ });
+ });
+
+ it('generates a header with stale ts and successfully authenticate on second call', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ Browser.utils.setNtpOffset(60 * 60 * 1000);
+ var header = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' });
+ req.authorization = header.field;
+ expect(req.authorization).to.exist();
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Stale timestamp');
+
+ var res = {
+ headers: {
+ 'www-authenticate': err.output.headers['WWW-Authenticate']
+ },
+ getResponseHeader: function (header) {
+
+ return res.headers[header.toLowerCase()];
+ }
+ };
+
+ expect(Browser.utils.getNtpOffset()).to.equal(60 * 60 * 1000);
+ expect(Browser.client.authenticate(res, credentials, header.artifacts)).to.equal(true);
+ expect(Browser.utils.getNtpOffset()).to.equal(0);
+
+ req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' }).field;
+ expect(req.authorization).to.exist();
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ done();
+ });
+ });
+ });
+ });
+
+ it('generates a header with stale ts and successfully authenticate on second call (manual localStorage)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var localStorage = new Browser.internals.LocalStorage();
+
+ Browser.utils.setStorage(localStorage);
+
+ Browser.utils.setNtpOffset(60 * 60 * 1000);
+ var header = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' });
+ req.authorization = header.field;
+ expect(req.authorization).to.exist();
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Stale timestamp');
+
+ var res = {
+ headers: {
+ 'www-authenticate': err.output.headers['WWW-Authenticate']
+ },
+ getResponseHeader: function (header) {
+
+ return res.headers[header.toLowerCase()];
+ }
+ };
+
+ expect(parseInt(localStorage.getItem('hawk_ntp_offset'))).to.equal(60 * 60 * 1000);
+ expect(Browser.utils.getNtpOffset()).to.equal(60 * 60 * 1000);
+ expect(Browser.client.authenticate(res, credentials, header.artifacts)).to.equal(true);
+ expect(Browser.utils.getNtpOffset()).to.equal(0);
+ expect(parseInt(localStorage.getItem('hawk_ntp_offset'))).to.equal(0);
+
+ req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' }).field;
+ expect(req.authorization).to.exist();
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ done();
+ });
+ });
+ });
+ });
+
+ it('generates a header then fails to parse it (missing server header hash)', function (done) {
+
+ var req = {
+ method: 'POST',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: 'example.com:8080',
+ 'content-type': 'text/plain;x=y'
+ }
+ };
+
+ var payload = 'some not so random text';
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var reqHeader = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+ req.headers.authorization = reqHeader.field;
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+ var res = {
+ headers: {
+ 'content-type': 'text/plain'
+ },
+ getResponseHeader: function (header) {
+
+ return res.headers[header.toLowerCase()];
+ }
+ };
+
+ res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts);
+ expect(res.headers['server-authorization']).to.exist();
+
+ expect(Browser.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(false);
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it (with hash)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it then validate payload', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ expect(Hawk.server.authenticatePayload('hola!', credentials, artifacts)).to.be.true();
+ expect(Hawk.server.authenticatePayload('hello!', credentials, artifacts)).to.be.false();
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it (app)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', app: 'asd23ased' }).field;
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ expect(artifacts.app).to.equal('asd23ased');
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it (app, dlg)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', app: 'asd23ased', dlg: '23434szr3q4d' }).field;
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ expect(artifacts.app).to.equal('asd23ased');
+ expect(artifacts.dlg).to.equal('23434szr3q4d');
+ done();
+ });
+ });
+ });
+
+ it('generates a header then fail authentication due to bad hash', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
+ Hawk.server.authenticate(req, credentialsFunc, { payload: 'byebye!' }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Bad payload hash');
+ done();
+ });
+ });
+ });
+
+ it('generates a header for one resource then fail to authenticate another', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' }).field;
+ req.url = '/something/else';
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(credentials).to.exist();
+ done();
+ });
+ });
+ });
+
+ describe('client', function () {
+
+ describe('header()', function () {
+
+ it('returns a valid authorization header (sha1)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha1'
+ };
+
+ var header = Browser.client.header('http://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about' }).field;
+ expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="bsvY3IfUllw6V5rvk4tStEvpBhE=", ext="Bazinga!", mac="qbf1ZPG/r/e06F4ht+T77LXi5vw="');
+ done();
+ });
+
+ it('returns a valid authorization header (sha256)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
+ expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", ext="Bazinga!", mac="q1CwFoSHzPZSkbIvl0oYlD+91rBUEvFk763nMjMndj8="');
+ done();
+ });
+
+ it('returns a valid authorization header (empty payload)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha1'
+ };
+
+ var header = Browser.client.header('http://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: '' }).field;
+ expect(header).to.equal('Hawk id=\"123456\", ts=\"1353809207\", nonce=\"Ygvqdz\", hash=\"404ghL7K+hfyhByKKejFBRGgTjU=\", ext=\"Bazinga!\", mac=\"Bh1sj1DOfFRWOdi3ww52nLCJdBE=\"');
+ done();
+ });
+
+ it('returns a valid authorization header (no ext)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
+ expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
+ done();
+ });
+
+ it('returns a valid authorization header (null ext)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain', ext: null }).field;
+ expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
+ done();
+ });
+
+ it('returns a valid authorization header (uri object)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var uri = Browser.utils.parseUri('https://example.net/somewhere/over/the/rainbow');
+ var header = Browser.client.header(uri, 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
+ expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
+ done();
+ });
+
+ it('errors on missing options', function (done) {
+
+ var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST');
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid argument type');
+ done();
+ });
+
+ it('errors on empty uri', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var header = Browser.client.header('', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' });
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid argument type');
+ done();
+ });
+
+ it('errors on invalid uri', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var header = Browser.client.header(4, 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' });
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid argument type');
+ done();
+ });
+
+ it('errors on missing method', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', '', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' });
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid argument type');
+ done();
+ });
+
+ it('errors on invalid method', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 5, { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' });
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid argument type');
+ done();
+ });
+
+ it('errors on missing credentials', function (done) {
+
+ var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { ext: 'Bazinga!', timestamp: 1353809207 });
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid credentials object');
+ done();
+ });
+
+ it('errors on invalid credentials (id)', function (done) {
+
+ var credentials = {
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207 });
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid credentials object');
+ done();
+ });
+
+ it('errors on invalid credentials (key)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ algorithm: 'sha256'
+ };
+
+ var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207 });
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid credentials object');
+ done();
+ });
+
+ it('errors on invalid algorithm', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'hmac-sha-0'
+ };
+
+ var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, payload: 'something, anything!', ext: 'Bazinga!', timestamp: 1353809207 });
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Unknown algorithm');
+ done();
+ });
+
+ it('uses a pre-calculated payload hash', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var options = { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' };
+ options.hash = Browser.crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
+ var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', options).field;
+ expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", ext="Bazinga!", mac="q1CwFoSHzPZSkbIvl0oYlD+91rBUEvFk763nMjMndj8="');
+ done();
+ });
+ });
+
+ describe('authenticate()', function () {
+
+ it('skips tsm validation when missing ts', function (done) {
+
+ var res = {
+ headers: {
+ 'www-authenticate': 'Hawk error="Stale timestamp"'
+ },
+ getResponseHeader: function (header) {
+
+ return res.headers[header.toLowerCase()];
+ }
+ };
+
+ var credentials = {
+ id: '123456',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ var artifacts = {
+ ts: 1402135580,
+ nonce: 'iBRB6t',
+ method: 'GET',
+ resource: '/resource/4?filter=a',
+ host: 'example.com',
+ port: '8080',
+ ext: 'some-app-data'
+ };
+
+ expect(Browser.client.authenticate(res, credentials, artifacts)).to.equal(true);
+ done();
+ });
+
+ it('returns false on invalid header', function (done) {
+
+ var res = {
+ headers: {
+ 'server-authorization': 'Hawk mac="abc", bad="xyz"'
+ },
+ getResponseHeader: function (header) {
+
+ return res.headers[header.toLowerCase()];
+ }
+ };
+
+ expect(Browser.client.authenticate(res, {})).to.equal(false);
+ done();
+ });
+
+ it('returns false on invalid mac', function (done) {
+
+ var res = {
+ headers: {
+ 'content-type': 'text/plain',
+ 'server-authorization': 'Hawk mac="_IJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
+ },
+ getResponseHeader: function (header) {
+
+ return res.headers[header.toLowerCase()];
+ }
+ };
+
+ var artifacts = {
+ method: 'POST',
+ host: 'example.com',
+ port: '8080',
+ resource: '/resource/4?filter=a',
+ ts: '1362336900',
+ nonce: 'eb5S_L',
+ hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
+ ext: 'some-app-data',
+ app: undefined,
+ dlg: undefined,
+ mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
+ id: '123456'
+ };
+
+ var credentials = {
+ id: '123456',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ expect(Browser.client.authenticate(res, credentials, artifacts)).to.equal(false);
+ done();
+ });
+
+ it('returns true on ignoring hash', function (done) {
+
+ var res = {
+ headers: {
+ 'content-type': 'text/plain',
+ 'server-authorization': 'Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
+ },
+ getResponseHeader: function (header) {
+
+ return res.headers[header.toLowerCase()];
+ }
+ };
+
+ var artifacts = {
+ method: 'POST',
+ host: 'example.com',
+ port: '8080',
+ resource: '/resource/4?filter=a',
+ ts: '1362336900',
+ nonce: 'eb5S_L',
+ hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
+ ext: 'some-app-data',
+ app: undefined,
+ dlg: undefined,
+ mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
+ id: '123456'
+ };
+
+ var credentials = {
+ id: '123456',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ expect(Browser.client.authenticate(res, credentials, artifacts)).to.equal(true);
+ done();
+ });
+
+ it('errors on invalid WWW-Authenticate header format', function (done) {
+
+ var res = {
+ headers: {
+ 'www-authenticate': 'Hawk ts="1362346425875", tsm="PhwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", x="Stale timestamp"'
+ },
+ getResponseHeader: function (header) {
+
+ return res.headers[header.toLowerCase()];
+ }
+ };
+
+ expect(Browser.client.authenticate(res, {})).to.equal(false);
+ done();
+ });
+
+ it('errors on invalid WWW-Authenticate header format', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ var res = {
+ headers: {
+ 'www-authenticate': 'Hawk ts="1362346425875", tsm="hwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", error="Stale timestamp"'
+ },
+ getResponseHeader: function (header) {
+
+ return res.headers[header.toLowerCase()];
+ }
+ };
+
+ expect(Browser.client.authenticate(res, credentials)).to.equal(false);
+ done();
+ });
+ });
+
+ describe('message()', function () {
+
+ it('generates an authorization then successfully parse it', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Browser.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ done();
+ });
+ });
+ });
+
+ it('generates an authorization using custom nonce/timestamp', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Browser.client.message('example.com', 8080, 'some message', { credentials: credentials, nonce: 'abc123', timestamp: 1398536270957 });
+ expect(auth).to.exist();
+ expect(auth.nonce).to.equal('abc123');
+ expect(auth.ts).to.equal(1398536270957);
+ done();
+ });
+ });
+
+ it('errors on missing host', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Browser.client.message(null, 8080, 'some message', { credentials: credentials });
+ expect(auth).to.not.exist();
+ done();
+ });
+ });
+
+ it('errors on invalid host', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Browser.client.message(5, 8080, 'some message', { credentials: credentials });
+ expect(auth).to.not.exist();
+ done();
+ });
+ });
+
+ it('errors on missing port', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Browser.client.message('example.com', 0, 'some message', { credentials: credentials });
+ expect(auth).to.not.exist();
+ done();
+ });
+ });
+
+ it('errors on invalid port', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Browser.client.message('example.com', 'a', 'some message', { credentials: credentials });
+ expect(auth).to.not.exist();
+ done();
+ });
+ });
+
+ it('errors on missing message', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Browser.client.message('example.com', 8080, undefined, { credentials: credentials });
+ expect(auth).to.not.exist();
+ done();
+ });
+ });
+
+ it('errors on null message', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Browser.client.message('example.com', 8080, null, { credentials: credentials });
+ expect(auth).to.not.exist();
+ done();
+ });
+ });
+
+ it('errors on invalid message', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Browser.client.message('example.com', 8080, 5, { credentials: credentials });
+ expect(auth).to.not.exist();
+ done();
+ });
+ });
+
+ it('errors on missing credentials', function (done) {
+
+ var auth = Browser.client.message('example.com', 8080, 'some message', {});
+ expect(auth).to.not.exist();
+ done();
+ });
+
+ it('errors on missing options', function (done) {
+
+ var auth = Browser.client.message('example.com', 8080, 'some message');
+ expect(auth).to.not.exist();
+ done();
+ });
+
+ it('errors on invalid credentials (id)', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var creds = Hoek.clone(credentials);
+ delete creds.id;
+ var auth = Browser.client.message('example.com', 8080, 'some message', { credentials: creds });
+ expect(auth).to.not.exist();
+ done();
+ });
+ });
+
+ it('errors on invalid credentials (key)', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var creds = Hoek.clone(credentials);
+ delete creds.key;
+ var auth = Browser.client.message('example.com', 8080, 'some message', { credentials: creds });
+ expect(auth).to.not.exist();
+ done();
+ });
+ });
+
+ it('errors on invalid algorithm', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var creds = Hoek.clone(credentials);
+ creds.algorithm = 'blah';
+ var auth = Browser.client.message('example.com', 8080, 'some message', { credentials: creds });
+ expect(auth).to.not.exist();
+ done();
+ });
+ });
+ });
+
+ describe('authenticateTimestamp()', function (done) {
+
+ it('validates a timestamp', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var tsm = Hawk.crypto.timestampMessage(credentials);
+ expect(Browser.client.authenticateTimestamp(tsm, credentials)).to.equal(true);
+ done();
+ });
+ });
+
+ it('validates a timestamp without updating local time', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var offset = Browser.utils.getNtpOffset();
+ var tsm = Hawk.crypto.timestampMessage(credentials, 10000);
+ expect(Browser.client.authenticateTimestamp(tsm, credentials, false)).to.equal(true);
+ expect(offset).to.equal(Browser.utils.getNtpOffset());
+ done();
+ });
+ });
+
+ it('detects a bad timestamp', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var tsm = Hawk.crypto.timestampMessage(credentials);
+ tsm.ts = 4;
+ expect(Browser.client.authenticateTimestamp(tsm, credentials)).to.equal(false);
+ done();
+ });
+ });
+ });
+ });
+
+ describe('internals', function () {
+
+ describe('LocalStorage', function () {
+
+ it('goes through the full lifecycle', function (done) {
+
+ var storage = new Browser.internals.LocalStorage();
+ expect(storage.length).to.equal(0);
+ expect(storage.getItem('a')).to.equal(null);
+ storage.setItem('a', 5);
+ expect(storage.length).to.equal(1);
+ expect(storage.key()).to.equal('a');
+ expect(storage.key(0)).to.equal('a');
+ expect(storage.getItem('a')).to.equal('5');
+ storage.setItem('b', 'test');
+ expect(storage.key()).to.equal('a');
+ expect(storage.key(0)).to.equal('a');
+ expect(storage.key(1)).to.equal('b');
+ expect(storage.length).to.equal(2);
+ expect(storage.getItem('b')).to.equal('test');
+ storage.removeItem('a');
+ expect(storage.length).to.equal(1);
+ expect(storage.getItem('a')).to.equal(null);
+ expect(storage.getItem('b')).to.equal('test');
+ storage.clear();
+ expect(storage.length).to.equal(0);
+ expect(storage.getItem('a')).to.equal(null);
+ expect(storage.getItem('b')).to.equal(null);
+ done();
+ });
+ });
+ });
+
+ describe('utils', function () {
+
+ describe('setStorage()', function () {
+
+ it('sets storage for the first time', function (done) {
+
+ Browser.utils.storage = new Browser.internals.LocalStorage(); // Reset state
+
+ expect(Browser.utils.storage.getItem('hawk_ntp_offset')).to.not.exist();
+ Browser.utils.storage.setItem('test', '1');
+ Browser.utils.setStorage(new Browser.internals.LocalStorage());
+ expect(Browser.utils.storage.getItem('test')).to.not.exist();
+ Browser.utils.storage.setItem('test', '2');
+ expect(Browser.utils.storage.getItem('test')).to.equal('2');
+ done();
+ });
+ });
+
+ describe('setNtpOffset()', function (done) {
+
+ it('catches localStorage errors', { parallel: false }, function (done) {
+
+ var orig = Browser.utils.storage.setItem;
+ var consoleOrig = console.error;
+ var count = 0;
+ console.error = function () {
+
+ if (count++ === 2) {
+
+ console.error = consoleOrig;
+ }
+ };
+
+ Browser.utils.storage.setItem = function () {
+
+ Browser.utils.storage.setItem = orig;
+ throw new Error();
+ };
+
+ expect(function () {
+
+ Browser.utils.setNtpOffset(100);
+ }).not.to.throw();
+
+ done();
+ });
+ });
+
+ describe('parseAuthorizationHeader()', function (done) {
+
+ it('returns null on missing header', function (done) {
+
+ expect(Browser.utils.parseAuthorizationHeader()).to.equal(null);
+ done();
+ });
+
+ it('returns null on bad header syntax (structure)', function (done) {
+
+ expect(Browser.utils.parseAuthorizationHeader('Hawk')).to.equal(null);
+ done();
+ });
+
+ it('returns null on bad header syntax (parts)', function (done) {
+
+ expect(Browser.utils.parseAuthorizationHeader(' ')).to.equal(null);
+ done();
+ });
+
+ it('returns null on bad scheme name', function (done) {
+
+ expect(Browser.utils.parseAuthorizationHeader('Basic asdasd')).to.equal(null);
+ done();
+ });
+
+ it('returns null on bad attribute value', function (done) {
+
+ expect(Browser.utils.parseAuthorizationHeader('Hawk test="\t"', ['test'])).to.equal(null);
+ done();
+ });
+
+ it('returns null on duplicated attribute', function (done) {
+
+ expect(Browser.utils.parseAuthorizationHeader('Hawk test="a", test="b"', ['test'])).to.equal(null);
+ done();
+ });
+ });
+
+ describe('parseUri()', function () {
+
+ it('returns empty port when unknown scheme', function (done) {
+
+ var uri = Browser.utils.parseUri('ftp://domain');
+ expect(uri.port).to.equal('');
+ done();
+ });
+
+ it('returns default port when missing', function (done) {
+
+ var uri = Browser.utils.parseUri('http://');
+ expect(uri.port).to.equal('80');
+ done();
+ });
+ });
+
+ var str = 'https://www.google.ca/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=url';
+ var base64str = 'aHR0cHM6Ly93d3cuZ29vZ2xlLmNhL3dlYmhwP3NvdXJjZWlkPWNocm9tZS1pbnN0YW50Jmlvbj0xJmVzcHY9MiZpZT1VVEYtOCNxPXVybA';
+
+ describe('base64urlEncode()', function () {
+
+ it('should base64 URL-safe decode a string', function (done) {
+
+ expect(Browser.utils.base64urlEncode(str)).to.equal(base64str);
+ done();
+ });
+ });
+ });
+});
diff --git a/node_modules/request/node_modules/hawk/test/client.js b/node_modules/request/node_modules/hawk/test/client.js
new file mode 100755
index 000000000..d6be231ae
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/test/client.js
@@ -0,0 +1,440 @@
+// Load modules
+
+var Url = require('url');
+var Code = require('code');
+var Hawk = require('../lib');
+var Lab = require('lab');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.experiment;
+var it = lab.test;
+var expect = Code.expect;
+
+
+describe('Client', function () {
+
+ describe('header()', function () {
+
+ it('returns a valid authorization header (sha1)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha1'
+ };
+
+ var header = Hawk.client.header('http://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about' }).field;
+ expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="bsvY3IfUllw6V5rvk4tStEvpBhE=", ext="Bazinga!", mac="qbf1ZPG/r/e06F4ht+T77LXi5vw="');
+ done();
+ });
+
+ it('returns a valid authorization header (sha256)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
+ expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", ext="Bazinga!", mac="q1CwFoSHzPZSkbIvl0oYlD+91rBUEvFk763nMjMndj8="');
+ done();
+ });
+
+ it('returns a valid authorization header (no ext)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
+ expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
+ done();
+ });
+
+ it('returns a valid authorization header (null ext)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain', ext: null }).field;
+ expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
+ done();
+ });
+
+ it('returns a valid authorization header (empty payload)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: '', contentType: 'text/plain' }).field;
+ expect(header).to.equal('Hawk id=\"123456\", ts=\"1353809207\", nonce=\"Ygvqdz\", hash=\"q/t+NNAkQZNlq/aAD6PlexImwQTxwgT2MahfTa9XRLA=\", mac=\"U5k16YEzn3UnBHKeBzsDXn067Gu3R4YaY6xOt9PYRZM=\"');
+ done();
+ });
+
+ it('returns a valid authorization header (pre hashed payload)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var options = { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' };
+ options.hash = Hawk.crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
+ var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', options).field;
+ expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
+ done();
+ });
+
+ it('errors on missing uri', function (done) {
+
+ var header = Hawk.client.header('', 'POST');
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid argument type');
+ done();
+ });
+
+ it('errors on invalid uri', function (done) {
+
+ var header = Hawk.client.header(4, 'POST');
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid argument type');
+ done();
+ });
+
+ it('errors on missing method', function (done) {
+
+ var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', '');
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid argument type');
+ done();
+ });
+
+ it('errors on invalid method', function (done) {
+
+ var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 5);
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid argument type');
+ done();
+ });
+
+ it('errors on missing options', function (done) {
+
+ var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST');
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid argument type');
+ done();
+ });
+
+ it('errors on invalid credentials (id)', function (done) {
+
+ var credentials = {
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207 });
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid credential object');
+ done();
+ });
+
+ it('errors on missing credentials', function (done) {
+
+ var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { ext: 'Bazinga!', timestamp: 1353809207 });
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid credential object');
+ done();
+ });
+
+ it('errors on invalid credentials', function (done) {
+
+ var credentials = {
+ id: '123456',
+ algorithm: 'sha256'
+ };
+
+ var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207 });
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Invalid credential object');
+ done();
+ });
+
+ it('errors on invalid algorithm', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'hmac-sha-0'
+ };
+
+ var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, payload: 'something, anything!', ext: 'Bazinga!', timestamp: 1353809207 });
+ expect(header.field).to.equal('');
+ expect(header.err).to.equal('Unknown algorithm');
+ done();
+ });
+ });
+
+ describe('authenticate()', function () {
+
+ it('returns false on invalid header', function (done) {
+
+ var res = {
+ headers: {
+ 'server-authorization': 'Hawk mac="abc", bad="xyz"'
+ }
+ };
+
+ expect(Hawk.client.authenticate(res, {})).to.equal(false);
+ done();
+ });
+
+ it('returns false on invalid mac', function (done) {
+
+ var res = {
+ headers: {
+ 'content-type': 'text/plain',
+ 'server-authorization': 'Hawk mac="_IJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
+ }
+ };
+
+ var artifacts = {
+ method: 'POST',
+ host: 'example.com',
+ port: '8080',
+ resource: '/resource/4?filter=a',
+ ts: '1362336900',
+ nonce: 'eb5S_L',
+ hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
+ ext: 'some-app-data',
+ app: undefined,
+ dlg: undefined,
+ mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
+ id: '123456'
+ };
+
+ var credentials = {
+ id: '123456',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(false);
+ done();
+ });
+
+ it('returns true on ignoring hash', function (done) {
+
+ var res = {
+ headers: {
+ 'content-type': 'text/plain',
+ 'server-authorization': 'Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
+ }
+ };
+
+ var artifacts = {
+ method: 'POST',
+ host: 'example.com',
+ port: '8080',
+ resource: '/resource/4?filter=a',
+ ts: '1362336900',
+ nonce: 'eb5S_L',
+ hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
+ ext: 'some-app-data',
+ app: undefined,
+ dlg: undefined,
+ mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
+ id: '123456'
+ };
+
+ var credentials = {
+ id: '123456',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(true);
+ done();
+ });
+
+ it('fails on invalid WWW-Authenticate header format', function (done) {
+
+ var header = 'Hawk ts="1362346425875", tsm="PhwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", x="Stale timestamp"';
+ expect(Hawk.client.authenticate({ headers: { 'www-authenticate': header } }, {})).to.equal(false);
+ done();
+ });
+
+ it('fails on invalid WWW-Authenticate header format', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ var header = 'Hawk ts="1362346425875", tsm="hwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", error="Stale timestamp"';
+ expect(Hawk.client.authenticate({ headers: { 'www-authenticate': header } }, credentials)).to.equal(false);
+ done();
+ });
+
+ it('skips tsm validation when missing ts', function (done) {
+
+ var header = 'Hawk error="Stale timestamp"';
+ expect(Hawk.client.authenticate({ headers: { 'www-authenticate': header } }, {})).to.equal(true);
+ done();
+ });
+ });
+
+ describe('message()', function () {
+
+ it('generates authorization', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha1'
+ };
+
+ var auth = Hawk.client.message('example.com', 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
+ expect(auth).to.exist();
+ expect(auth.ts).to.equal(1353809207);
+ expect(auth.nonce).to.equal('abc123');
+ done();
+ });
+
+ it('errors on invalid host', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha1'
+ };
+
+ var auth = Hawk.client.message(5, 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
+ expect(auth).to.not.exist();
+ done();
+ });
+
+ it('errors on invalid port', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha1'
+ };
+
+ var auth = Hawk.client.message('example.com', '80', 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
+ expect(auth).to.not.exist();
+ done();
+ });
+
+ it('errors on missing host', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha1'
+ };
+
+ var auth = Hawk.client.message('example.com', 0, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
+ expect(auth).to.not.exist();
+ done();
+ });
+
+ it('errors on null message', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha1'
+ };
+
+ var auth = Hawk.client.message('example.com', 80, null, { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
+ expect(auth).to.not.exist();
+ done();
+ });
+
+ it('errors on missing message', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha1'
+ };
+
+ var auth = Hawk.client.message('example.com', 80, undefined, { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
+ expect(auth).to.not.exist();
+ done();
+ });
+
+ it('errors on invalid message', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha1'
+ };
+
+ var auth = Hawk.client.message('example.com', 80, 5, { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
+ expect(auth).to.not.exist();
+ done();
+ });
+
+ it('errors on missing options', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha1'
+ };
+
+ var auth = Hawk.client.message('example.com', 80, 'I am the boodyman');
+ expect(auth).to.not.exist();
+ done();
+ });
+
+ it('errors on invalid credentials (id)', function (done) {
+
+ var credentials = {
+ key: '2983d45yun89q',
+ algorithm: 'sha1'
+ };
+
+ var auth = Hawk.client.message('example.com', 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
+ expect(auth).to.not.exist();
+ done();
+ });
+
+ it('errors on invalid credentials (key)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ algorithm: 'sha1'
+ };
+
+ var auth = Hawk.client.message('example.com', 80, 'I am the boodyman', { credentials: credentials, timestamp: 1353809207, nonce: 'abc123' });
+ expect(auth).to.not.exist();
+ done();
+ });
+ });
+});
diff --git a/node_modules/request/node_modules/hawk/test/crypto.js b/node_modules/request/node_modules/hawk/test/crypto.js
new file mode 100755
index 000000000..1131628bf
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/test/crypto.js
@@ -0,0 +1,70 @@
+// Load modules
+
+var Code = require('code');
+var Hawk = require('../lib');
+var Lab = require('lab');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.experiment;
+var it = lab.test;
+var expect = Code.expect;
+
+
+describe('Crypto', function () {
+
+ describe('generateNormalizedString()', function () {
+
+ it('should return a valid normalized string', function (done) {
+
+ expect(Hawk.crypto.generateNormalizedString('header', {
+ ts: 1357747017,
+ nonce: 'k3k4j5',
+ method: 'GET',
+ resource: '/resource/something',
+ host: 'example.com',
+ port: 8080
+ })).to.equal('hawk.1.header\n1357747017\nk3k4j5\nGET\n/resource/something\nexample.com\n8080\n\n\n');
+
+ done();
+ });
+
+ it('should return a valid normalized string (ext)', function (done) {
+
+ expect(Hawk.crypto.generateNormalizedString('header', {
+ ts: 1357747017,
+ nonce: 'k3k4j5',
+ method: 'GET',
+ resource: '/resource/something',
+ host: 'example.com',
+ port: 8080,
+ ext: 'this is some app data'
+ })).to.equal('hawk.1.header\n1357747017\nk3k4j5\nGET\n/resource/something\nexample.com\n8080\n\nthis is some app data\n');
+
+ done();
+ });
+
+ it('should return a valid normalized string (payload + ext)', function (done) {
+
+ expect(Hawk.crypto.generateNormalizedString('header', {
+ ts: 1357747017,
+ nonce: 'k3k4j5',
+ method: 'GET',
+ resource: '/resource/something',
+ host: 'example.com',
+ port: 8080,
+ hash: 'U4MKKSmiVxk37JCCrAVIjV/OhB3y+NdwoCr6RShbVkE=',
+ ext: 'this is some app data'
+ })).to.equal('hawk.1.header\n1357747017\nk3k4j5\nGET\n/resource/something\nexample.com\n8080\nU4MKKSmiVxk37JCCrAVIjV/OhB3y+NdwoCr6RShbVkE=\nthis is some app data\n');
+
+ done();
+ });
+ });
+});
diff --git a/node_modules/request/node_modules/hawk/test/index.js b/node_modules/request/node_modules/hawk/test/index.js
new file mode 100755
index 000000000..39f2c5b86
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/test/index.js
@@ -0,0 +1,378 @@
+// Load modules
+
+var Url = require('url');
+var Code = require('code');
+var Hawk = require('../lib');
+var Lab = require('lab');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.experiment;
+var it = lab.test;
+var expect = Code.expect;
+
+
+describe('Hawk', function () {
+
+ var credentialsFunc = function (id, callback) {
+
+ var credentials = {
+ id: id,
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: (id === '1' ? 'sha1' : 'sha256'),
+ user: 'steve'
+ };
+
+ return callback(null, credentials);
+ };
+
+ it('generates a header then successfully parse it (configuration)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Hawk.client.header(Url.parse('http://example.com:8080/resource/4?filter=a'), req.method, { credentials: credentials, ext: 'some-app-data' }).field;
+ expect(req.authorization).to.exist();
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it (node request)', function (done) {
+
+ var req = {
+ method: 'POST',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: 'example.com:8080',
+ 'content-type': 'text/plain;x=y'
+ }
+ };
+
+ var payload = 'some not so random text';
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var reqHeader = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+ req.headers.authorization = reqHeader.field;
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+ var res = {
+ headers: {
+ 'content-type': 'text/plain'
+ }
+ };
+
+ res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
+ expect(res.headers['server-authorization']).to.exist();
+
+ expect(Hawk.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(true);
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it (absolute request uri)', function (done) {
+
+ var req = {
+ method: 'POST',
+ url: 'http://example.com:8080/resource/4?filter=a',
+ headers: {
+ host: 'example.com:8080',
+ 'content-type': 'text/plain;x=y'
+ }
+ };
+
+ var payload = 'some not so random text';
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var reqHeader = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+ req.headers.authorization = reqHeader.field;
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+ var res = {
+ headers: {
+ 'content-type': 'text/plain'
+ }
+ };
+
+ res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
+ expect(res.headers['server-authorization']).to.exist();
+
+ expect(Hawk.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(true);
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it (no server header options)', function (done) {
+
+ var req = {
+ method: 'POST',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: 'example.com:8080',
+ 'content-type': 'text/plain;x=y'
+ }
+ };
+
+ var payload = 'some not so random text';
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var reqHeader = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+ req.headers.authorization = reqHeader.field;
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+ var res = {
+ headers: {
+ 'content-type': 'text/plain'
+ }
+ };
+
+ res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts);
+ expect(res.headers['server-authorization']).to.exist();
+
+ expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(true);
+ done();
+ });
+ });
+ });
+
+ it('generates a header then fails to parse it (missing server header hash)', function (done) {
+
+ var req = {
+ method: 'POST',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: 'example.com:8080',
+ 'content-type': 'text/plain;x=y'
+ }
+ };
+
+ var payload = 'some not so random text';
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var reqHeader = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+ req.headers.authorization = reqHeader.field;
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+ var res = {
+ headers: {
+ 'content-type': 'text/plain'
+ }
+ };
+
+ res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts);
+ expect(res.headers['server-authorization']).to.exist();
+
+ expect(Hawk.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(false);
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it (with hash)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it then validate payload', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ expect(Hawk.server.authenticatePayload('hola!', credentials, artifacts)).to.be.true();
+ expect(Hawk.server.authenticatePayload('hello!', credentials, artifacts)).to.be.false();
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parses and validates payload', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
+ Hawk.server.authenticate(req, credentialsFunc, { payload: 'hola!' }, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it (app)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', app: 'asd23ased' }).field;
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ expect(artifacts.app).to.equal('asd23ased');
+ done();
+ });
+ });
+ });
+
+ it('generates a header then successfully parse it (app, dlg)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', app: 'asd23ased', dlg: '23434szr3q4d' }).field;
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(artifacts.ext).to.equal('some-app-data');
+ expect(artifacts.app).to.equal('asd23ased');
+ expect(artifacts.dlg).to.equal('23434szr3q4d');
+ done();
+ });
+ });
+ });
+
+ it('generates a header then fail authentication due to bad hash', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
+ Hawk.server.authenticate(req, credentialsFunc, { payload: 'byebye!' }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Bad payload hash');
+ done();
+ });
+ });
+ });
+
+ it('generates a header for one resource then fail to authenticate another', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' }).field;
+ req.url = '/something/else';
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(credentials).to.exist();
+ done();
+ });
+ });
+ });
+});
diff --git a/node_modules/request/node_modules/hawk/test/readme.js b/node_modules/request/node_modules/hawk/test/readme.js
new file mode 100755
index 000000000..a46626466
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/test/readme.js
@@ -0,0 +1,95 @@
+// Load modules
+
+var Code = require('code');
+var Hawk = require('../lib');
+var Hoek = require('hoek');
+var Lab = require('lab');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.experiment;
+var it = lab.test;
+var expect = Code.expect;
+
+
+describe('README', function () {
+
+ describe('core', function () {
+
+ var credentials = {
+ id: 'dh37fgj492je',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256'
+ };
+
+ var options = {
+ credentials: credentials,
+ timestamp: 1353832234,
+ nonce: 'j4h3g2',
+ ext: 'some-app-ext-data'
+ };
+
+ it('should generate a header protocol example', function (done) {
+
+ var header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'GET', options).field;
+
+ expect(header).to.equal('Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="');
+ done();
+ });
+
+ it('should generate a normalized string protocol example', function (done) {
+
+ var normalized = Hawk.crypto.generateNormalizedString('header', {
+ credentials: credentials,
+ ts: options.timestamp,
+ nonce: options.nonce,
+ method: 'GET',
+ resource: '/resource?a=1&b=2',
+ host: 'example.com',
+ port: 8000,
+ ext: options.ext
+ });
+
+ expect(normalized).to.equal('hawk.1.header\n1353832234\nj4h3g2\nGET\n/resource?a=1&b=2\nexample.com\n8000\n\nsome-app-ext-data\n');
+ done();
+ });
+
+ var payloadOptions = Hoek.clone(options);
+ payloadOptions.payload = 'Thank you for flying Hawk';
+ payloadOptions.contentType = 'text/plain';
+
+ it('should generate a header protocol example (with payload)', function (done) {
+
+ var header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'POST', payloadOptions).field;
+
+ expect(header).to.equal('Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", hash="Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=", ext="some-app-ext-data", mac="aSe1DERmZuRl3pI36/9BdZmnErTw3sNzOOAUlfeKjVw="');
+ done();
+ });
+
+ it('should generate a normalized string protocol example (with payload)', function (done) {
+
+ var normalized = Hawk.crypto.generateNormalizedString('header', {
+ credentials: credentials,
+ ts: options.timestamp,
+ nonce: options.nonce,
+ method: 'POST',
+ resource: '/resource?a=1&b=2',
+ host: 'example.com',
+ port: 8000,
+ hash: Hawk.crypto.calculatePayloadHash(payloadOptions.payload, credentials.algorithm, payloadOptions.contentType),
+ ext: options.ext
+ });
+
+ expect(normalized).to.equal('hawk.1.header\n1353832234\nj4h3g2\nPOST\n/resource?a=1&b=2\nexample.com\n8000\nYi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=\nsome-app-ext-data\n');
+ done();
+ });
+ });
+});
+
diff --git a/node_modules/request/node_modules/hawk/test/server.js b/node_modules/request/node_modules/hawk/test/server.js
new file mode 100755
index 000000000..b95b7cd02
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/test/server.js
@@ -0,0 +1,1314 @@
+// Load modules
+
+var Url = require('url');
+var Code = require('code');
+var Hawk = require('../lib');
+var Hoek = require('hoek');
+var Lab = require('lab');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.experiment;
+var it = lab.test;
+var expect = Code.expect;
+
+
+describe('Server', function () {
+
+ var credentialsFunc = function (id, callback) {
+
+ var credentials = {
+ id: id,
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: (id === '1' ? 'sha1' : 'sha256'),
+ user: 'steve'
+ };
+
+ return callback(null, credentials);
+ };
+
+ describe('authenticate()', function () {
+
+ it('parses a valid authentication header (sha1)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="1", ts="1353788437", nonce="k3j4h2", mac="zy79QQ5/EYFmQqutVnYb73gAc/U=", ext="hello"'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ done();
+ });
+ });
+
+ it('parses a valid authentication header (sha256)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/1?b=1&a=2',
+ host: 'example.com',
+ port: 8000,
+ authorization: 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", mac="m8r1rHbXN6NgO+KIIhjO7sFRyd78RNGVUwehe8Cp2dU=", ext="some-app-data"'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353832234000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ done();
+ });
+ });
+
+ it('parses a valid authentication header (host override)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: 'example1.com:8080',
+ authorization: 'Hawk id="1", ts="1353788437", nonce="k3j4h2", mac="zy79QQ5/EYFmQqutVnYb73gAc/U=", ext="hello"'
+ }
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { host: 'example.com', localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ done();
+ });
+ });
+
+ it('parses a valid authentication header (host port override)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: 'example1.com:80',
+ authorization: 'Hawk id="1", ts="1353788437", nonce="k3j4h2", mac="zy79QQ5/EYFmQqutVnYb73gAc/U=", ext="hello"'
+ }
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { host: 'example.com', port: 8080, localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ done();
+ });
+ });
+
+ it('parses a valid authentication header (POST with payload)', function (done) {
+
+ var req = {
+ method: 'POST',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123456", ts="1357926341", nonce="1AwuJD", hash="qAiXIVv+yjDATneWxZP2YCTa9aHRgQdnH9b3Wc+o3dg=", ext="some-app-data", mac="UeYcj5UoTVaAWXNvJfLVia7kU3VabxCqrccXP8sUGC4="'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1357926341000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ done();
+ });
+ });
+
+ it('errors on missing hash', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/1?b=1&a=2',
+ host: 'example.com',
+ port: 8000,
+ authorization: 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", mac="m8r1rHbXN6NgO+KIIhjO7sFRyd78RNGVUwehe8Cp2dU=", ext="some-app-data"'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { payload: 'body', localtimeOffsetMsec: 1353832234000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Missing required payload hash');
+ done();
+ });
+ });
+
+ it('errors on a stale timestamp', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123456", ts="1362337299", nonce="UzmxSs", ext="some-app-data", mac="wnNUxchvvryMH2RxckTdZ/gY3ijzvccx4keVvELC61w="'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Stale timestamp');
+ var header = err.output.headers['WWW-Authenticate'];
+ var ts = header.match(/^Hawk ts\=\"(\d+)\"\, tsm\=\"([^\"]+)\"\, error=\"Stale timestamp\"$/);
+ var now = Hawk.utils.now();
+ expect(parseInt(ts[1], 10) * 1000).to.be.within(now - 1000, now + 1000);
+
+ var res = {
+ headers: {
+ 'www-authenticate': header
+ }
+ };
+
+ expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(true);
+ done();
+ });
+ });
+
+ it('errors on a replay', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="bXx7a7p1h9QYQNZ8x7QhvDQym8ACgab4m3lVSFn4DBw=", ext="hello"'
+ };
+
+ var memoryCache = {};
+ var options = {
+ localtimeOffsetMsec: 1353788437000 - Hawk.utils.now(),
+ nonceFunc: function (key, nonce, ts, callback) {
+
+ if (memoryCache[key + nonce]) {
+ return callback(new Error());
+ }
+
+ memoryCache[key + nonce] = true;
+ return callback();
+ }
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, options, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+
+ Hawk.server.authenticate(req, credentialsFunc, options, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Invalid nonce');
+ done();
+ });
+ });
+ });
+
+ it('does not error on nonce collision if keys differ', function (done) {
+
+ var reqSteve = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="bXx7a7p1h9QYQNZ8x7QhvDQym8ACgab4m3lVSFn4DBw=", ext="hello"'
+ };
+
+ var reqBob = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="456", ts="1353788437", nonce="k3j4h2", mac="LXfmTnRzrLd9TD7yfH+4se46Bx6AHyhpM94hLCiNia4=", ext="hello"'
+ };
+
+ var credentialsFunc = function (id, callback) {
+
+ var credentials = {
+ '123': {
+ id: id,
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: (id === '1' ? 'sha1' : 'sha256'),
+ user: 'steve'
+ },
+ '456': {
+ id: id,
+ key: 'xrunpaw3489ruxnpa98w4rxnwerxhqb98rpaxn39848',
+ algorithm: (id === '1' ? 'sha1' : 'sha256'),
+ user: 'bob'
+ }
+ };
+
+ return callback(null, credentials[id]);
+ };
+
+ var memoryCache = {};
+ var options = {
+ localtimeOffsetMsec: 1353788437000 - Hawk.utils.now(),
+ nonceFunc: function (key, nonce, ts, callback) {
+
+ if (memoryCache[key + nonce]) {
+ return callback(new Error());
+ }
+
+ memoryCache[key + nonce] = true;
+ return callback();
+ }
+ };
+
+ Hawk.server.authenticate(reqSteve, credentialsFunc, options, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+
+ Hawk.server.authenticate(reqBob, credentialsFunc, options, function (err, credentials, artifacts) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('bob');
+ done();
+ });
+ });
+ });
+
+ it('errors on an invalid authentication header: wrong scheme', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Basic asdasdasdasd'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.not.exist();
+ done();
+ });
+ });
+
+ it('errors on an invalid authentication header: no scheme', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: '!@#'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Invalid header syntax');
+ done();
+ });
+ });
+
+ it('errors on an missing authorization header', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.isMissing).to.equal(true);
+ done();
+ });
+ });
+
+ it('errors on an missing host header', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ headers: {
+ authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ }
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Invalid Host header');
+ done();
+ });
+ });
+
+ it('errors on an missing authorization attribute (id)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Missing attributes');
+ done();
+ });
+ });
+
+ it('errors on an missing authorization attribute (ts)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Missing attributes');
+ done();
+ });
+ });
+
+ it('errors on an missing authorization attribute (nonce)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123", ts="1353788437", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Missing attributes');
+ done();
+ });
+ });
+
+ it('errors on an missing authorization attribute (mac)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", ext="hello"'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Missing attributes');
+ done();
+ });
+ });
+
+ it('errors on an unknown authorization attribute', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", x="3", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Unknown attribute: x');
+ done();
+ });
+ });
+
+ it('errors on an bad authorization header format', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123\\", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Bad header format');
+ done();
+ });
+ });
+
+ it('errors on an bad authorization attribute value', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="\t", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Bad attribute value: id');
+ done();
+ });
+ });
+
+ it('errors on an empty authorization attribute value', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Bad attribute value: id');
+ done();
+ });
+ });
+
+ it('errors on duplicated authorization attribute key', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123", id="456", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Duplicate attribute: id');
+ done();
+ });
+ });
+
+ it('errors on an invalid authorization header format', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk'
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Invalid header syntax');
+ done();
+ });
+ });
+
+ it('errors on an bad host header (missing host)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: ':8080',
+ authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ }
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Invalid Host header');
+ done();
+ });
+ });
+
+ it('errors on an bad host header (pad port)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: 'example.com:something',
+ authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ }
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Invalid Host header');
+ done();
+ });
+ });
+
+ it('errors on credentialsFunc error', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ };
+
+ var credentialsFunc = function (id, callback) {
+
+ return callback(new Error('Unknown user'));
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Unknown user');
+ done();
+ });
+ });
+
+ it('errors on credentialsFunc error (with credentials)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ };
+
+ var credentialsFunc = function (id, callback) {
+
+ return callback(new Error('Unknown user'), { some: 'value' });
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Unknown user');
+ expect(credentials.some).to.equal('value');
+ done();
+ });
+ });
+
+ it('errors on missing credentials', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ };
+
+ var credentialsFunc = function (id, callback) {
+
+ return callback(null, null);
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Unknown credentials');
+ done();
+ });
+ });
+
+ it('errors on invalid credentials (id)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ };
+
+ var credentialsFunc = function (id, callback) {
+
+ var credentials = {
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ user: 'steve'
+ };
+
+ return callback(null, credentials);
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Invalid credentials');
+ expect(err.output.payload.message).to.equal('An internal server error occurred');
+ done();
+ });
+ });
+
+ it('errors on invalid credentials (key)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ };
+
+ var credentialsFunc = function (id, callback) {
+
+ var credentials = {
+ id: '23434d3q4d5345d',
+ user: 'steve'
+ };
+
+ return callback(null, credentials);
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Invalid credentials');
+ expect(err.output.payload.message).to.equal('An internal server error occurred');
+ done();
+ });
+ });
+
+ it('errors on unknown credentials algorithm', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ };
+
+ var credentialsFunc = function (id, callback) {
+
+ var credentials = {
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'hmac-sha-0',
+ user: 'steve'
+ };
+
+ return callback(null, credentials);
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Unknown algorithm');
+ expect(err.output.payload.message).to.equal('An internal server error occurred');
+ done();
+ });
+ });
+
+ it('errors on unknown bad mac', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcU4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+ };
+
+ var credentialsFunc = function (id, callback) {
+
+ var credentials = {
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ return callback(null, credentials);
+ };
+
+ Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Bad mac');
+ done();
+ });
+ });
+ });
+
+ describe('header()', function () {
+
+ it('generates header', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ var artifacts = {
+ method: 'POST',
+ host: 'example.com',
+ port: '8080',
+ resource: '/resource/4?filter=a',
+ ts: '1398546787',
+ nonce: 'xUwusx',
+ hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
+ ext: 'some-app-data',
+ mac: 'dvIvMThwi28J61Jc3P0ryAhuKpanU63GXdx6hkmQkJA=',
+ id: '123456'
+ };
+
+ var header = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
+ expect(header).to.equal('Hawk mac=\"n14wVJK4cOxAytPUMc5bPezQzuJGl5n7MYXhFQgEKsE=\", hash=\"f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=\", ext=\"response-specific\"');
+ done();
+ });
+
+ it('generates header (empty payload)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ var artifacts = {
+ method: 'POST',
+ host: 'example.com',
+ port: '8080',
+ resource: '/resource/4?filter=a',
+ ts: '1398546787',
+ nonce: 'xUwusx',
+ hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
+ ext: 'some-app-data',
+ mac: 'dvIvMThwi28J61Jc3P0ryAhuKpanU63GXdx6hkmQkJA=',
+ id: '123456'
+ };
+
+ var header = Hawk.server.header(credentials, artifacts, { payload: '', contentType: 'text/plain', ext: 'response-specific' });
+ expect(header).to.equal('Hawk mac=\"i8/kUBDx0QF+PpCtW860kkV/fa9dbwEoe/FpGUXowf0=\", hash=\"q/t+NNAkQZNlq/aAD6PlexImwQTxwgT2MahfTa9XRLA=\", ext=\"response-specific\"');
+ done();
+ });
+
+ it('generates header (pre calculated hash)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ var artifacts = {
+ method: 'POST',
+ host: 'example.com',
+ port: '8080',
+ resource: '/resource/4?filter=a',
+ ts: '1398546787',
+ nonce: 'xUwusx',
+ hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
+ ext: 'some-app-data',
+ mac: 'dvIvMThwi28J61Jc3P0ryAhuKpanU63GXdx6hkmQkJA=',
+ id: '123456'
+ };
+
+ var options = { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' };
+ options.hash = Hawk.crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
+ var header = Hawk.server.header(credentials, artifacts, options);
+ expect(header).to.equal('Hawk mac=\"n14wVJK4cOxAytPUMc5bPezQzuJGl5n7MYXhFQgEKsE=\", hash=\"f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=\", ext=\"response-specific\"');
+ done();
+ });
+
+ it('generates header (null ext)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ var artifacts = {
+ method: 'POST',
+ host: 'example.com',
+ port: '8080',
+ resource: '/resource/4?filter=a',
+ ts: '1398546787',
+ nonce: 'xUwusx',
+ hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
+ mac: 'dvIvMThwi28J61Jc3P0ryAhuKpanU63GXdx6hkmQkJA=',
+ id: '123456'
+ };
+
+ var header = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: null });
+ expect(header).to.equal('Hawk mac=\"6PrybJTJs20jsgBw5eilXpcytD8kUbaIKNYXL+6g0ns=\", hash=\"f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=\"');
+ done();
+ });
+
+ it('errors on missing artifacts', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ var header = Hawk.server.header(credentials, null, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
+ expect(header).to.equal('');
+ done();
+ });
+
+ it('errors on invalid artifacts', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ var header = Hawk.server.header(credentials, 5, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
+ expect(header).to.equal('');
+ done();
+ });
+
+ it('errors on missing credentials', function (done) {
+
+ var artifacts = {
+ method: 'POST',
+ host: 'example.com',
+ port: '8080',
+ resource: '/resource/4?filter=a',
+ ts: '1398546787',
+ nonce: 'xUwusx',
+ hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
+ ext: 'some-app-data',
+ mac: 'dvIvMThwi28J61Jc3P0ryAhuKpanU63GXdx6hkmQkJA=',
+ id: '123456'
+ };
+
+ var header = Hawk.server.header(null, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
+ expect(header).to.equal('');
+ done();
+ });
+
+ it('errors on invalid credentials (key)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ var artifacts = {
+ method: 'POST',
+ host: 'example.com',
+ port: '8080',
+ resource: '/resource/4?filter=a',
+ ts: '1398546787',
+ nonce: 'xUwusx',
+ hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
+ ext: 'some-app-data',
+ mac: 'dvIvMThwi28J61Jc3P0ryAhuKpanU63GXdx6hkmQkJA=',
+ id: '123456'
+ };
+
+ var header = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
+ expect(header).to.equal('');
+ done();
+ });
+
+ it('errors on invalid algorithm', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'x',
+ user: 'steve'
+ };
+
+ var artifacts = {
+ method: 'POST',
+ host: 'example.com',
+ port: '8080',
+ resource: '/resource/4?filter=a',
+ ts: '1398546787',
+ nonce: 'xUwusx',
+ hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
+ ext: 'some-app-data',
+ mac: 'dvIvMThwi28J61Jc3P0ryAhuKpanU63GXdx6hkmQkJA=',
+ id: '123456'
+ };
+
+ var header = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
+ expect(header).to.equal('');
+ done();
+ });
+ });
+
+ describe('authenticateMessage()', function () {
+
+ it('errors on invalid authorization (ts)', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ delete auth.ts;
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Invalid authorization');
+ done();
+ });
+ });
+ });
+
+ it('errors on invalid authorization (nonce)', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ delete auth.nonce;
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Invalid authorization');
+ done();
+ });
+ });
+ });
+
+ it('errors on invalid authorization (hash)', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ delete auth.hash;
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Invalid authorization');
+ done();
+ });
+ });
+ });
+
+ it('errors with credentials', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, function (id, callback) {
+
+ callback(new Error('something'), { some: 'value' });
+ }, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('something');
+ expect(credentials.some).to.equal('value');
+ done();
+ });
+ });
+ });
+
+ it('errors on nonce collision', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {
+ nonceFunc: function (key, nonce, ts, nonceCallback) {
+
+ nonceCallback(true);
+ }
+ }, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Invalid nonce');
+ done();
+ });
+ });
+ });
+
+ var credentialsFunc = function (id, callback) {
+
+ var credentials = {
+ id: id,
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: (id === '1' ? 'sha1' : 'sha256'),
+ user: 'steve'
+ };
+
+ return callback(null, credentials);
+ };
+
+ it('should generate an authorization then successfully parse it', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on mismatching host', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ Hawk.server.authenticateMessage('example1.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Bad mac');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on stale timestamp', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, { localtimeOffsetMsec: 100000 }, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Stale timestamp');
+ done();
+ });
+ });
+ });
+
+ it('overrides timestampSkewSec', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials, localtimeOffsetMsec: 100000 });
+ expect(auth).to.exist();
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, { timestampSkewSec: 500 }, function (err, credentials) {
+
+ expect(err).to.not.exist();
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on invalid authorization', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+ delete auth.id;
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Invalid authorization');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on bad hash', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message1', auth, credentialsFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Bad message hash');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on nonce error', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {
+ nonceFunc: function (key, nonce, ts, callback) {
+
+ callback(new Error('kaboom'));
+ }
+ }, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Invalid nonce');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on credentials error', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ var errFunc = function (id, callback) {
+
+ callback(new Error('kablooey'));
+ };
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('kablooey');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on missing credentials', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ var errFunc = function (id, callback) {
+
+ callback();
+ };
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Unknown credentials');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on invalid credentials', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ var errFunc = function (id, callback) {
+
+ callback(null, {});
+ };
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Invalid credentials');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on invalid credentials algorithm', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ var errFunc = function (id, callback) {
+
+ callback(null, { key: '123', algorithm: '456' });
+ };
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Unknown algorithm');
+ done();
+ });
+ });
+ });
+
+ it('should fail on missing host', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message(null, 8080, 'some message', { credentials: credentials });
+ expect(auth).to.not.exist();
+ done();
+ });
+ });
+
+ it('should fail on missing credentials', function (done) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', {});
+ expect(auth).to.not.exist();
+ done();
+ });
+
+ it('should fail on invalid algorithm', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var creds = Hoek.clone(credentials);
+ creds.algorithm = 'blah';
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: creds });
+ expect(auth).to.not.exist();
+ done();
+ });
+ });
+ });
+
+ describe('authenticatePayloadHash()', function () {
+
+ it('checks payload hash', function (done) {
+
+ expect(Hawk.server.authenticatePayloadHash('abcdefg', { hash: 'abcdefg' })).to.equal(true);
+ expect(Hawk.server.authenticatePayloadHash('1234567', { hash: 'abcdefg' })).to.equal(false);
+ done();
+ });
+ });
+});
+
diff --git a/node_modules/request/node_modules/hawk/test/uri.js b/node_modules/request/node_modules/hawk/test/uri.js
new file mode 100755
index 000000000..1b623c091
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/test/uri.js
@@ -0,0 +1,849 @@
+// Load modules
+
+var Http = require('http');
+var Url = require('url');
+var Code = require('code');
+var Hawk = require('../lib');
+var Hoek = require('hoek');
+var Lab = require('lab');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.experiment;
+var it = lab.test;
+var expect = Code.expect;
+
+
+describe('Uri', function () {
+
+ var credentialsFunc = function (id, callback) {
+
+ var credentials = {
+ id: id,
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: 'sha256',
+ user: 'steve'
+ };
+
+ return callback(null, credentials);
+ };
+
+ it('should generate a bewit then successfully authenticate it', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?a=1&b=2',
+ host: 'example.com',
+ port: 80
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var bewit = Hawk.uri.getBewit('http://example.com/resource/4?a=1&b=2', { credentials: credentials, ttlSec: 60 * 60 * 24 * 365 * 100, ext: 'some-app-data' });
+ req.url += '&bewit=' + bewit;
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(attributes.ext).to.equal('some-app-data');
+ done();
+ });
+ });
+ });
+
+ it('should generate a bewit then successfully authenticate it (no ext)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?a=1&b=2',
+ host: 'example.com',
+ port: 80
+ };
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var bewit = Hawk.uri.getBewit('http://example.com/resource/4?a=1&b=2', { credentials: credentials, ttlSec: 60 * 60 * 24 * 365 * 100 });
+ req.url += '&bewit=' + bewit;
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ done();
+ });
+ });
+ });
+
+ it('should successfully authenticate a request (last param)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?a=1&b=2&bewit=MTIzNDU2XDQ1MTE0ODQ2MjFcMzFjMmNkbUJFd1NJRVZDOVkva1NFb2c3d3YrdEVNWjZ3RXNmOGNHU2FXQT1cc29tZS1hcHAtZGF0YQ',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(attributes.ext).to.equal('some-app-data');
+ done();
+ });
+ });
+
+ it('should successfully authenticate a request (first param)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?bewit=MTIzNDU2XDQ1MTE0ODQ2MjFcMzFjMmNkbUJFd1NJRVZDOVkva1NFb2c3d3YrdEVNWjZ3RXNmOGNHU2FXQT1cc29tZS1hcHAtZGF0YQ&a=1&b=2',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(attributes.ext).to.equal('some-app-data');
+ done();
+ });
+ });
+
+ it('should successfully authenticate a request (only param)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?bewit=MTIzNDU2XDQ1MTE0ODQ2NDFcZm1CdkNWT3MvcElOTUUxSTIwbWhrejQ3UnBwTmo4Y1VrSHpQd3Q5OXJ1cz1cc29tZS1hcHAtZGF0YQ',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ expect(attributes.ext).to.equal('some-app-data');
+ done();
+ });
+ });
+
+ it('should fail on multiple authentication', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?bewit=MTIzNDU2XDQ1MTE0ODQ2NDFcZm1CdkNWT3MvcElOTUUxSTIwbWhrejQ3UnBwTmo4Y1VrSHpQd3Q5OXJ1cz1cc29tZS1hcHAtZGF0YQ',
+ host: 'example.com',
+ port: 8080,
+ authorization: 'Basic asdasdasdasd'
+ };
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Multiple authentications');
+ done();
+ });
+ });
+
+ it('should fail on method other than GET', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var req = {
+ method: 'POST',
+ url: '/resource/4?filter=a',
+ host: 'example.com',
+ port: 8080
+ };
+
+ var exp = Math.floor(Hawk.utils.now() / 1000) + 60;
+ var ext = 'some-app-data';
+ var mac = Hawk.crypto.calculateMac('bewit', credentials, {
+ timestamp: exp,
+ nonce: '',
+ method: req.method,
+ resource: req.url,
+ host: req.host,
+ port: req.port,
+ ext: ext
+ });
+
+ var bewit = credentials.id + '\\' + exp + '\\' + mac + '\\' + ext;
+
+ req.url += '&bewit=' + Hoek.base64urlEncode(bewit);
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Invalid method');
+ done();
+ });
+ });
+ });
+
+ it('should fail on invalid host header', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
+ headers: {
+ host: 'example.com:something'
+ }
+ };
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Invalid Host header');
+ done();
+ });
+ });
+
+ it('should fail on empty bewit', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?bewit=',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Empty bewit');
+ expect(err.isMissing).to.not.exist();
+ done();
+ });
+ });
+
+ it('should fail on invalid bewit', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?bewit=*',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Invalid bewit encoding');
+ expect(err.isMissing).to.not.exist();
+ done();
+ });
+ });
+
+ it('should fail on missing bewit', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.not.exist();
+ expect(err.isMissing).to.equal(true);
+ done();
+ });
+ });
+
+ it('should fail on invalid bewit structure', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?bewit=abc',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Invalid bewit structure');
+ done();
+ });
+ });
+
+ it('should fail on empty bewit attribute', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?bewit=YVxcY1xk',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Missing bewit attributes');
+ done();
+ });
+ });
+
+ it('should fail on missing bewit id attribute', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?bewit=XDQ1NTIxNDc2MjJcK0JFbFhQMXhuWjcvd1Nrbm1ldGhlZm5vUTNHVjZNSlFVRHk4NWpTZVJ4VT1cc29tZS1hcHAtZGF0YQ',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Missing bewit attributes');
+ done();
+ });
+ });
+
+ it('should fail on expired access', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?a=1&b=2&bewit=MTIzNDU2XDEzNTY0MTg1ODNcWk1wZlMwWU5KNHV0WHpOMmRucTRydEk3NXNXTjFjeWVITTcrL0tNZFdVQT1cc29tZS1hcHAtZGF0YQ',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Access expired');
+ done();
+ });
+ });
+
+ it('should fail on credentials function error', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, function (id, callback) {
+
+ callback(Hawk.error.badRequest('Boom'));
+ }, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Boom');
+ done();
+ });
+ });
+
+ it('should fail on credentials function error with credentials', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, function (id, callback) {
+
+ callback(Hawk.error.badRequest('Boom'), { some: 'value' });
+ }, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Boom');
+ expect(credentials.some).to.equal('value');
+ done();
+ });
+ });
+
+ it('should fail on null credentials function response', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, function (id, callback) {
+
+ callback(null, null);
+ }, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Unknown credentials');
+ done();
+ });
+ });
+
+ it('should fail on invalid credentials function response', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, function (id, callback) {
+
+ callback(null, {});
+ }, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Invalid credentials');
+ done();
+ });
+ });
+
+ it('should fail on invalid credentials function response (unknown algorithm)', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, function (id, callback) {
+
+ callback(null, { key: 'xxx', algorithm: 'xxx' });
+ }, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Unknown algorithm');
+ done();
+ });
+ });
+
+ it('should fail on expired access', function (done) {
+
+ var req = {
+ method: 'GET',
+ url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
+ host: 'example.com',
+ port: 8080
+ };
+
+ Hawk.uri.authenticate(req, function (id, callback) {
+
+ callback(null, { key: 'xxx', algorithm: 'sha256' });
+ }, {}, function (err, credentials, attributes) {
+
+ expect(err).to.exist();
+ expect(err.output.payload.message).to.equal('Bad mac');
+ done();
+ });
+ });
+
+ describe('getBewit()', function () {
+
+ it('returns a valid bewit value', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
+ expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdca3NjeHdOUjJ0SnBQMVQxekRMTlBiQjVVaUtJVTl0T1NKWFRVZEc3WDloOD1ceGFuZHlhbmR6');
+ done();
+ });
+
+ it('returns a valid bewit value (explicit port)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Hawk.uri.getBewit('https://example.com:8080/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
+ expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdcaFpiSjNQMmNLRW80a3kwQzhqa1pBa1J5Q1p1ZWc0V1NOYnhWN3ZxM3hIVT1ceGFuZHlhbmR6');
+ done();
+ });
+
+ it('returns a valid bewit value (null ext)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: null });
+ expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdcSUdZbUxnSXFMckNlOEN4dktQczRKbFdJQStValdKSm91d2dBUmlWaENBZz1c');
+ done();
+ });
+
+ it('returns a valid bewit value (parsed uri)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Hawk.uri.getBewit(Url.parse('https://example.com/somewhere/over/the/rainbow'), { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
+ expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdca3NjeHdOUjJ0SnBQMVQxekRMTlBiQjVVaUtJVTl0T1NKWFRVZEc3WDloOD1ceGFuZHlhbmR6');
+ done();
+ });
+
+ it('errors on invalid options', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', 4);
+ expect(bewit).to.equal('');
+ done();
+ });
+
+ it('errors on missing uri', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Hawk.uri.getBewit('', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
+ expect(bewit).to.equal('');
+ done();
+ });
+
+ it('errors on invalid uri', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Hawk.uri.getBewit(5, { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
+ expect(bewit).to.equal('');
+ done();
+ });
+
+ it('errors on invalid credentials (id)', function (done) {
+
+ var credentials = {
+ key: '2983d45yun89q',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 3000, ext: 'xandyandz' });
+ expect(bewit).to.equal('');
+ done();
+ });
+
+ it('errors on missing credentials', function (done) {
+
+ var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', { ttlSec: 3000, ext: 'xandyandz' });
+ expect(bewit).to.equal('');
+ done();
+ });
+
+ it('errors on invalid credentials (key)', function (done) {
+
+ var credentials = {
+ id: '123456',
+ algorithm: 'sha256'
+ };
+
+ var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 3000, ext: 'xandyandz' });
+ expect(bewit).to.equal('');
+ done();
+ });
+
+ it('errors on invalid algorithm', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'hmac-sha-0'
+ };
+
+ var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, ext: 'xandyandz' });
+ expect(bewit).to.equal('');
+ done();
+ });
+
+ it('errors on missing options', function (done) {
+
+ var credentials = {
+ id: '123456',
+ key: '2983d45yun89q',
+ algorithm: 'hmac-sha-0'
+ };
+
+ var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow');
+ expect(bewit).to.equal('');
+ done();
+ });
+ });
+ describe('authenticateMessage()', function () {
+
+ var credentialsFunc = function (id, callback) {
+
+ var credentials = {
+ id: id,
+ key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+ algorithm: (id === '1' ? 'sha1' : 'sha256'),
+ user: 'steve'
+ };
+
+ return callback(null, credentials);
+ };
+
+ it('should generate an authorization then successfully parse it', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
+
+ expect(err).to.not.exist();
+ expect(credentials.user).to.equal('steve');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on mismatching host', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ Hawk.server.authenticateMessage('example1.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Bad mac');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on stale timestamp', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, { localtimeOffsetMsec: 100000 }, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Stale timestamp');
+ done();
+ });
+ });
+ });
+
+ it('overrides timestampSkewSec', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials, localtimeOffsetMsec: 100000 });
+ expect(auth).to.exist();
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, { timestampSkewSec: 500 }, function (err, credentials) {
+
+ expect(err).to.not.exist();
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on invalid authorization', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+ delete auth.id;
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Invalid authorization');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on bad hash', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message1', auth, credentialsFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Bad message hash');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on nonce error', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {
+ nonceFunc: function (key, nonce, ts, callback) {
+
+ callback(new Error('kaboom'));
+ }
+ }, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Invalid nonce');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on credentials error', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ var errFunc = function (id, callback) {
+
+ callback(new Error('kablooey'));
+ };
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('kablooey');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on missing credentials', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ var errFunc = function (id, callback) {
+
+ callback();
+ };
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Unknown credentials');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on invalid credentials', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ var errFunc = function (id, callback) {
+
+ callback(null, {});
+ };
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Invalid credentials');
+ done();
+ });
+ });
+ });
+
+ it('should fail authorization on invalid credentials algorithm', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+ expect(auth).to.exist();
+
+ var errFunc = function (id, callback) {
+
+ callback(null, { key: '123', algorithm: '456' });
+ };
+
+ Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
+
+ expect(err).to.exist();
+ expect(err.message).to.equal('Unknown algorithm');
+ done();
+ });
+ });
+ });
+
+ it('should fail on missing host', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var auth = Hawk.client.message(null, 8080, 'some message', { credentials: credentials });
+ expect(auth).to.not.exist();
+ done();
+ });
+ });
+
+ it('should fail on missing credentials', function (done) {
+
+ var auth = Hawk.client.message('example.com', 8080, 'some message', {});
+ expect(auth).to.not.exist();
+ done();
+ });
+
+ it('should fail on invalid algorithm', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var creds = Hoek.clone(credentials);
+ creds.algorithm = 'blah';
+ var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: creds });
+ expect(auth).to.not.exist();
+ done();
+ });
+ });
+ });
+});
+
diff --git a/node_modules/request/node_modules/hawk/test/utils.js b/node_modules/request/node_modules/hawk/test/utils.js
new file mode 100755
index 000000000..1bfef65f8
--- /dev/null
+++ b/node_modules/request/node_modules/hawk/test/utils.js
@@ -0,0 +1,121 @@
+// Load modules
+
+var Code = require('code');
+var Hawk = require('../lib');
+var Lab = require('lab');
+var Package = require('../package.json');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var describe = lab.experiment;
+var it = lab.test;
+var expect = Code.expect;
+
+
+describe('Utils', function () {
+
+ describe('parseHost()', function () {
+
+ it('returns port 80 for non tls node request', function (done) {
+
+ var req = {
+ method: 'POST',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: 'example.com',
+ 'content-type': 'text/plain;x=y'
+ }
+ };
+
+ expect(Hawk.utils.parseHost(req, 'Host').port).to.equal(80);
+ done();
+ });
+
+ it('returns port 443 for non tls node request', function (done) {
+
+ var req = {
+ method: 'POST',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: 'example.com',
+ 'content-type': 'text/plain;x=y'
+ },
+ connection: {
+ encrypted: true
+ }
+ };
+
+ expect(Hawk.utils.parseHost(req, 'Host').port).to.equal(443);
+ done();
+ });
+
+ it('returns port 443 for non tls node request (IPv6)', function (done) {
+
+ var req = {
+ method: 'POST',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: '[123:123:123]',
+ 'content-type': 'text/plain;x=y'
+ },
+ connection: {
+ encrypted: true
+ }
+ };
+
+ expect(Hawk.utils.parseHost(req, 'Host').port).to.equal(443);
+ done();
+ });
+
+ it('parses IPv6 headers', function (done) {
+
+ var req = {
+ method: 'POST',
+ url: '/resource/4?filter=a',
+ headers: {
+ host: '[123:123:123]:8000',
+ 'content-type': 'text/plain;x=y'
+ },
+ connection: {
+ encrypted: true
+ }
+ };
+
+ var host = Hawk.utils.parseHost(req, 'Host');
+ expect(host.port).to.equal('8000');
+ expect(host.name).to.equal('[123:123:123]');
+ done();
+ });
+ });
+
+ describe('version()', function () {
+
+ it('returns the correct package version number', function (done) {
+
+ expect(Hawk.utils.version()).to.equal(Package.version);
+ done();
+ });
+ });
+
+ describe('unauthorized()', function () {
+
+ it('returns a hawk 401', function (done) {
+
+ expect(Hawk.utils.unauthorized('kaboom').output.headers['WWW-Authenticate']).to.equal('Hawk error="kaboom"');
+ done();
+ });
+
+ it('supports attributes', function (done) {
+
+ expect(Hawk.utils.unauthorized('kaboom', { a: 'b' }).output.headers['WWW-Authenticate']).to.equal('Hawk a="b", error="kaboom"');
+ done();
+ });
+ });
+});
diff --git a/node_modules/request/node_modules/http-signature/.dir-locals.el b/node_modules/request/node_modules/http-signature/.dir-locals.el
new file mode 100644
index 000000000..3bc9235f2
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/.dir-locals.el
@@ -0,0 +1,6 @@
+((nil . ((indent-tabs-mode . nil)
+ (tab-width . 8)
+ (fill-column . 80)))
+ (js-mode . ((js-indent-level . 2)
+ (indent-tabs-mode . nil)
+ ))) \ No newline at end of file
diff --git a/node_modules/request/node_modules/http-signature/.npmignore b/node_modules/request/node_modules/http-signature/.npmignore
new file mode 100644
index 000000000..c143fb3a4
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/.npmignore
@@ -0,0 +1,7 @@
+.gitmodules
+deps
+docs
+Makefile
+node_modules
+test
+tools \ No newline at end of file
diff --git a/node_modules/request/node_modules/http-signature/LICENSE b/node_modules/request/node_modules/http-signature/LICENSE
new file mode 100644
index 000000000..f6d947d2f
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/LICENSE
@@ -0,0 +1,18 @@
+Copyright Joyent, Inc. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
diff --git a/node_modules/request/node_modules/http-signature/README.md b/node_modules/request/node_modules/http-signature/README.md
new file mode 100644
index 000000000..de487d323
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/README.md
@@ -0,0 +1,79 @@
+# node-http-signature
+
+node-http-signature is a node.js library that has client and server components
+for Joyent's [HTTP Signature Scheme](http_signing.md).
+
+## Usage
+
+Note the example below signs a request with the same key/cert used to start an
+HTTP server. This is almost certainly not what you actually want, but is just
+used to illustrate the API calls; you will need to provide your own key
+management in addition to this library.
+
+### Client
+
+```js
+var fs = require('fs');
+var https = require('https');
+var httpSignature = require('http-signature');
+
+var key = fs.readFileSync('./key.pem', 'ascii');
+
+var options = {
+ host: 'localhost',
+ port: 8443,
+ path: '/',
+ method: 'GET',
+ headers: {}
+};
+
+// Adds a 'Date' header in, signs it, and adds the
+// 'Authorization' header in.
+var req = https.request(options, function(res) {
+ console.log(res.statusCode);
+});
+
+
+httpSignature.sign(req, {
+ key: key,
+ keyId: './cert.pem'
+});
+
+req.end();
+```
+
+### Server
+
+```js
+var fs = require('fs');
+var https = require('https');
+var httpSignature = require('http-signature');
+
+var options = {
+ key: fs.readFileSync('./key.pem'),
+ cert: fs.readFileSync('./cert.pem')
+};
+
+https.createServer(options, function (req, res) {
+ var rc = 200;
+ var parsed = httpSignature.parseRequest(req);
+ var pub = fs.readFileSync(parsed.keyId, 'ascii');
+ if (!httpSignature.verifySignature(parsed, pub))
+ rc = 401;
+
+ res.writeHead(rc);
+ res.end();
+}).listen(8443);
+```
+
+## Installation
+
+ npm install http-signature
+
+## License
+
+MIT.
+
+## Bugs
+
+See <https://github.com/joyent/node-http-signature/issues>.
diff --git a/node_modules/request/node_modules/http-signature/http_signing.md b/node_modules/request/node_modules/http-signature/http_signing.md
new file mode 100644
index 000000000..dd81ee5b5
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/http_signing.md
@@ -0,0 +1,296 @@
+# Abstract
+
+This document describes a way to add origin authentication, message integrity,
+and replay resistance to HTTP REST requests. It is intended to be used over
+the HTTPS protocol.
+
+# Copyright Notice
+
+Copyright (c) 2011 Joyent, Inc. and the persons identified as document authors.
+All rights reserved.
+
+Code Components extracted from this document must include MIT License text.
+
+# Introduction
+
+This protocol is intended to provide a standard way for clients to sign HTTP
+requests. RFC2617 (HTTP Authentication) defines Basic and Digest authentication
+mechanisms, and RFC5246 (TLS 1.2) defines client-auth, both of which are widely
+employed on the Internet today. However, it is common place that the burdens of
+PKI prevent web service operators from deploying that methodology, and so many
+fall back to Basic authentication, which has poor security characteristics.
+
+Additionally, OAuth provides a fully-specified alternative for authorization
+of web service requests, but is not (always) ideal for machine to machine
+communication, as the key acquisition steps (generally) imply a fixed
+infrastructure that may not make sense to a service provider (e.g., symmetric
+keys).
+
+Several web service providers have invented their own schemes for signing
+HTTP requests, but to date, none have been placed in the public domain as a
+standard. This document serves that purpose. There are no techniques in this
+proposal that are novel beyond previous art, however, this aims to be a simple
+mechanism for signing these requests.
+
+# Signature Authentication Scheme
+
+The "signature" authentication scheme is based on the model that the client must
+authenticate itself with a digital signature produced by either a private
+asymmetric key (e.g., RSA) or a shared symmetric key (e.g., HMAC). The scheme
+is parameterized enough such that it is not bound to any particular key type or
+signing algorithm. However, it does explicitly assume that clients can send an
+HTTP `Date` header.
+
+## Authorization Header
+
+The client is expected to send an Authorization header (as defined in RFC 2617)
+with the following parameterization:
+
+ credentials := "Signature" params
+ params := 1#(keyId | algorithm | [headers] | [ext] | signature)
+ digitalSignature := plain-string
+
+ keyId := "keyId" "=" <"> plain-string <">
+ algorithm := "algorithm" "=" <"> plain-string <">
+ headers := "headers" "=" <"> 1#headers-value <">
+ ext := "ext" "=" <"> plain-string <">
+ signature := "signature" "=" <"> plain-string <">
+
+ headers-value := plain-string
+ plain-string = 1*( %x20-21 / %x23-5B / %x5D-7E )
+
+### Signature Parameters
+
+#### keyId
+
+REQUIRED. The `keyId` field is an opaque string that the server can use to look
+up the component they need to validate the signature. It could be an SSH key
+fingerprint, an LDAP DN, etc. Management of keys and assignment of `keyId` is
+out of scope for this document.
+
+#### algorithm
+
+REQUIRED. The `algorithm` parameter is used if the client and server agree on a
+non-standard digital signature algorithm. The full list of supported signature
+mechanisms is listed below.
+
+#### headers
+
+OPTIONAL. The `headers` parameter is used to specify the list of HTTP headers
+used to sign the request. If specified, it should be a quoted list of HTTP
+header names, separated by a single space character. By default, only one
+HTTP header is signed, which is the `Date` header. Note that the list MUST be
+specified in the order the values are concatenated together during signing. To
+include the HTTP request line in the signature calculation, use the special
+`request-line` value. While this is overloading the definition of `headers` in
+HTTP linguism, the request-line is defined in RFC 2616, and as the outlier from
+headers in useful signature calculation, it is deemed simpler to simply use
+`request-line` than to add a separate parameter for it.
+
+#### extensions
+
+OPTIONAL. The `extensions` parameter is used to include additional information
+which is covered by the request. The content and format of the string is out of
+scope for this document, and expected to be specified by implementors.
+
+#### signature
+
+REQUIRED. The `signature` parameter is a `Base64` encoded digital signature
+generated by the client. The client uses the `algorithm` and `headers` request
+parameters to form a canonicalized `signing string`. This `signing string` is
+then signed with the key associated with `keyId` and the algorithm
+corresponding to `algorithm`. The `signature` parameter is then set to the
+`Base64` encoding of the signature.
+
+### Signing String Composition
+
+In order to generate the string that is signed with a key, the client MUST take
+the values of each HTTP header specified by `headers` in the order they appear.
+
+1. If the header name is not `request-line` then append the lowercased header
+ name followed with an ASCII colon `:` and an ASCII space ` `.
+2. If the header name is `request-line` then append the HTTP request line,
+ otherwise append the header value.
+3. If value is not the last value then append an ASCII newline `\n`. The string
+ MUST NOT include a trailing ASCII newline.
+
+# Example Requests
+
+All requests refer to the following request (body omitted):
+
+ POST /foo HTTP/1.1
+ Host: example.org
+ Date: Tue, 07 Jun 2011 20:51:35 GMT
+ Content-Type: application/json
+ Content-MD5: h0auK8hnYJKmHTLhKtMTkQ==
+ Content-Length: 123
+
+The "rsa-key-1" keyId refers to a private key known to the client and a public
+key known to the server. The "hmac-key-1" keyId refers to key known to the
+client and server.
+
+## Default parameterization
+
+The authorization header and signature would be generated as:
+
+ Authorization: Signature keyId="rsa-key-1",algorithm="rsa-sha256",signature="Base64(RSA-SHA256(signing string))"
+
+The client would compose the signing string as:
+
+ date: Tue, 07 Jun 2011 20:51:35 GMT
+
+## Header List
+
+The authorization header and signature would be generated as:
+
+ Authorization: Signature keyId="rsa-key-1",algorithm="rsa-sha256",headers="request-line date content-type content-md5",signature="Base64(RSA-SHA256(signing string))"
+
+The client would compose the signing string as (`+ "\n"` inserted for
+readability):
+
+ POST /foo HTTP/1.1 + "\n"
+ date: Tue, 07 Jun 2011 20:51:35 GMT + "\n"
+ content-type: application/json + "\n"
+ content-md5: h0auK8hnYJKmHTLhKtMTkQ==
+
+## Algorithm
+
+The authorization header and signature would be generated as:
+
+ Authorization: Signature keyId="hmac-key-1",algorithm="hmac-sha1",signature="Base64(HMAC-SHA1(signing string))"
+
+The client would compose the signing string as:
+
+ date: Tue, 07 Jun 2011 20:51:35 GMT
+
+# Signing Algorithms
+
+Currently supported algorithm names are:
+
+* rsa-sha1
+* rsa-sha256
+* rsa-sha512
+* dsa-sha1
+* hmac-sha1
+* hmac-sha256
+* hmac-sha512
+
+# Security Considerations
+
+## Default Parameters
+
+Note the default parameterization of the `Signature` scheme is only safe if all
+requests are carried over a secure transport (i.e., TLS). Sending the default
+scheme over a non-secure transport will leave the request vulnerable to
+spoofing, tampering, replay/repudiation, and integrity violations (if using the
+STRIDE threat-modeling methodology).
+
+## Insecure Transports
+
+If sending the request over plain HTTP, service providers SHOULD require clients
+to sign ALL HTTP headers, and the `request-line`. Additionally, service
+providers SHOULD require `Content-MD5` calculations to be performed to ensure
+against any tampering from clients.
+
+## Nonces
+
+Nonces are out of scope for this document simply because many service providers
+fail to implement them correctly, or do not adopt security specifications
+because of the infrastructure complexity. Given the `header` parameterization,
+a service provider is fully enabled to add nonce semantics into this scheme by
+using something like an `x-request-nonce` header, and ensuring it is signed
+with the `Date` header.
+
+## Clock Skew
+
+As the default scheme is to sign the `Date` header, service providers SHOULD
+protect against logged replay attacks by enforcing a clock skew. The server
+SHOULD be synchronized with NTP, and the recommendation in this specification
+is to allow 300s of clock skew (in either direction).
+
+## Required Headers to Sign
+
+It is out of scope for this document to dictate what headers a service provider
+will want to enforce, but service providers SHOULD at minimum include the
+`Date` header.
+
+# References
+
+## Normative References
+
+* [RFC2616] Hypertext Transfer Protocol -- HTTP/1.1
+* [RFC2617] HTTP Authentication: Basic and Digest Access Authentication
+* [RFC5246] The Transport Layer Security (TLS) Protocol Version 1.2
+
+## Informative References
+
+ Name: Mark Cavage (editor)
+ Company: Joyent, Inc.
+ Email: mark.cavage@joyent.com
+ URI: http://www.joyent.com
+
+# Appendix A - Test Values
+
+The following test data uses the RSA (2048b) keys, which we will refer
+to as `keyId=Test` in the following samples:
+
+ -----BEGIN PUBLIC KEY-----
+ MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCFENGw33yGihy92pDjZQhl0C3
+ 6rPJj+CvfSC8+q28hxA161QFNUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6
+ Z4UMR7EOcpfdUE9Hf3m/hs+FUR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJw
+ oYi+1hqp1fIekaxsyQIDAQAB
+ -----END PUBLIC KEY-----
+
+ -----BEGIN RSA PRIVATE KEY-----
+ MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF
+ NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F
+ UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB
+ AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA
+ QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK
+ kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg
+ f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u
+ 412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc
+ mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7
+ kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA
+ gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW
+ G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI
+ 7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA==
+ -----END RSA PRIVATE KEY-----
+
+And all examples use this request:
+
+ POST /foo?param=value&pet=dog HTTP/1.1
+ Host: example.com
+ Date: Thu, 05 Jan 2012 21:31:40 GMT
+ Content-Type: application/json
+ Content-MD5: Sd/dVLAcvNLSq16eXua5uQ==
+ Content-Length: 18
+
+ {"hello": "world"}
+
+### Default
+
+The string to sign would be:
+
+ date: Thu, 05 Jan 2012 21:31:40 GMT
+
+The Authorization header would be:
+
+ Authorization: Signature keyId="Test",algorithm="rsa-sha256",signature="ATp0r26dbMIxOopqw0OfABDT7CKMIoENumuruOtarj8n/97Q3htHFYpH8yOSQk3Z5zh8UxUym6FYTb5+A0Nz3NRsXJibnYi7brE/4tx5But9kkFGzG+xpUmimN4c3TMN7OFH//+r8hBf7BT9/GmHDUVZT2JzWGLZES2xDOUuMtA="
+
+### All Headers
+
+Parameterized to include all headers, the string to sign would be (`+ "\n"`
+inserted for readability):
+
+ POST /foo?param=value&pet=dog HTTP/1.1 + "\n"
+ host: example.com + "\n"
+ date: Thu, 05 Jan 2012 21:31:40 GMT + "\n"
+ content-type: application/json + "\n"
+ content-md5: Sd/dVLAcvNLSq16eXua5uQ== + "\n"
+ content-length: 18
+
+The Authorization header would be:
+
+ Authorization: Signature keyId="Test",algorithm="rsa-sha256",headers="request-line host date content-type content-md5 content-length",signature="H/AaTDkJvLELy4i1RujnKlS6dm8QWiJvEpn9cKRMi49kKF+mohZ15z1r+mF+XiKS5kOOscyS83olfBtsVhYjPg2Ei3/D9D4Mvb7bFm9IaLJgYTFFuQCghrKQQFPiqJN320emjHxFowpIm1BkstnEU7lktH/XdXVBo8a6Uteiztw="
+
diff --git a/node_modules/request/node_modules/http-signature/lib/index.js b/node_modules/request/node_modules/http-signature/lib/index.js
new file mode 100644
index 000000000..56a9967da
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/lib/index.js
@@ -0,0 +1,27 @@
+// Copyright 2015 Joyent, Inc.
+
+var parser = require('./parser');
+var signer = require('./signer');
+var verify = require('./verify');
+var util = require('./util');
+
+
+
+///--- API
+
+module.exports = {
+
+ parse: parser.parseRequest,
+ parseRequest: parser.parseRequest,
+
+ sign: signer.signRequest,
+ signRequest: signer.signRequest,
+
+ sshKeyToPEM: util.sshKeyToPEM,
+ sshKeyFingerprint: util.fingerprint,
+ pemToRsaSSHKey: util.pemToRsaSSHKey,
+
+ verify: verify.verifySignature,
+ verifySignature: verify.verifySignature,
+ verifyHMAC: verify.verifyHMAC
+};
diff --git a/node_modules/request/node_modules/http-signature/lib/parser.js b/node_modules/request/node_modules/http-signature/lib/parser.js
new file mode 100644
index 000000000..fd9ac1022
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/lib/parser.js
@@ -0,0 +1,304 @@
+// Copyright 2012 Joyent, Inc. All rights reserved.
+
+var assert = require('assert-plus');
+var util = require('util');
+
+
+
+///--- Globals
+
+var Algorithms = {
+ 'rsa-sha1': true,
+ 'rsa-sha256': true,
+ 'rsa-sha512': true,
+ 'dsa-sha1': true,
+ 'hmac-sha1': true,
+ 'hmac-sha256': true,
+ 'hmac-sha512': true
+};
+
+var State = {
+ New: 0,
+ Params: 1
+};
+
+var ParamsState = {
+ Name: 0,
+ Quote: 1,
+ Value: 2,
+ Comma: 3
+};
+
+
+
+///--- Specific Errors
+
+function HttpSignatureError(message, caller) {
+ if (Error.captureStackTrace)
+ Error.captureStackTrace(this, caller || HttpSignatureError);
+
+ this.message = message;
+ this.name = caller.name;
+}
+util.inherits(HttpSignatureError, Error);
+
+function ExpiredRequestError(message) {
+ HttpSignatureError.call(this, message, ExpiredRequestError);
+}
+util.inherits(ExpiredRequestError, HttpSignatureError);
+
+
+function InvalidHeaderError(message) {
+ HttpSignatureError.call(this, message, InvalidHeaderError);
+}
+util.inherits(InvalidHeaderError, HttpSignatureError);
+
+
+function InvalidParamsError(message) {
+ HttpSignatureError.call(this, message, InvalidParamsError);
+}
+util.inherits(InvalidParamsError, HttpSignatureError);
+
+
+function MissingHeaderError(message) {
+ HttpSignatureError.call(this, message, MissingHeaderError);
+}
+util.inherits(MissingHeaderError, HttpSignatureError);
+
+
+
+///--- Exported API
+
+module.exports = {
+
+ /**
+ * Parses the 'Authorization' header out of an http.ServerRequest object.
+ *
+ * Note that this API will fully validate the Authorization header, and throw
+ * on any error. It will not however check the signature, or the keyId format
+ * as those are specific to your environment. You can use the options object
+ * to pass in extra constraints.
+ *
+ * As a response object you can expect this:
+ *
+ * {
+ * "scheme": "Signature",
+ * "params": {
+ * "keyId": "foo",
+ * "algorithm": "rsa-sha256",
+ * "headers": [
+ * "date" or "x-date",
+ * "content-md5"
+ * ],
+ * "signature": "base64"
+ * },
+ * "signingString": "ready to be passed to crypto.verify()"
+ * }
+ *
+ * @param {Object} request an http.ServerRequest.
+ * @param {Object} options an optional options object with:
+ * - clockSkew: allowed clock skew in seconds (default 300).
+ * - headers: required header names (def: date or x-date)
+ * - algorithms: algorithms to support (default: all).
+ * @return {Object} parsed out object (see above).
+ * @throws {TypeError} on invalid input.
+ * @throws {InvalidHeaderError} on an invalid Authorization header error.
+ * @throws {InvalidParamsError} if the params in the scheme are invalid.
+ * @throws {MissingHeaderError} if the params indicate a header not present,
+ * either in the request headers from the params,
+ * or not in the params from a required header
+ * in options.
+ * @throws {ExpiredRequestError} if the value of date or x-date exceeds skew.
+ */
+ parseRequest: function parseRequest(request, options) {
+ assert.object(request, 'request');
+ assert.object(request.headers, 'request.headers');
+ if (options === undefined) {
+ options = {};
+ }
+ if (options.headers === undefined) {
+ options.headers = [request.headers['x-date'] ? 'x-date' : 'date'];
+ }
+ assert.object(options, 'options');
+ assert.arrayOfString(options.headers, 'options.headers');
+ assert.optionalNumber(options.clockSkew, 'options.clockSkew');
+
+ if (!request.headers.authorization)
+ throw new MissingHeaderError('no authorization header present in ' +
+ 'the request');
+
+ options.clockSkew = options.clockSkew || 300;
+
+
+ var i = 0;
+ var state = State.New;
+ var substate = ParamsState.Name;
+ var tmpName = '';
+ var tmpValue = '';
+
+ var parsed = {
+ scheme: '',
+ params: {},
+ signingString: '',
+
+ get algorithm() {
+ return this.params.algorithm.toUpperCase();
+ },
+
+ get keyId() {
+ return this.params.keyId;
+ }
+
+ };
+
+ var authz = request.headers.authorization;
+ for (i = 0; i < authz.length; i++) {
+ var c = authz.charAt(i);
+
+ switch (Number(state)) {
+
+ case State.New:
+ if (c !== ' ') parsed.scheme += c;
+ else state = State.Params;
+ break;
+
+ case State.Params:
+ switch (Number(substate)) {
+
+ case ParamsState.Name:
+ var code = c.charCodeAt(0);
+ // restricted name of A-Z / a-z
+ if ((code >= 0x41 && code <= 0x5a) || // A-Z
+ (code >= 0x61 && code <= 0x7a)) { // a-z
+ tmpName += c;
+ } else if (c === '=') {
+ if (tmpName.length === 0)
+ throw new InvalidHeaderError('bad param format');
+ substate = ParamsState.Quote;
+ } else {
+ throw new InvalidHeaderError('bad param format');
+ }
+ break;
+
+ case ParamsState.Quote:
+ if (c === '"') {
+ tmpValue = '';
+ substate = ParamsState.Value;
+ } else {
+ throw new InvalidHeaderError('bad param format');
+ }
+ break;
+
+ case ParamsState.Value:
+ if (c === '"') {
+ parsed.params[tmpName] = tmpValue;
+ substate = ParamsState.Comma;
+ } else {
+ tmpValue += c;
+ }
+ break;
+
+ case ParamsState.Comma:
+ if (c === ',') {
+ tmpName = '';
+ substate = ParamsState.Name;
+ } else {
+ throw new InvalidHeaderError('bad param format');
+ }
+ break;
+
+ default:
+ throw new Error('Invalid substate');
+ }
+ break;
+
+ default:
+ throw new Error('Invalid substate');
+ }
+
+ }
+
+ if (!parsed.params.headers || parsed.params.headers === '') {
+ if (request.headers['x-date']) {
+ parsed.params.headers = ['x-date'];
+ } else {
+ parsed.params.headers = ['date'];
+ }
+ } else {
+ parsed.params.headers = parsed.params.headers.split(' ');
+ }
+
+ // Minimally validate the parsed object
+ if (!parsed.scheme || parsed.scheme !== 'Signature')
+ throw new InvalidHeaderError('scheme was not "Signature"');
+
+ if (!parsed.params.keyId)
+ throw new InvalidHeaderError('keyId was not specified');
+
+ if (!parsed.params.algorithm)
+ throw new InvalidHeaderError('algorithm was not specified');
+
+ if (!parsed.params.signature)
+ throw new InvalidHeaderError('signature was not specified');
+
+ // Check the algorithm against the official list
+ parsed.params.algorithm = parsed.params.algorithm.toLowerCase();
+ if (!Algorithms[parsed.params.algorithm])
+ throw new InvalidParamsError(parsed.params.algorithm +
+ ' is not supported');
+
+ // Build the signingString
+ for (i = 0; i < parsed.params.headers.length; i++) {
+ var h = parsed.params.headers[i].toLowerCase();
+ parsed.params.headers[i] = h;
+
+ if (h !== 'request-line') {
+ var value = request.headers[h];
+ if (!value)
+ throw new MissingHeaderError(h + ' was not in the request');
+ parsed.signingString += h + ': ' + value;
+ } else {
+ parsed.signingString +=
+ request.method + ' ' + request.url + ' HTTP/' + request.httpVersion;
+ }
+
+ if ((i + 1) < parsed.params.headers.length)
+ parsed.signingString += '\n';
+ }
+
+ // Check against the constraints
+ var date;
+ if (request.headers.date || request.headers['x-date']) {
+ if (request.headers['x-date']) {
+ date = new Date(request.headers['x-date']);
+ } else {
+ date = new Date(request.headers.date);
+ }
+ var now = new Date();
+ var skew = Math.abs(now.getTime() - date.getTime());
+
+ if (skew > options.clockSkew * 1000) {
+ throw new ExpiredRequestError('clock skew of ' +
+ (skew / 1000) +
+ 's was greater than ' +
+ options.clockSkew + 's');
+ }
+ }
+
+ options.headers.forEach(function (hdr) {
+ // Remember that we already checked any headers in the params
+ // were in the request, so if this passes we're good.
+ if (parsed.params.headers.indexOf(hdr) < 0)
+ throw new MissingHeaderError(hdr + ' was not a signed header');
+ });
+
+ if (options.algorithms) {
+ if (options.algorithms.indexOf(parsed.params.algorithm) === -1)
+ throw new InvalidParamsError(parsed.params.algorithm +
+ ' is not a supported algorithm');
+ }
+
+ return parsed;
+ }
+
+};
diff --git a/node_modules/request/node_modules/http-signature/lib/signer.js b/node_modules/request/node_modules/http-signature/lib/signer.js
new file mode 100644
index 000000000..3507f4dbf
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/lib/signer.js
@@ -0,0 +1,178 @@
+// Copyright 2012 Joyent, Inc. All rights reserved.
+
+var assert = require('assert-plus');
+var crypto = require('crypto');
+var http = require('http');
+
+var sprintf = require('util').format;
+
+
+
+///--- Globals
+
+var Algorithms = {
+ 'rsa-sha1': true,
+ 'rsa-sha256': true,
+ 'rsa-sha512': true,
+ 'dsa-sha1': true,
+ 'hmac-sha1': true,
+ 'hmac-sha256': true,
+ 'hmac-sha512': true
+};
+
+var Authorization =
+ 'Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';
+
+
+
+///--- Specific Errors
+
+function MissingHeaderError(message) {
+ this.name = 'MissingHeaderError';
+ this.message = message;
+ this.stack = (new Error()).stack;
+}
+MissingHeaderError.prototype = new Error();
+
+
+function InvalidAlgorithmError(message) {
+ this.name = 'InvalidAlgorithmError';
+ this.message = message;
+ this.stack = (new Error()).stack;
+}
+InvalidAlgorithmError.prototype = new Error();
+
+
+
+///--- Internal Functions
+
+function _pad(val) {
+ if (parseInt(val, 10) < 10) {
+ val = '0' + val;
+ }
+ return val;
+}
+
+
+function _rfc1123() {
+ var date = new Date();
+
+ var months = ['Jan',
+ 'Feb',
+ 'Mar',
+ 'Apr',
+ 'May',
+ 'Jun',
+ 'Jul',
+ 'Aug',
+ 'Sep',
+ 'Oct',
+ 'Nov',
+ 'Dec'];
+ var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
+ return days[date.getUTCDay()] + ', ' +
+ _pad(date.getUTCDate()) + ' ' +
+ months[date.getUTCMonth()] + ' ' +
+ date.getUTCFullYear() + ' ' +
+ _pad(date.getUTCHours()) + ':' +
+ _pad(date.getUTCMinutes()) + ':' +
+ _pad(date.getUTCSeconds()) +
+ ' GMT';
+}
+
+
+
+///--- Exported API
+
+module.exports = {
+
+ /**
+ * Adds an 'Authorization' header to an http.ClientRequest object.
+ *
+ * Note that this API will add a Date header if it's not already set. Any
+ * other headers in the options.headers array MUST be present, or this
+ * will throw.
+ *
+ * You shouldn't need to check the return type; it's just there if you want
+ * to be pedantic.
+ *
+ * @param {Object} request an instance of http.ClientRequest.
+ * @param {Object} options signing parameters object:
+ * - {String} keyId required.
+ * - {String} key required (either a PEM or HMAC key).
+ * - {Array} headers optional; defaults to ['date'].
+ * - {String} algorithm optional; defaults to 'rsa-sha256'.
+ * - {String} httpVersion optional; defaults to '1.1'.
+ * @return {Boolean} true if Authorization (and optionally Date) were added.
+ * @throws {TypeError} on bad parameter types (input).
+ * @throws {InvalidAlgorithmError} if algorithm was bad.
+ * @throws {MissingHeaderError} if a header to be signed was specified but
+ * was not present.
+ */
+ signRequest: function signRequest(request, options) {
+ assert.object(request, 'request');
+ assert.object(options, 'options');
+ assert.optionalString(options.algorithm, 'options.algorithm');
+ assert.string(options.keyId, 'options.keyId');
+ assert.optionalArrayOfString(options.headers, 'options.headers');
+ assert.optionalString(options.httpVersion, 'options.httpVersion');
+
+ if (!request.getHeader('Date'))
+ request.setHeader('Date', _rfc1123());
+ if (!options.headers)
+ options.headers = ['date'];
+ if (!options.algorithm)
+ options.algorithm = 'rsa-sha256';
+ if (!options.httpVersion)
+ options.httpVersion = '1.1';
+
+ options.algorithm = options.algorithm.toLowerCase();
+
+ if (!Algorithms[options.algorithm])
+ throw new InvalidAlgorithmError(options.algorithm + ' is not supported');
+
+ var i;
+ var stringToSign = '';
+ for (i = 0; i < options.headers.length; i++) {
+ if (typeof (options.headers[i]) !== 'string')
+ throw new TypeError('options.headers must be an array of Strings');
+
+ var h = options.headers[i].toLowerCase();
+
+ if (h !== 'request-line') {
+ var value = request.getHeader(h);
+ if (!value) {
+ throw new MissingHeaderError(h + ' was not in the request');
+ }
+ stringToSign += h + ': ' + value;
+ } else {
+ stringToSign +=
+ request.method + ' ' + request.path + ' HTTP/' + options.httpVersion;
+ }
+
+ if ((i + 1) < options.headers.length)
+ stringToSign += '\n';
+ }
+
+ var alg = options.algorithm.match(/(hmac|rsa)-(\w+)/);
+ var signature;
+ if (alg[1] === 'hmac') {
+ var hmac = crypto.createHmac(alg[2].toUpperCase(), options.key);
+ hmac.update(stringToSign);
+ signature = hmac.digest('base64');
+ } else {
+ var signer = crypto.createSign(options.algorithm.toUpperCase());
+ signer.update(stringToSign);
+ signature = signer.sign(options.key, 'base64');
+ }
+
+ request.setHeader('Authorization', sprintf(Authorization,
+ options.keyId,
+ options.algorithm,
+ options.headers.join(' '),
+ signature));
+
+ return true;
+ }
+
+};
diff --git a/node_modules/request/node_modules/http-signature/lib/util.js b/node_modules/request/node_modules/http-signature/lib/util.js
new file mode 100644
index 000000000..2e1ce4d46
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/lib/util.js
@@ -0,0 +1,306 @@
+// Copyright 2012 Joyent, Inc. All rights reserved.
+
+var assert = require('assert-plus');
+var crypto = require('crypto');
+
+var asn1 = require('asn1');
+var ctype = require('ctype');
+
+
+
+///--- Helpers
+
+function readNext(buffer, offset) {
+ var len = ctype.ruint32(buffer, 'big', offset);
+ offset += 4;
+
+ var newOffset = offset + len;
+
+ return {
+ data: buffer.slice(offset, newOffset),
+ offset: newOffset
+ };
+}
+
+
+function writeInt(writer, buffer) {
+ writer.writeByte(0x02); // ASN1.Integer
+ writer.writeLength(buffer.length);
+
+ for (var i = 0; i < buffer.length; i++)
+ writer.writeByte(buffer[i]);
+
+ return writer;
+}
+
+
+function rsaToPEM(key) {
+ var buffer;
+ var der;
+ var exponent;
+ var i;
+ var modulus;
+ var newKey = '';
+ var offset = 0;
+ var type;
+ var tmp;
+
+ try {
+ buffer = new Buffer(key.split(' ')[1], 'base64');
+
+ tmp = readNext(buffer, offset);
+ type = tmp.data.toString();
+ offset = tmp.offset;
+
+ if (type !== 'ssh-rsa')
+ throw new Error('Invalid ssh key type: ' + type);
+
+ tmp = readNext(buffer, offset);
+ exponent = tmp.data;
+ offset = tmp.offset;
+
+ tmp = readNext(buffer, offset);
+ modulus = tmp.data;
+ } catch (e) {
+ throw new Error('Invalid ssh key: ' + key);
+ }
+
+ // DER is a subset of BER
+ der = new asn1.BerWriter();
+
+ der.startSequence();
+
+ der.startSequence();
+ der.writeOID('1.2.840.113549.1.1.1');
+ der.writeNull();
+ der.endSequence();
+
+ der.startSequence(0x03); // bit string
+ der.writeByte(0x00);
+
+ // Actual key
+ der.startSequence();
+ writeInt(der, modulus);
+ writeInt(der, exponent);
+ der.endSequence();
+
+ // bit string
+ der.endSequence();
+
+ der.endSequence();
+
+ tmp = der.buffer.toString('base64');
+ for (i = 0; i < tmp.length; i++) {
+ if ((i % 64) === 0)
+ newKey += '\n';
+ newKey += tmp.charAt(i);
+ }
+
+ if (!/\\n$/.test(newKey))
+ newKey += '\n';
+
+ return '-----BEGIN PUBLIC KEY-----' + newKey + '-----END PUBLIC KEY-----\n';
+}
+
+
+function dsaToPEM(key) {
+ var buffer;
+ var offset = 0;
+ var tmp;
+ var der;
+ var newKey = '';
+
+ var type;
+ var p;
+ var q;
+ var g;
+ var y;
+
+ try {
+ buffer = new Buffer(key.split(' ')[1], 'base64');
+
+ tmp = readNext(buffer, offset);
+ type = tmp.data.toString();
+ offset = tmp.offset;
+
+ /* JSSTYLED */
+ if (!/^ssh-ds[as].*/.test(type))
+ throw new Error('Invalid ssh key type: ' + type);
+
+ tmp = readNext(buffer, offset);
+ p = tmp.data;
+ offset = tmp.offset;
+
+ tmp = readNext(buffer, offset);
+ q = tmp.data;
+ offset = tmp.offset;
+
+ tmp = readNext(buffer, offset);
+ g = tmp.data;
+ offset = tmp.offset;
+
+ tmp = readNext(buffer, offset);
+ y = tmp.data;
+ } catch (e) {
+ console.log(e.stack);
+ throw new Error('Invalid ssh key: ' + key);
+ }
+
+ // DER is a subset of BER
+ der = new asn1.BerWriter();
+
+ der.startSequence();
+
+ der.startSequence();
+ der.writeOID('1.2.840.10040.4.1');
+
+ der.startSequence();
+ writeInt(der, p);
+ writeInt(der, q);
+ writeInt(der, g);
+ der.endSequence();
+
+ der.endSequence();
+
+ der.startSequence(0x03); // bit string
+ der.writeByte(0x00);
+ writeInt(der, y);
+ der.endSequence();
+
+ der.endSequence();
+
+ tmp = der.buffer.toString('base64');
+ for (var i = 0; i < tmp.length; i++) {
+ if ((i % 64) === 0)
+ newKey += '\n';
+ newKey += tmp.charAt(i);
+ }
+
+ if (!/\\n$/.test(newKey))
+ newKey += '\n';
+
+ return '-----BEGIN PUBLIC KEY-----' + newKey + '-----END PUBLIC KEY-----\n';
+}
+
+
+///--- API
+
+module.exports = {
+
+ /**
+ * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file.
+ *
+ * The intent of this module is to interoperate with OpenSSL only,
+ * specifically the node crypto module's `verify` method.
+ *
+ * @param {String} key an OpenSSH public key.
+ * @return {String} PEM encoded form of the RSA public key.
+ * @throws {TypeError} on bad input.
+ * @throws {Error} on invalid ssh key formatted data.
+ */
+ sshKeyToPEM: function sshKeyToPEM(key) {
+ assert.string(key, 'ssh_key');
+
+ /* JSSTYLED */
+ if (/^ssh-rsa.*/.test(key))
+ return rsaToPEM(key);
+
+ /* JSSTYLED */
+ if (/^ssh-ds[as].*/.test(key))
+ return dsaToPEM(key);
+
+ throw new Error('Only RSA and DSA public keys are allowed');
+ },
+
+
+ /**
+ * Generates an OpenSSH fingerprint from an ssh public key.
+ *
+ * @param {String} key an OpenSSH public key.
+ * @return {String} key fingerprint.
+ * @throws {TypeError} on bad input.
+ * @throws {Error} if what you passed doesn't look like an ssh public key.
+ */
+ fingerprint: function fingerprint(key) {
+ assert.string(key, 'ssh_key');
+
+ var pieces = key.split(' ');
+ if (!pieces || !pieces.length || pieces.length < 2)
+ throw new Error('invalid ssh key');
+
+ var data = new Buffer(pieces[1], 'base64');
+
+ var hash = crypto.createHash('md5');
+ hash.update(data);
+ var digest = hash.digest('hex');
+
+ var fp = '';
+ for (var i = 0; i < digest.length; i++) {
+ if (i && i % 2 === 0)
+ fp += ':';
+
+ fp += digest[i];
+ }
+
+ return fp;
+ },
+
+ /**
+ * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa)
+ *
+ * The reverse of the above function.
+ */
+ pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) {
+ assert.equal('string', typeof (pem), 'typeof pem');
+
+ // chop off the BEGIN PUBLIC KEY and END PUBLIC KEY portion
+ var cleaned = pem.split('\n').slice(1, -2).join('');
+
+ var buf = new Buffer(cleaned, 'base64');
+
+ var der = new asn1.BerReader(buf);
+
+ der.readSequence();
+ der.readSequence();
+
+ var oid = der.readOID();
+ assert.equal(oid, '1.2.840.113549.1.1.1', 'pem not in RSA format');
+
+ // Null -- XXX this probably isn't good practice
+ der.readByte();
+ der.readByte();
+
+ // bit string sequence
+ der.readSequence(0x03);
+ der.readByte();
+ der.readSequence();
+
+ // modulus
+ assert.equal(der.peek(), asn1.Ber.Integer, 'modulus not an integer');
+ der._offset = der.readLength(der.offset + 1);
+ var modulus = der._buf.slice(der.offset, der.offset + der.length);
+ der._offset += der.length;
+
+ // exponent
+ assert.equal(der.peek(), asn1.Ber.Integer, 'exponent not an integer');
+ der._offset = der.readLength(der.offset + 1);
+ var exponent = der._buf.slice(der.offset, der.offset + der.length);
+ der._offset += der.length;
+
+ // now, make the key
+ var type = new Buffer('ssh-rsa');
+ var buffer = new Buffer(4 + type.length + 4 + modulus.length +
+ 4 + exponent.length);
+ var i = 0;
+ buffer.writeUInt32BE(type.length, i); i += 4;
+ type.copy(buffer, i); i += type.length;
+ buffer.writeUInt32BE(exponent.length, i); i += 4;
+ exponent.copy(buffer, i); i += exponent.length;
+ buffer.writeUInt32BE(modulus.length, i); i += 4;
+ modulus.copy(buffer, i); i += modulus.length;
+
+ var s = (type.toString() + ' ' + buffer.toString('base64') + ' ' +
+ (comment || ''));
+ return s;
+ }
+};
diff --git a/node_modules/request/node_modules/http-signature/lib/verify.js b/node_modules/request/node_modules/http-signature/lib/verify.js
new file mode 100644
index 000000000..f6ad0c2b1
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/lib/verify.js
@@ -0,0 +1,56 @@
+// Copyright 2015 Joyent, Inc.
+
+var assert = require('assert-plus');
+var crypto = require('crypto');
+
+
+
+///--- Exported API
+
+module.exports = {
+ /**
+ * Verify RSA/DSA signature against public key. You are expected to pass in
+ * an object that was returned from `parse()`.
+ *
+ * @param {Object} parsedSignature the object you got from `parse`.
+ * @param {String} pubkey RSA/DSA private key PEM.
+ * @return {Boolean} true if valid, false otherwise.
+ * @throws {TypeError} if you pass in bad arguments.
+ */
+ verifySignature: function verifySignature(parsedSignature, pubkey) {
+ assert.object(parsedSignature, 'parsedSignature');
+ assert.string(pubkey, 'pubkey');
+
+ var alg = parsedSignature.algorithm.match(/^(RSA|DSA)-(\w+)/);
+ if (!alg || alg.length !== 3)
+ throw new TypeError('parsedSignature: unsupported algorithm ' +
+ parsedSignature.algorithm);
+
+ var verify = crypto.createVerify(alg[0]);
+ verify.update(parsedSignature.signingString);
+ return verify.verify(pubkey, parsedSignature.params.signature, 'base64');
+ },
+
+ /**
+ * Verify HMAC against shared secret. You are expected to pass in an object
+ * that was returned from `parse()`.
+ *
+ * @param {Object} parsedSignature the object you got from `parse`.
+ * @param {String} secret HMAC shared secret.
+ * @return {Boolean} true if valid, false otherwise.
+ * @throws {TypeError} if you pass in bad arguments.
+ */
+ verifyHMAC: function verifyHMAC(parsedSignature, secret) {
+ assert.object(parsedSignature, 'parsedHMAC');
+ assert.string(secret, 'secret');
+
+ var alg = parsedSignature.algorithm.match(/^HMAC-(\w+)/);
+ if (!alg || alg.length !== 2)
+ throw new TypeError('parsedSignature: unsupported algorithm ' +
+ parsedSignature.algorithm);
+
+ var hmac = crypto.createHmac(alg[1].toUpperCase(), secret);
+ hmac.update(parsedSignature.signingString);
+ return (hmac.digest('base64') === parsedSignature.params.signature);
+ }
+};
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore b/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore
new file mode 100644
index 000000000..eb03e3e1e
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore
@@ -0,0 +1,2 @@
+node_modules
+*.log
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE b/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE
new file mode 100644
index 000000000..9b5dcdb7f
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Mark Cavage, All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md b/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md
new file mode 100644
index 000000000..7cebf7a2e
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md
@@ -0,0 +1,50 @@
+node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS.
+Currently BER encoding is supported; at some point I'll likely have to do DER.
+
+## Usage
+
+Mostly, if you're *actually* needing to read and write ASN.1, you probably don't
+need this readme to explain what and why. If you have no idea what ASN.1 is,
+see this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc
+
+The source is pretty much self-explanatory, and has read/write methods for the
+common types out there.
+
+### Decoding
+
+The following reads an ASN.1 sequence with a boolean.
+
+ var Ber = require('asn1').Ber;
+
+ var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));
+
+ reader.readSequence();
+ console.log('Sequence len: ' + reader.length);
+ if (reader.peek() === Ber.Boolean)
+ console.log(reader.readBoolean());
+
+### Encoding
+
+The following generates the same payload as above.
+
+ var Ber = require('asn1').Ber;
+
+ var writer = new Ber.Writer();
+
+ writer.startSequence();
+ writer.writeBoolean(true);
+ writer.endSequence();
+
+ console.log(writer.buffer);
+
+## Installation
+
+ npm install asn1
+
+## License
+
+MIT.
+
+## Bugs
+
+See <https://github.com/mcavage/node-asn1/issues>.
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js
new file mode 100644
index 000000000..ff21d4fab
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js
@@ -0,0 +1,13 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+
+module.exports = {
+
+ newInvalidAsn1Error: function(msg) {
+ var e = new Error();
+ e.name = 'InvalidAsn1Error';
+ e.message = msg || '';
+ return e;
+ }
+
+};
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js
new file mode 100644
index 000000000..4fb90aea9
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js
@@ -0,0 +1,27 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+var errors = require('./errors');
+var types = require('./types');
+
+var Reader = require('./reader');
+var Writer = require('./writer');
+
+
+///--- Exports
+
+module.exports = {
+
+ Reader: Reader,
+
+ Writer: Writer
+
+};
+
+for (var t in types) {
+ if (types.hasOwnProperty(t))
+ module.exports[t] = types[t];
+}
+for (var e in errors) {
+ if (errors.hasOwnProperty(e))
+ module.exports[e] = errors[e];
+}
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js
new file mode 100644
index 000000000..bd3357a67
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js
@@ -0,0 +1,267 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+var assert = require('assert');
+
+var ASN1 = require('./types');
+var errors = require('./errors');
+
+
+///--- Globals
+
+var newInvalidAsn1Error = errors.newInvalidAsn1Error;
+
+
+
+///--- API
+
+function Reader(data) {
+ if (!data || !Buffer.isBuffer(data))
+ throw new TypeError('data must be a node Buffer');
+
+ this._buf = data;
+ this._size = data.length;
+
+ // These hold the "current" state
+ this._len = 0;
+ this._offset = 0;
+
+ var self = this;
+ this.__defineGetter__('length', function() { return self._len; });
+ this.__defineGetter__('offset', function() { return self._offset; });
+ this.__defineGetter__('remain', function() {
+ return self._size - self._offset;
+ });
+ this.__defineGetter__('buffer', function() {
+ return self._buf.slice(self._offset);
+ });
+}
+
+
+/**
+ * Reads a single byte and advances offset; you can pass in `true` to make this
+ * a "peek" operation (i.e., get the byte, but don't advance the offset).
+ *
+ * @param {Boolean} peek true means don't move offset.
+ * @return {Number} the next byte, null if not enough data.
+ */
+Reader.prototype.readByte = function(peek) {
+ if (this._size - this._offset < 1)
+ return null;
+
+ var b = this._buf[this._offset] & 0xff;
+
+ if (!peek)
+ this._offset += 1;
+
+ return b;
+};
+
+
+Reader.prototype.peek = function() {
+ return this.readByte(true);
+};
+
+
+/**
+ * Reads a (potentially) variable length off the BER buffer. This call is
+ * not really meant to be called directly, as callers have to manipulate
+ * the internal buffer afterwards.
+ *
+ * As a result of this call, you can call `Reader.length`, until the
+ * next thing called that does a readLength.
+ *
+ * @return {Number} the amount of offset to advance the buffer.
+ * @throws {InvalidAsn1Error} on bad ASN.1
+ */
+Reader.prototype.readLength = function(offset) {
+ if (offset === undefined)
+ offset = this._offset;
+
+ if (offset >= this._size)
+ return null;
+
+ var lenB = this._buf[offset++] & 0xff;
+ if (lenB === null)
+ return null;
+
+ if ((lenB & 0x80) == 0x80) {
+ lenB &= 0x7f;
+
+ if (lenB == 0)
+ throw newInvalidAsn1Error('Indefinite length not supported');
+
+ if (lenB > 4)
+ throw newInvalidAsn1Error('encoding too long');
+
+ if (this._size - offset < lenB)
+ return null;
+
+ this._len = 0;
+ for (var i = 0; i < lenB; i++)
+ this._len = (this._len << 8) + (this._buf[offset++] & 0xff);
+
+ } else {
+ // Wasn't a variable length
+ this._len = lenB;
+ }
+
+ return offset;
+};
+
+
+/**
+ * Parses the next sequence in this BER buffer.
+ *
+ * To get the length of the sequence, call `Reader.length`.
+ *
+ * @return {Number} the sequence's tag.
+ */
+Reader.prototype.readSequence = function(tag) {
+ var seq = this.peek();
+ if (seq === null)
+ return null;
+ if (tag !== undefined && tag !== seq)
+ throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
+ ': got 0x' + seq.toString(16));
+
+ var o = this.readLength(this._offset + 1); // stored in `length`
+ if (o === null)
+ return null;
+
+ this._offset = o;
+ return seq;
+};
+
+
+Reader.prototype.readInt = function() {
+ return this._readTag(ASN1.Integer);
+};
+
+
+Reader.prototype.readBoolean = function() {
+ return (this._readTag(ASN1.Boolean) === 0 ? false : true);
+};
+
+
+Reader.prototype.readEnumeration = function() {
+ return this._readTag(ASN1.Enumeration);
+};
+
+
+Reader.prototype.readString = function(tag, retbuf) {
+ if (!tag)
+ tag = ASN1.OctetString;
+
+ var b = this.peek();
+ if (b === null)
+ return null;
+
+ if (b !== tag)
+ throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
+ ': got 0x' + b.toString(16));
+
+ var o = this.readLength(this._offset + 1); // stored in `length`
+
+ if (o === null)
+ return null;
+
+ if (this.length > this._size - o)
+ return null;
+
+ this._offset = o;
+
+ if (this.length === 0)
+ return '';
+
+ var str = this._buf.slice(this._offset, this._offset + this.length);
+ this._offset += this.length;
+
+ return retbuf ? str : str.toString('utf8');
+};
+
+Reader.prototype.readOID = function(tag) {
+ if (!tag)
+ tag = ASN1.OID;
+
+ var b = this.peek();
+ if (b === null)
+ return null;
+
+ if (b !== tag)
+ throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
+ ': got 0x' + b.toString(16));
+
+ var o = this.readLength(this._offset + 1); // stored in `length`
+ if (o === null)
+ return null;
+
+ if (this.length > this._size - o)
+ return null;
+
+ this._offset = o;
+
+ var values = [];
+ var value = 0;
+
+ for (var i = 0; i < this.length; i++) {
+ var byte = this._buf[this._offset++] & 0xff;
+
+ value <<= 7;
+ value += byte & 0x7f;
+ if ((byte & 0x80) == 0) {
+ values.push(value);
+ value = 0;
+ }
+ }
+
+ value = values.shift();
+ values.unshift(value % 40);
+ values.unshift((value / 40) >> 0);
+
+ return values.join('.');
+};
+
+
+Reader.prototype._readTag = function(tag) {
+ assert.ok(tag !== undefined);
+
+ var b = this.peek();
+
+ if (b === null)
+ return null;
+
+ if (b !== tag)
+ throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
+ ': got 0x' + b.toString(16));
+
+ var o = this.readLength(this._offset + 1); // stored in `length`
+ if (o === null)
+ return null;
+
+ if (this.length > 4)
+ throw newInvalidAsn1Error('Integer too long: ' + this.length);
+
+ if (this.length > this._size - o)
+ return null;
+ this._offset = o;
+
+ var fb = this._buf[this._offset++];
+ var value = 0;
+
+ value = fb & 0x7F;
+ for (var i = 1; i < this.length; i++) {
+ value <<= 8;
+ value |= (this._buf[this._offset++] & 0xff);
+ }
+
+ if ((fb & 0x80) == 0x80)
+ value = -value;
+
+ return value;
+};
+
+
+
+///--- Exported API
+
+module.exports = Reader;
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js
new file mode 100644
index 000000000..8aea00013
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js
@@ -0,0 +1,36 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+
+module.exports = {
+ EOC: 0,
+ Boolean: 1,
+ Integer: 2,
+ BitString: 3,
+ OctetString: 4,
+ Null: 5,
+ OID: 6,
+ ObjectDescriptor: 7,
+ External: 8,
+ Real: 9, // float
+ Enumeration: 10,
+ PDV: 11,
+ Utf8String: 12,
+ RelativeOID: 13,
+ Sequence: 16,
+ Set: 17,
+ NumericString: 18,
+ PrintableString: 19,
+ T61String: 20,
+ VideotexString: 21,
+ IA5String: 22,
+ UTCTime: 23,
+ GeneralizedTime: 24,
+ GraphicString: 25,
+ VisibleString: 26,
+ GeneralString: 28,
+ UniversalString: 29,
+ CharacterString: 30,
+ BMPString: 31,
+ Constructor: 32,
+ Context: 128
+};
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js
new file mode 100644
index 000000000..7b445cc60
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js
@@ -0,0 +1,317 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+var assert = require('assert');
+var ASN1 = require('./types');
+var errors = require('./errors');
+
+
+///--- Globals
+
+var newInvalidAsn1Error = errors.newInvalidAsn1Error;
+
+var DEFAULT_OPTS = {
+ size: 1024,
+ growthFactor: 8
+};
+
+
+///--- Helpers
+
+function merge(from, to) {
+ assert.ok(from);
+ assert.equal(typeof(from), 'object');
+ assert.ok(to);
+ assert.equal(typeof(to), 'object');
+
+ var keys = Object.getOwnPropertyNames(from);
+ keys.forEach(function(key) {
+ if (to[key])
+ return;
+
+ var value = Object.getOwnPropertyDescriptor(from, key);
+ Object.defineProperty(to, key, value);
+ });
+
+ return to;
+}
+
+
+
+///--- API
+
+function Writer(options) {
+ options = merge(DEFAULT_OPTS, options || {});
+
+ this._buf = new Buffer(options.size || 1024);
+ this._size = this._buf.length;
+ this._offset = 0;
+ this._options = options;
+
+ // A list of offsets in the buffer where we need to insert
+ // sequence tag/len pairs.
+ this._seq = [];
+
+ var self = this;
+ this.__defineGetter__('buffer', function() {
+ if (self._seq.length)
+ throw new InvalidAsn1Error(self._seq.length + ' unended sequence(s)');
+
+ return self._buf.slice(0, self._offset);
+ });
+}
+
+
+Writer.prototype.writeByte = function(b) {
+ if (typeof(b) !== 'number')
+ throw new TypeError('argument must be a Number');
+
+ this._ensure(1);
+ this._buf[this._offset++] = b;
+};
+
+
+Writer.prototype.writeInt = function(i, tag) {
+ if (typeof(i) !== 'number')
+ throw new TypeError('argument must be a Number');
+ if (typeof(tag) !== 'number')
+ tag = ASN1.Integer;
+
+ var sz = 4;
+
+ while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000)) &&
+ (sz > 1)) {
+ sz--;
+ i <<= 8;
+ }
+
+ if (sz > 4)
+ throw new InvalidAsn1Error('BER ints cannot be > 0xffffffff');
+
+ this._ensure(2 + sz);
+ this._buf[this._offset++] = tag;
+ this._buf[this._offset++] = sz;
+
+ while (sz-- > 0) {
+ this._buf[this._offset++] = ((i & 0xff000000) >> 24);
+ i <<= 8;
+ }
+
+};
+
+
+Writer.prototype.writeNull = function() {
+ this.writeByte(ASN1.Null);
+ this.writeByte(0x00);
+};
+
+
+Writer.prototype.writeEnumeration = function(i, tag) {
+ if (typeof(i) !== 'number')
+ throw new TypeError('argument must be a Number');
+ if (typeof(tag) !== 'number')
+ tag = ASN1.Enumeration;
+
+ return this.writeInt(i, tag);
+};
+
+
+Writer.prototype.writeBoolean = function(b, tag) {
+ if (typeof(b) !== 'boolean')
+ throw new TypeError('argument must be a Boolean');
+ if (typeof(tag) !== 'number')
+ tag = ASN1.Boolean;
+
+ this._ensure(3);
+ this._buf[this._offset++] = tag;
+ this._buf[this._offset++] = 0x01;
+ this._buf[this._offset++] = b ? 0xff : 0x00;
+};
+
+
+Writer.prototype.writeString = function(s, tag) {
+ if (typeof(s) !== 'string')
+ throw new TypeError('argument must be a string (was: ' + typeof(s) + ')');
+ if (typeof(tag) !== 'number')
+ tag = ASN1.OctetString;
+
+ var len = Buffer.byteLength(s);
+ this.writeByte(tag);
+ this.writeLength(len);
+ if (len) {
+ this._ensure(len);
+ this._buf.write(s, this._offset);
+ this._offset += len;
+ }
+};
+
+
+Writer.prototype.writeBuffer = function(buf, tag) {
+ if (typeof(tag) !== 'number')
+ throw new TypeError('tag must be a number');
+ if (!Buffer.isBuffer(buf))
+ throw new TypeError('argument must be a buffer');
+
+ this.writeByte(tag);
+ this.writeLength(buf.length);
+ this._ensure(buf.length);
+ buf.copy(this._buf, this._offset, 0, buf.length);
+ this._offset += buf.length;
+};
+
+
+Writer.prototype.writeStringArray = function(strings) {
+ if ((!strings instanceof Array))
+ throw new TypeError('argument must be an Array[String]');
+
+ var self = this;
+ strings.forEach(function(s) {
+ self.writeString(s);
+ });
+};
+
+// This is really to solve DER cases, but whatever for now
+Writer.prototype.writeOID = function(s, tag) {
+ if (typeof(s) !== 'string')
+ throw new TypeError('argument must be a string');
+ if (typeof(tag) !== 'number')
+ tag = ASN1.OID;
+
+ if (!/^([0-9]+\.){3,}[0-9]+$/.test(s))
+ throw new Error('argument is not a valid OID string');
+
+ function encodeOctet(bytes, octet) {
+ if (octet < 128) {
+ bytes.push(octet);
+ } else if (octet < 16384) {
+ bytes.push((octet >>> 7) | 0x80);
+ bytes.push(octet & 0x7F);
+ } else if (octet < 2097152) {
+ bytes.push((octet >>> 14) | 0x80);
+ bytes.push(((octet >>> 7) | 0x80) & 0xFF);
+ bytes.push(octet & 0x7F);
+ } else if (octet < 268435456) {
+ bytes.push((octet >>> 21) | 0x80);
+ bytes.push(((octet >>> 14) | 0x80) & 0xFF);
+ bytes.push(((octet >>> 7) | 0x80) & 0xFF);
+ bytes.push(octet & 0x7F);
+ } else {
+ bytes.push(((octet >>> 28) | 0x80) & 0xFF);
+ bytes.push(((octet >>> 21) | 0x80) & 0xFF);
+ bytes.push(((octet >>> 14) | 0x80) & 0xFF);
+ bytes.push(((octet >>> 7) | 0x80) & 0xFF);
+ bytes.push(octet & 0x7F);
+ }
+ }
+
+ var tmp = s.split('.');
+ var bytes = [];
+ bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10));
+ tmp.slice(2).forEach(function(b) {
+ encodeOctet(bytes, parseInt(b, 10));
+ });
+
+ var self = this;
+ this._ensure(2 + bytes.length);
+ this.writeByte(tag);
+ this.writeLength(bytes.length);
+ bytes.forEach(function(b) {
+ self.writeByte(b);
+ });
+};
+
+
+Writer.prototype.writeLength = function(len) {
+ if (typeof(len) !== 'number')
+ throw new TypeError('argument must be a Number');
+
+ this._ensure(4);
+
+ if (len <= 0x7f) {
+ this._buf[this._offset++] = len;
+ } else if (len <= 0xff) {
+ this._buf[this._offset++] = 0x81;
+ this._buf[this._offset++] = len;
+ } else if (len <= 0xffff) {
+ this._buf[this._offset++] = 0x82;
+ this._buf[this._offset++] = len >> 8;
+ this._buf[this._offset++] = len;
+ } else if (len <= 0xffffff) {
+ this._shift(start, len, 1);
+ this._buf[this._offset++] = 0x83;
+ this._buf[this._offset++] = len >> 16;
+ this._buf[this._offset++] = len >> 8;
+ this._buf[this._offset++] = len;
+ } else {
+ throw new InvalidAsn1ERror('Length too long (> 4 bytes)');
+ }
+};
+
+Writer.prototype.startSequence = function(tag) {
+ if (typeof(tag) !== 'number')
+ tag = ASN1.Sequence | ASN1.Constructor;
+
+ this.writeByte(tag);
+ this._seq.push(this._offset);
+ this._ensure(3);
+ this._offset += 3;
+};
+
+
+Writer.prototype.endSequence = function() {
+ var seq = this._seq.pop();
+ var start = seq + 3;
+ var len = this._offset - start;
+
+ if (len <= 0x7f) {
+ this._shift(start, len, -2);
+ this._buf[seq] = len;
+ } else if (len <= 0xff) {
+ this._shift(start, len, -1);
+ this._buf[seq] = 0x81;
+ this._buf[seq + 1] = len;
+ } else if (len <= 0xffff) {
+ this._buf[seq] = 0x82;
+ this._buf[seq + 1] = len >> 8;
+ this._buf[seq + 2] = len;
+ } else if (len <= 0xffffff) {
+ this._shift(start, len, 1);
+ this._buf[seq] = 0x83;
+ this._buf[seq + 1] = len >> 16;
+ this._buf[seq + 2] = len >> 8;
+ this._buf[seq + 3] = len;
+ } else {
+ throw new InvalidAsn1Error('Sequence too long');
+ }
+};
+
+
+Writer.prototype._shift = function(start, len, shift) {
+ assert.ok(start !== undefined);
+ assert.ok(len !== undefined);
+ assert.ok(shift);
+
+ this._buf.copy(this._buf, start + shift, start, start + len);
+ this._offset += shift;
+};
+
+Writer.prototype._ensure = function(len) {
+ assert.ok(len);
+
+ if (this._size - this._offset < len) {
+ var sz = this._size * this._options.growthFactor;
+ if (sz - this._offset < len)
+ sz += len;
+
+ var buf = new Buffer(sz);
+
+ this._buf.copy(buf, 0, 0, this._offset);
+ this._buf = buf;
+ this._size = sz;
+ }
+};
+
+
+
+///--- Exported API
+
+module.exports = Writer;
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js
new file mode 100644
index 000000000..d1766e7a6
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js
@@ -0,0 +1,20 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+// If you have no idea what ASN.1 or BER is, see this:
+// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc
+
+var Ber = require('./ber/index');
+
+
+
+///--- Exported API
+
+module.exports = {
+
+ Ber: Ber,
+
+ BerReader: Ber.Reader,
+
+ BerWriter: Ber.Writer
+
+};
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json b/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json
new file mode 100644
index 000000000..034c2b48f
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json
@@ -0,0 +1,45 @@
+{
+ "author": {
+ "name": "Mark Cavage",
+ "email": "mcavage@gmail.com"
+ },
+ "contributors": [
+ {
+ "name": "David Gwynne",
+ "email": "loki@animata.net"
+ },
+ {
+ "name": "Yunong Xiao",
+ "email": "yunong@joyent.com"
+ }
+ ],
+ "name": "asn1",
+ "description": "Contains parsers and serializers for ASN.1 (currently BER only)",
+ "version": "0.1.11",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/mcavage/node-asn1.git"
+ },
+ "main": "lib/index.js",
+ "engines": {
+ "node": ">=0.4.9"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "tap": "0.1.4"
+ },
+ "scripts": {
+ "pretest": "which gjslint; if [[ \"$?\" = 0 ]] ; then gjslint --nojsdoc -r lib -r tst; else echo \"Missing gjslint. Skipping lint\"; fi",
+ "test": "tap ./tst"
+ },
+ "readme": "node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS.\nCurrently BER encoding is supported; at some point I'll likely have to do DER.\n\n## Usage\n\nMostly, if you're *actually* needing to read and write ASN.1, you probably don't\nneed this readme to explain what and why. If you have no idea what ASN.1 is,\nsee this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc\n\nThe source is pretty much self-explanatory, and has read/write methods for the\ncommon types out there.\n\n### Decoding\n\nThe following reads an ASN.1 sequence with a boolean.\n\n var Ber = require('asn1').Ber;\n\n var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));\n\n reader.readSequence();\n console.log('Sequence len: ' + reader.length);\n if (reader.peek() === Ber.Boolean)\n console.log(reader.readBoolean());\n\n### Encoding\n\nThe following generates the same payload as above.\n\n var Ber = require('asn1').Ber;\n\n var writer = new Ber.Writer();\n\n writer.startSequence();\n writer.writeBoolean(true);\n writer.endSequence();\n\n console.log(writer.buffer);\n\n## Installation\n\n npm install asn1\n\n## License\n\nMIT.\n\n## Bugs\n\nSee <https://github.com/mcavage/node-asn1/issues>.\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/mcavage/node-asn1/issues"
+ },
+ "homepage": "https://github.com/mcavage/node-asn1#readme",
+ "_id": "asn1@0.1.11",
+ "_shasum": "559be18376d08a4ec4dbe80877d27818639b2df7",
+ "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz",
+ "_from": "asn1@0.1.11"
+}
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js
new file mode 100644
index 000000000..0b78b474f
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js
@@ -0,0 +1,172 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+var test = require('tap').test;
+
+
+
+///--- Globals
+
+var BerReader;
+
+
+
+///--- Tests
+
+test('load library', function(t) {
+ BerReader = require('../../lib/index').BerReader;
+ t.ok(BerReader);
+ try {
+ new BerReader();
+ t.fail('Should have thrown');
+ } catch (e) {
+ t.ok(e instanceof TypeError, 'Should have been a type error');
+ }
+ t.end();
+});
+
+
+test('read byte', function(t) {
+ var reader = new BerReader(new Buffer([0xde]));
+ t.ok(reader);
+ t.equal(reader.readByte(), 0xde, 'wrong value');
+ t.end();
+});
+
+
+test('read 1 byte int', function(t) {
+ var reader = new BerReader(new Buffer([0x02, 0x01, 0x03]));
+ t.ok(reader);
+ t.equal(reader.readInt(), 0x03, 'wrong value');
+ t.equal(reader.length, 0x01, 'wrong length');
+ t.end();
+});
+
+
+test('read 2 byte int', function(t) {
+ var reader = new BerReader(new Buffer([0x02, 0x02, 0x7e, 0xde]));
+ t.ok(reader);
+ t.equal(reader.readInt(), 0x7ede, 'wrong value');
+ t.equal(reader.length, 0x02, 'wrong length');
+ t.end();
+});
+
+
+test('read 3 byte int', function(t) {
+ var reader = new BerReader(new Buffer([0x02, 0x03, 0x7e, 0xde, 0x03]));
+ t.ok(reader);
+ t.equal(reader.readInt(), 0x7ede03, 'wrong value');
+ t.equal(reader.length, 0x03, 'wrong length');
+ t.end();
+});
+
+
+test('read 4 byte int', function(t) {
+ var reader = new BerReader(new Buffer([0x02, 0x04, 0x7e, 0xde, 0x03, 0x01]));
+ t.ok(reader);
+ t.equal(reader.readInt(), 0x7ede0301, 'wrong value');
+ t.equal(reader.length, 0x04, 'wrong length');
+ t.end();
+});
+
+
+test('read boolean true', function(t) {
+ var reader = new BerReader(new Buffer([0x01, 0x01, 0xff]));
+ t.ok(reader);
+ t.equal(reader.readBoolean(), true, 'wrong value');
+ t.equal(reader.length, 0x01, 'wrong length');
+ t.end();
+});
+
+
+test('read boolean false', function(t) {
+ var reader = new BerReader(new Buffer([0x01, 0x01, 0x00]));
+ t.ok(reader);
+ t.equal(reader.readBoolean(), false, 'wrong value');
+ t.equal(reader.length, 0x01, 'wrong length');
+ t.end();
+});
+
+
+test('read enumeration', function(t) {
+ var reader = new BerReader(new Buffer([0x0a, 0x01, 0x20]));
+ t.ok(reader);
+ t.equal(reader.readEnumeration(), 0x20, 'wrong value');
+ t.equal(reader.length, 0x01, 'wrong length');
+ t.end();
+});
+
+
+test('read string', function(t) {
+ var dn = 'cn=foo,ou=unit,o=test';
+ var buf = new Buffer(dn.length + 2);
+ buf[0] = 0x04;
+ buf[1] = Buffer.byteLength(dn);
+ buf.write(dn, 2);
+ var reader = new BerReader(buf);
+ t.ok(reader);
+ t.equal(reader.readString(), dn, 'wrong value');
+ t.equal(reader.length, dn.length, 'wrong length');
+ t.end();
+});
+
+
+test('read sequence', function(t) {
+ var reader = new BerReader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));
+ t.ok(reader);
+ t.equal(reader.readSequence(), 0x30, 'wrong value');
+ t.equal(reader.length, 0x03, 'wrong length');
+ t.equal(reader.readBoolean(), true, 'wrong value');
+ t.equal(reader.length, 0x01, 'wrong length');
+ t.end();
+});
+
+
+test('anonymous LDAPv3 bind', function(t) {
+ var BIND = new Buffer(14);
+ BIND[0] = 0x30; // Sequence
+ BIND[1] = 12; // len
+ BIND[2] = 0x02; // ASN.1 Integer
+ BIND[3] = 1; // len
+ BIND[4] = 0x04; // msgid (make up 4)
+ BIND[5] = 0x60; // Bind Request
+ BIND[6] = 7; // len
+ BIND[7] = 0x02; // ASN.1 Integer
+ BIND[8] = 1; // len
+ BIND[9] = 0x03; // v3
+ BIND[10] = 0x04; // String (bind dn)
+ BIND[11] = 0; // len
+ BIND[12] = 0x80; // ContextSpecific (choice)
+ BIND[13] = 0; // simple bind
+
+ // Start testing ^^
+ var ber = new BerReader(BIND);
+ t.equal(ber.readSequence(), 48, 'Not an ASN.1 Sequence');
+ t.equal(ber.length, 12, 'Message length should be 12');
+ t.equal(ber.readInt(), 4, 'Message id should have been 4');
+ t.equal(ber.readSequence(), 96, 'Bind Request should have been 96');
+ t.equal(ber.length, 7, 'Bind length should have been 7');
+ t.equal(ber.readInt(), 3, 'LDAP version should have been 3');
+ t.equal(ber.readString(), '', 'Bind DN should have been empty');
+ t.equal(ber.length, 0, 'string length should have been 0');
+ t.equal(ber.readByte(), 0x80, 'Should have been ContextSpecific (choice)');
+ t.equal(ber.readByte(), 0, 'Should have been simple bind');
+ t.equal(null, ber.readByte(), 'Should be out of data');
+ t.end();
+});
+
+
+test('long string', function(t) {
+ var buf = new Buffer(256);
+ var o;
+ var s =
+ '2;649;CN=Red Hat CS 71GA Demo,O=Red Hat CS 71GA Demo,C=US;' +
+ 'CN=RHCS Agent - admin01,UID=admin01,O=redhat,C=US [1] This is ' +
+ 'Teena Vradmin\'s description.';
+ buf[0] = 0x04;
+ buf[1] = 0x81;
+ buf[2] = 0x94;
+ buf.write(s, 3);
+ var ber = new BerReader(buf.slice(0, 3 + s.length));
+ t.equal(ber.readString(), s);
+ t.end();
+});
diff --git a/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js b/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js
new file mode 100644
index 000000000..add0b9fd3
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js
@@ -0,0 +1,296 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+var test = require('tap').test;
+var sys = require('sys');
+
+///--- Globals
+
+var BerWriter;
+
+var BerReader;
+
+
+///--- Tests
+
+test('load library', function(t) {
+ BerWriter = require('../../lib/index').BerWriter;
+ t.ok(BerWriter);
+ t.ok(new BerWriter());
+ t.end();
+});
+
+
+test('write byte', function(t) {
+ var writer = new BerWriter();
+
+ writer.writeByte(0xC2);
+ var ber = writer.buffer;
+
+ t.ok(ber);
+ t.equal(ber.length, 1, 'Wrong length');
+ t.equal(ber[0], 0xC2, 'value wrong');
+
+ t.end();
+});
+
+
+test('write 1 byte int', function(t) {
+ var writer = new BerWriter();
+
+ writer.writeInt(0x7f);
+ var ber = writer.buffer;
+
+ t.ok(ber);
+ t.equal(ber.length, 3, 'Wrong length for an int: ' + ber.length);
+ t.equal(ber[0], 0x02, 'ASN.1 tag wrong (2) -> ' + ber[0]);
+ t.equal(ber[1], 0x01, 'length wrong(1) -> ' + ber[1]);
+ t.equal(ber[2], 0x7f, 'value wrong(3) -> ' + ber[2]);
+
+ t.end();
+});
+
+
+test('write 2 byte int', function(t) {
+ var writer = new BerWriter();
+
+ writer.writeInt(0x7ffe);
+ var ber = writer.buffer;
+
+ t.ok(ber);
+ t.equal(ber.length, 4, 'Wrong length for an int');
+ t.equal(ber[0], 0x02, 'ASN.1 tag wrong');
+ t.equal(ber[1], 0x02, 'length wrong');
+ t.equal(ber[2], 0x7f, 'value wrong (byte 1)');
+ t.equal(ber[3], 0xfe, 'value wrong (byte 2)');
+
+ t.end();
+});
+
+
+test('write 3 byte int', function(t) {
+ var writer = new BerWriter();
+
+ writer.writeInt(0x7ffffe);
+ var ber = writer.buffer;
+
+ t.ok(ber);
+ t.equal(ber.length, 5, 'Wrong length for an int');
+ t.equal(ber[0], 0x02, 'ASN.1 tag wrong');
+ t.equal(ber[1], 0x03, 'length wrong');
+ t.equal(ber[2], 0x7f, 'value wrong (byte 1)');
+ t.equal(ber[3], 0xff, 'value wrong (byte 2)');
+ t.equal(ber[4], 0xfe, 'value wrong (byte 3)');
+
+ t.end();
+});
+
+
+test('write 4 byte int', function(t) {
+ var writer = new BerWriter();
+
+ writer.writeInt(0x7ffffffe);
+ var ber = writer.buffer;
+
+ t.ok(ber);
+
+ t.equal(ber.length, 6, 'Wrong length for an int');
+ t.equal(ber[0], 0x02, 'ASN.1 tag wrong');
+ t.equal(ber[1], 0x04, 'length wrong');
+ t.equal(ber[2], 0x7f, 'value wrong (byte 1)');
+ t.equal(ber[3], 0xff, 'value wrong (byte 2)');
+ t.equal(ber[4], 0xff, 'value wrong (byte 3)');
+ t.equal(ber[5], 0xfe, 'value wrong (byte 4)');
+
+ t.end();
+});
+
+
+test('write boolean', function(t) {
+ var writer = new BerWriter();
+
+ writer.writeBoolean(true);
+ writer.writeBoolean(false);
+ var ber = writer.buffer;
+
+ t.ok(ber);
+ t.equal(ber.length, 6, 'Wrong length');
+ t.equal(ber[0], 0x01, 'tag wrong');
+ t.equal(ber[1], 0x01, 'length wrong');
+ t.equal(ber[2], 0xff, 'value wrong');
+ t.equal(ber[3], 0x01, 'tag wrong');
+ t.equal(ber[4], 0x01, 'length wrong');
+ t.equal(ber[5], 0x00, 'value wrong');
+
+ t.end();
+});
+
+
+test('write string', function(t) {
+ var writer = new BerWriter();
+ writer.writeString('hello world');
+ var ber = writer.buffer;
+
+ t.ok(ber);
+ t.equal(ber.length, 13, 'wrong length');
+ t.equal(ber[0], 0x04, 'wrong tag');
+ t.equal(ber[1], 11, 'wrong length');
+ t.equal(ber.slice(2).toString('utf8'), 'hello world', 'wrong value');
+
+ t.end();
+});
+
+test('write buffer', function(t) {
+ var writer = new BerWriter();
+ // write some stuff to start with
+ writer.writeString('hello world');
+ var ber = writer.buffer;
+ var buf = new Buffer([0x04, 0x0b, 0x30, 0x09, 0x02, 0x01, 0x0f, 0x01, 0x01,
+ 0xff, 0x01, 0x01, 0xff]);
+ writer.writeBuffer(buf.slice(2, buf.length), 0x04);
+ ber = writer.buffer;
+
+ t.ok(ber);
+ t.equal(ber.length, 26, 'wrong length');
+ t.equal(ber[0], 0x04, 'wrong tag');
+ t.equal(ber[1], 11, 'wrong length');
+ t.equal(ber.slice(2, 13).toString('utf8'), 'hello world', 'wrong value');
+ t.equal(ber[13], buf[0], 'wrong tag');
+ t.equal(ber[14], buf[1], 'wrong length');
+ for (var i = 13, j = 0; i < ber.length && j < buf.length; i++, j++) {
+ t.equal(ber[i], buf[j], 'buffer contents not identical');
+ }
+ t.end();
+});
+
+test('write string array', function(t) {
+ var writer = new BerWriter();
+ writer.writeStringArray(['hello world', 'fubar!']);
+ var ber = writer.buffer;
+
+ t.ok(ber);
+
+ t.equal(ber.length, 21, 'wrong length');
+ t.equal(ber[0], 0x04, 'wrong tag');
+ t.equal(ber[1], 11, 'wrong length');
+ t.equal(ber.slice(2, 13).toString('utf8'), 'hello world', 'wrong value');
+
+ t.equal(ber[13], 0x04, 'wrong tag');
+ t.equal(ber[14], 6, 'wrong length');
+ t.equal(ber.slice(15).toString('utf8'), 'fubar!', 'wrong value');
+
+ t.end();
+});
+
+
+test('resize internal buffer', function(t) {
+ var writer = new BerWriter({size: 2});
+ writer.writeString('hello world');
+ var ber = writer.buffer;
+
+ t.ok(ber);
+ t.equal(ber.length, 13, 'wrong length');
+ t.equal(ber[0], 0x04, 'wrong tag');
+ t.equal(ber[1], 11, 'wrong length');
+ t.equal(ber.slice(2).toString('utf8'), 'hello world', 'wrong value');
+
+ t.end();
+});
+
+
+test('sequence', function(t) {
+ var writer = new BerWriter({size: 25});
+ writer.startSequence();
+ writer.writeString('hello world');
+ writer.endSequence();
+ var ber = writer.buffer;
+
+ t.ok(ber);
+ console.log(ber);
+ t.equal(ber.length, 15, 'wrong length');
+ t.equal(ber[0], 0x30, 'wrong tag');
+ t.equal(ber[1], 13, 'wrong length');
+ t.equal(ber[2], 0x04, 'wrong tag');
+ t.equal(ber[3], 11, 'wrong length');
+ t.equal(ber.slice(4).toString('utf8'), 'hello world', 'wrong value');
+
+ t.end();
+});
+
+
+test('nested sequence', function(t) {
+ var writer = new BerWriter({size: 25});
+ writer.startSequence();
+ writer.writeString('hello world');
+ writer.startSequence();
+ writer.writeString('hello world');
+ writer.endSequence();
+ writer.endSequence();
+ var ber = writer.buffer;
+
+ t.ok(ber);
+ t.equal(ber.length, 30, 'wrong length');
+ t.equal(ber[0], 0x30, 'wrong tag');
+ t.equal(ber[1], 28, 'wrong length');
+ t.equal(ber[2], 0x04, 'wrong tag');
+ t.equal(ber[3], 11, 'wrong length');
+ t.equal(ber.slice(4, 15).toString('utf8'), 'hello world', 'wrong value');
+ t.equal(ber[15], 0x30, 'wrong tag');
+ t.equal(ber[16], 13, 'wrong length');
+ t.equal(ber[17], 0x04, 'wrong tag');
+ t.equal(ber[18], 11, 'wrong length');
+ t.equal(ber.slice(19, 30).toString('utf8'), 'hello world', 'wrong value');
+
+ t.end();
+});
+
+
+test('LDAP bind message', function(t) {
+ var dn = 'cn=foo,ou=unit,o=test';
+ var writer = new BerWriter();
+ writer.startSequence();
+ writer.writeInt(3); // msgid = 3
+ writer.startSequence(0x60); // ldap bind
+ writer.writeInt(3); // ldap v3
+ writer.writeString(dn);
+ writer.writeByte(0x80);
+ writer.writeByte(0x00);
+ writer.endSequence();
+ writer.endSequence();
+ var ber = writer.buffer;
+
+ t.ok(ber);
+ t.equal(ber.length, 35, 'wrong length (buffer)');
+ t.equal(ber[0], 0x30, 'wrong tag');
+ t.equal(ber[1], 33, 'wrong length');
+ t.equal(ber[2], 0x02, 'wrong tag');
+ t.equal(ber[3], 1, 'wrong length');
+ t.equal(ber[4], 0x03, 'wrong value');
+ t.equal(ber[5], 0x60, 'wrong tag');
+ t.equal(ber[6], 28, 'wrong length');
+ t.equal(ber[7], 0x02, 'wrong tag');
+ t.equal(ber[8], 1, 'wrong length');
+ t.equal(ber[9], 0x03, 'wrong value');
+ t.equal(ber[10], 0x04, 'wrong tag');
+ t.equal(ber[11], dn.length, 'wrong length');
+ t.equal(ber.slice(12, 33).toString('utf8'), dn, 'wrong value');
+ t.equal(ber[33], 0x80, 'wrong tag');
+ t.equal(ber[34], 0x00, 'wrong len');
+
+ t.end();
+});
+
+
+test('Write OID', function(t) {
+ var oid = '1.2.840.113549.1.1.1';
+ var writer = new BerWriter();
+ writer.writeOID(oid);
+
+ var ber = writer.buffer;
+ t.ok(ber);
+ console.log(require('util').inspect(ber));
+ console.log(require('util').inspect(new Buffer([0x06, 0x09, 0x2a, 0x86,
+ 0x48, 0x86, 0xf7, 0x0d,
+ 0x01, 0x01, 0x01])));
+
+ t.end();
+});
diff --git a/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md b/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md
new file mode 100644
index 000000000..c0c3a5308
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md
@@ -0,0 +1,126 @@
+# node-assert-plus
+
+This library is a super small wrapper over node's assert module that has two
+things: (1) the ability to disable assertions with the environment variable
+NODE_NDEBUG, and (2) some API wrappers for argument testing. Like
+`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks
+like this:
+
+ var assert = require('assert-plus');
+
+ function fooAccount(options, callback) {
+ assert.object(options, 'options');
+ assert.number(options.id, 'options.id);
+ assert.bool(options.isManager, 'options.isManager');
+ assert.string(options.name, 'options.name');
+ assert.arrayOfString(options.email, 'options.email');
+ assert.func(callback, 'callback');
+
+ // Do stuff
+ callback(null, {});
+ }
+
+# API
+
+All methods that *aren't* part of node's core assert API are simply assumed to
+take an argument, and then a string 'name' that's not a message; `AssertionError`
+will be thrown if the assertion fails with a message like:
+
+ AssertionError: foo (string) is required
+ at test (/home/mark/work/foo/foo.js:3:9)
+ at Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)
+ at Module._compile (module.js:446:26)
+ at Object..js (module.js:464:10)
+ at Module.load (module.js:353:31)
+ at Function._load (module.js:311:12)
+ at Array.0 (module.js:484:10)
+ at EventEmitter._tickCallback (node.js:190:38)
+
+from:
+
+ function test(foo) {
+ assert.string(foo, 'foo');
+ }
+
+There you go. You can check that arrays are of a homogenous type with `Arrayof$Type`:
+
+ function test(foo) {
+ assert.arrayOfString(foo, 'foo');
+ }
+
+You can assert IFF an argument is not `undefined` (i.e., an optional arg):
+
+ assert.optionalString(foo, 'foo');
+
+Lastly, you can opt-out of assertion checking altogether by setting the
+environment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have
+lots of assertions, and don't want to pay `typeof ()` taxes to v8 in
+production.
+
+The complete list of APIs is:
+
+* assert.bool
+* assert.buffer
+* assert.func
+* assert.number
+* assert.object
+* assert.string
+* assert.arrayOfBool
+* assert.arrayOfFunc
+* assert.arrayOfNumber
+* assert.arrayOfObject
+* assert.arrayOfString
+* assert.optionalBool
+* assert.optionalBuffer
+* assert.optionalFunc
+* assert.optionalNumber
+* assert.optionalObject
+* assert.optionalString
+* assert.optionalArrayOfBool
+* assert.optionalArrayOfFunc
+* assert.optionalArrayOfNumber
+* assert.optionalArrayOfObject
+* assert.optionalArrayOfString
+* assert.AssertionError
+* assert.fail
+* assert.ok
+* assert.equal
+* assert.notEqual
+* assert.deepEqual
+* assert.notDeepEqual
+* assert.strictEqual
+* assert.notStrictEqual
+* assert.throws
+* assert.doesNotThrow
+* assert.ifError
+
+# Installation
+
+ npm install assert-plus
+
+## License
+
+The MIT License (MIT)
+Copyright (c) 2012 Mark Cavage
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+## Bugs
+
+See <https://github.com/mcavage/node-assert-plus/issues>.
diff --git a/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js b/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js
new file mode 100644
index 000000000..ff2ba02de
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js
@@ -0,0 +1,245 @@
+// Copyright (c) 2012, Mark Cavage. All rights reserved.
+
+var assert = require('assert');
+var Stream = require('stream').Stream;
+var util = require('util');
+
+
+
+///--- Globals
+
+var NDEBUG = process.env.NODE_NDEBUG || false;
+var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
+
+
+
+///--- Messages
+
+var ARRAY_TYPE_REQUIRED = '%s ([%s]) required';
+var TYPE_REQUIRED = '%s (%s) is required';
+
+
+
+///--- Internal
+
+function capitalize(str) {
+ return (str.charAt(0).toUpperCase() + str.slice(1));
+}
+
+function uncapitalize(str) {
+ return (str.charAt(0).toLowerCase() + str.slice(1));
+}
+
+function _() {
+ return (util.format.apply(util, arguments));
+}
+
+
+function _assert(arg, type, name, stackFunc) {
+ if (!NDEBUG) {
+ name = name || type;
+ stackFunc = stackFunc || _assert.caller;
+ var t = typeof (arg);
+
+ if (t !== type) {
+ throw new assert.AssertionError({
+ message: _(TYPE_REQUIRED, name, type),
+ actual: t,
+ expected: type,
+ operator: '===',
+ stackStartFunction: stackFunc
+ });
+ }
+ }
+}
+
+
+function _instanceof(arg, type, name, stackFunc) {
+ if (!NDEBUG) {
+ name = name || type;
+ stackFunc = stackFunc || _instanceof.caller;
+
+ if (!(arg instanceof type)) {
+ throw new assert.AssertionError({
+ message: _(TYPE_REQUIRED, name, type.name),
+ actual: _getClass(arg),
+ expected: type.name,
+ operator: 'instanceof',
+ stackStartFunction: stackFunc
+ });
+ }
+ }
+}
+
+function _getClass(object) {
+ return (Object.prototype.toString.call(object).slice(8, -1));
+};
+
+
+
+///--- API
+
+function array(arr, type, name) {
+ if (!NDEBUG) {
+ name = name || type;
+
+ if (!Array.isArray(arr)) {
+ throw new assert.AssertionError({
+ message: _(ARRAY_TYPE_REQUIRED, name, type),
+ actual: typeof (arr),
+ expected: 'array',
+ operator: 'Array.isArray',
+ stackStartFunction: array.caller
+ });
+ }
+
+ for (var i = 0; i < arr.length; i++) {
+ _assert(arr[i], type, name, array);
+ }
+ }
+}
+
+
+function bool(arg, name) {
+ _assert(arg, 'boolean', name, bool);
+}
+
+
+function buffer(arg, name) {
+ if (!Buffer.isBuffer(arg)) {
+ throw new assert.AssertionError({
+ message: _(TYPE_REQUIRED, name || '', 'Buffer'),
+ actual: typeof (arg),
+ expected: 'buffer',
+ operator: 'Buffer.isBuffer',
+ stackStartFunction: buffer
+ });
+ }
+}
+
+
+function func(arg, name) {
+ _assert(arg, 'function', name);
+}
+
+
+function number(arg, name) {
+ _assert(arg, 'number', name);
+ if (!NDEBUG && (isNaN(arg) || !isFinite(arg))) {
+ throw new assert.AssertionError({
+ message: _(TYPE_REQUIRED, name, 'number'),
+ actual: arg,
+ expected: 'number',
+ operator: 'isNaN',
+ stackStartFunction: number
+ });
+ }
+}
+
+
+function object(arg, name) {
+ _assert(arg, 'object', name);
+}
+
+
+function stream(arg, name) {
+ _instanceof(arg, Stream, name);
+}
+
+
+function date(arg, name) {
+ _instanceof(arg, Date, name);
+}
+
+function regexp(arg, name) {
+ _instanceof(arg, RegExp, name);
+}
+
+
+function string(arg, name) {
+ _assert(arg, 'string', name);
+}
+
+
+function uuid(arg, name) {
+ string(arg, name);
+ if (!NDEBUG && !UUID_REGEXP.test(arg)) {
+ throw new assert.AssertionError({
+ message: _(TYPE_REQUIRED, name, 'uuid'),
+ actual: 'string',
+ expected: 'uuid',
+ operator: 'test',
+ stackStartFunction: uuid
+ });
+ }
+}
+
+
+///--- Exports
+
+module.exports = {
+ bool: bool,
+ buffer: buffer,
+ date: date,
+ func: func,
+ number: number,
+ object: object,
+ regexp: regexp,
+ stream: stream,
+ string: string,
+ uuid: uuid
+};
+
+
+Object.keys(module.exports).forEach(function (k) {
+ if (k === 'buffer')
+ return;
+
+ var name = 'arrayOf' + capitalize(k);
+
+ if (k === 'bool')
+ k = 'boolean';
+ if (k === 'func')
+ k = 'function';
+ module.exports[name] = function (arg, name) {
+ array(arg, k, name);
+ };
+});
+
+Object.keys(module.exports).forEach(function (k) {
+ var _name = 'optional' + capitalize(k);
+ var s = uncapitalize(k.replace('arrayOf', ''));
+ if (s === 'bool')
+ s = 'boolean';
+ if (s === 'func')
+ s = 'function';
+
+ if (k.indexOf('arrayOf') !== -1) {
+ module.exports[_name] = function (arg, name) {
+ if (!NDEBUG && arg !== undefined) {
+ array(arg, s, name);
+ }
+ };
+ } else {
+ module.exports[_name] = function (arg, name) {
+ if (!NDEBUG && arg !== undefined) {
+ _assert(arg, s, name);
+ }
+ };
+ }
+});
+
+
+// Reexport built-in assertions
+Object.keys(assert).forEach(function (k) {
+ if (k === 'AssertionError') {
+ module.exports[k] = assert[k];
+ return;
+ }
+
+ module.exports[k] = function () {
+ if (!NDEBUG) {
+ assert[k].apply(assert[k], arguments);
+ }
+ };
+});
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
new file mode 100644
index 000000000..b3317675d
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json
@@ -0,0 +1,30 @@
+{
+ "author": {
+ "name": "Mark Cavage",
+ "email": "mcavage@gmail.com"
+ },
+ "name": "assert-plus",
+ "description": "Extra assertions on top of node's assert module",
+ "version": "0.1.5",
+ "main": "./assert.js",
+ "devDependencies": {},
+ "optionalDependencies": {},
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/mcavage/node-assert-plus.git"
+ },
+ "engines": {
+ "node": ">=0.8"
+ },
+ "readme": "# node-assert-plus\n\nThis library is a super small wrapper over node's assert module that has two\nthings: (1) the ability to disable assertions with the environment variable\nNODE_NDEBUG, and (2) some API wrappers for argument testing. Like\n`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks\nlike this:\n\n var assert = require('assert-plus');\n\n function fooAccount(options, callback) {\n\t assert.object(options, 'options');\n\t\tassert.number(options.id, 'options.id);\n\t\tassert.bool(options.isManager, 'options.isManager');\n\t\tassert.string(options.name, 'options.name');\n\t\tassert.arrayOfString(options.email, 'options.email');\n\t\tassert.func(callback, 'callback');\n\n // Do stuff\n\t\tcallback(null, {});\n }\n\n# API\n\nAll methods that *aren't* part of node's core assert API are simply assumed to\ntake an argument, and then a string 'name' that's not a message; `AssertionError`\nwill be thrown if the assertion fails with a message like:\n\n AssertionError: foo (string) is required\n\tat test (/home/mark/work/foo/foo.js:3:9)\n\tat Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)\n\tat Module._compile (module.js:446:26)\n\tat Object..js (module.js:464:10)\n\tat Module.load (module.js:353:31)\n\tat Function._load (module.js:311:12)\n\tat Array.0 (module.js:484:10)\n\tat EventEmitter._tickCallback (node.js:190:38)\n\nfrom:\n\n function test(foo) {\n\t assert.string(foo, 'foo');\n }\n\nThere you go. You can check that arrays are of a homogenous type with `Arrayof$Type`:\n\n function test(foo) {\n\t assert.arrayOfString(foo, 'foo');\n }\n\nYou can assert IFF an argument is not `undefined` (i.e., an optional arg):\n\n assert.optionalString(foo, 'foo');\n\nLastly, you can opt-out of assertion checking altogether by setting the\nenvironment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have\nlots of assertions, and don't want to pay `typeof ()` taxes to v8 in\nproduction.\n\nThe complete list of APIs is:\n\n* assert.bool\n* assert.buffer\n* assert.func\n* assert.number\n* assert.object\n* assert.string\n* assert.arrayOfBool\n* assert.arrayOfFunc\n* assert.arrayOfNumber\n* assert.arrayOfObject\n* assert.arrayOfString\n* assert.optionalBool\n* assert.optionalBuffer\n* assert.optionalFunc\n* assert.optionalNumber\n* assert.optionalObject\n* assert.optionalString\n* assert.optionalArrayOfBool\n* assert.optionalArrayOfFunc\n* assert.optionalArrayOfNumber\n* assert.optionalArrayOfObject\n* assert.optionalArrayOfString\n* assert.AssertionError\n* assert.fail\n* assert.ok\n* assert.equal\n* assert.notEqual\n* assert.deepEqual\n* assert.notDeepEqual\n* assert.strictEqual\n* assert.notStrictEqual\n* assert.throws\n* assert.doesNotThrow\n* assert.ifError\n\n# Installation\n\n npm install assert-plus\n\n## License\n\nThe MIT License (MIT)\nCopyright (c) 2012 Mark Cavage\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## Bugs\n\nSee <https://github.com/mcavage/node-assert-plus/issues>.\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/mcavage/node-assert-plus/issues"
+ },
+ "homepage": "https://github.com/mcavage/node-assert-plus#readme",
+ "dependencies": {},
+ "_id": "assert-plus@0.1.5",
+ "_shasum": "ee74009413002d84cec7219c6ac811812e723160",
+ "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz",
+ "_from": "assert-plus@>=0.1.5 <0.2.0"
+}
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore b/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore
new file mode 100644
index 000000000..dc6d3b24d
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore
@@ -0,0 +1 @@
+tst/
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG b/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG
new file mode 100644
index 000000000..426da9ef0
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG
@@ -0,0 +1,78 @@
+This contains tickets fixed in each version release in reverse chronological
+order. There is one ticket per line. Each commits message has the tickets fixed
+in it. The commit message also has the corresponding github issue. i.e. CTYPE-42
+would be issue 42. Each issue can be found at:
+https://github.com/rmustacc/node-ctype/issues/%d.
+
+v0.5.3
+CTYPE-50 Release 0.5.3
+Contributed by Nick Schonning:
+CTYPE-49 Add repository section to package.json
+Contributed by Jonathan Ong:
+CTYPE-48 Create .npmignore
+
+v0.5.2
+CTYPE-46 Release 0.5.2
+CTYPE-45 error in setEndian logic
+
+v0.5.1
+CTYPE-44 Release 0.5.1
+Contributed by Terin Stock:
+CTYPE-41 CTypeParser.writeStruct should return its offset
+Contributed by Terin Stock:
+CTYPE-42 int64_t returns wrong size
+
+v0.5.0
+CTYPE-40 Release 0.5.0
+CTYPE-39 want > 0.6 engine support
+
+v0.4.0
+CTYPE-37 Release v0.4.0
+CTYPE-6 want additional entry point for write
+CTYPE-20 Add 64-bit int support into core parser
+CTYPE-31 Fix bounds errors node/2129
+CTYPE-33 Update copyright holders
+CTYPE-34 ctf.js confuses sign bit.
+CTYPE-35 Make the README more useful for getting started
+CTYPE-36 want manual page on ctio functions
+
+v0.3.1
+CTYPE-29 Release 0.3.1
+CTYPE-28 Want v0.6 npm support
+
+v0.3.0
+CTYPE-27 Release v0.3.0
+CTYPE-26 Want alternate default char behavior
+
+v0.2.1
+CTYPE-25 Release v0.2.1
+CTYPE-24 Writing structs is busted
+
+v0.2.0:
+CTYPE-23 Release v0.2.0
+CTYPE-21 Add support for CTF JSON data
+CTYPE-22 Add Javascriptlint profile
+CTYPE-15 Pull in ctio updates from node/master
+
+v0.1.0:
+CTYPE-18 Bump version to v0.1.0
+CTYPE-17 Fix nested structures
+CTYPE-16 Remove extraneous logging
+CTYPE-14 toAbs64 and toApprox64 are not exported
+
+v0.0.3:
+CTYPE-12 Bump version to v0.0.3
+CTYPE-11 fix typo in wuint64
+CTYPE-10 Integrate jsstyle
+
+v0.0.2:
+CTYPE-8 dump npm version to v0.0.2
+CTYPE-9 want changelog
+CTYPE-7 fix typo in detypes.
+
+v0.0.1:
+CTYPE-5 Missing from NPM registry
+CTYPE-4 int16_t calls wrong read function
+CTYPE-3 API example types are missing quotes as strings
+CTYPE-2 doc missing 64-bit functions
+CTYPE-1 Need license
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE b/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE
new file mode 100644
index 000000000..22ced3e63
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE
@@ -0,0 +1,24 @@
+The following license applies to all files unless the file is specified below.
+Each file specified below has its license information embedded in it:
+
+tools/jsstyle
+
+Copyright 2011, Robert Mustacchi. All rights reserved.
+Copyright 2011, Joyent, Inc. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/README b/node_modules/request/node_modules/http-signature/node_modules/ctype/README
new file mode 100644
index 000000000..4efd7ee5c
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/ctype/README
@@ -0,0 +1,82 @@
+Node-CType is a way to read and write binary data in structured and easy to use
+format. Its name comes from the C header file.
+
+To get started, simply clone the repository or use npm to install it. Once it is
+there, simply require it.
+
+git clone git://github.com/rmustacc/node-ctype
+npm install ctype
+var mod_ctype = require('ctype')
+
+
+There are two APIs that you can use, depending on what abstraction you'd like.
+The low level API let's you read and write individual integers and floats from
+buffers. The higher level API let's you read and write structures of these. To
+illustrate this, let's looks look at how we would read and write a binary
+encoded x,y point.
+
+In C we would define this structure as follows:
+
+typedef struct point {
+ uint16_t p_x;
+ uint16_t p_y;
+} point_t;
+
+To read a binary encoded point from a Buffer, we first need to create a CType
+parser (where we specify the endian and other options) and add the typedef.
+
+var parser = new mod_ctype.Parser({ endian: 'big' });
+parser.typedef('point_t', [
+ { x: { type: 'uint16_t' } },
+ { y: { type: 'uint16_t' } }
+]);
+
+From here, given a buffer buf and an offset into it, we can read a point.
+
+var out = parser.readData([ { point: { type: 'point_t' } } ], buffer, 0);
+console.log(out);
+{ point: { x: 23, y: 42 } }
+
+Another way to get the same information would be to use the low level methods.
+Note that these require you to manually deal with the offset. Here's how we'd
+get the same values of x and y from the buffer.
+
+var x = mod_ctype.ruint16(buf, 'big', 0);
+var y = mod_ctype.ruint16(buf, 'big', 2);
+console.log(x + ', ' + y);
+23, 42
+
+The true power of this API comes from the ability to define and nest typedefs,
+just as you would in C. By default, the following types are defined by default.
+Note that they return a Number, unless indicated otherwise.
+
+ * int8_t
+ * int16_t
+ * int32_t
+ * int64_t (returns an array where val[0] << 32 + val[1] would be the value)
+ * uint8_t
+ * uint16_t
+ * uint32_t
+ * uint64_t (returns an array where val[0] << 32 + val[1] would be the value)
+ * float
+ * double
+ * char (either returns a buffer with that character or a uint8_t)
+ * char[] (returns an object with the buffer and the number of characters read which is either the total amount requested or until the first 0)
+
+
+ctf2json integration:
+
+Node-CType supports consuming the output of ctf2json. Once you read in a JSON file,
+all you have to do to add all the definitions it contains is:
+
+var data, parser;
+data = JSON.parse(parsedJSONData);
+parser = mod_ctype.parseCTF(data, { endian: 'big' });
+
+For more documentation, see the file README.old. Full documentation is in the
+process of being rewritten as a series of manual pages which will be available
+in the repository and online for viewing.
+
+To read the ctio manual page simple run, from the root of the workspace:
+
+man -Mman -s 3ctype ctio
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old b/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old
new file mode 100644
index 000000000..9326b725f
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old
@@ -0,0 +1,298 @@
+This library provides a way to read and write binary data.
+
+Node CType is a way to read and write binary data in structured and easy to use
+formats. It's name comes from the header file, though it does not share as much
+with it as it perhaps should.
+
+There are two levels of the API. One is the raw API which everything is built on
+top of, while the other provides a much nicer abstraction and is built entirely
+by using the lower level API. The hope is that the low level API is both clear
+and useful. The low level API gets it's names from stdint.h (a rather
+appropriate source). The lower level API is presented at the end of this
+document.
+
+Standard CType API
+
+The CType interface is presented as a parser object that controls the
+endianness combined with a series of methods to change that value, parse and
+write out buffers, and a way to provide typedefs. Standard Types
+
+The CType parser supports the following basic types which return Numbers except
+as indicated:
+
+ * int8_t
+ * int16_t
+ * int32_t
+ * int64_t (returns an array where val[0] << 32 + val[1] would be the value)
+ * uint8_t
+ * uint16_t
+ * uint32_t
+ * uint64_t (returns an array where val[0] << 32 + val[1] would be the value)
+ * float
+ * double
+ * char (returns a buffer with just that single character)
+ * char[] (returns an object with the buffer and the number of characters read which is either the total amount requested or until the first 0)
+
+Specifying Structs
+
+The CType parser also supports the notion of structs. A struct is an array of
+JSON objects that defines an order of keys which have types and values. One
+would build a struct to represent a point (x,y) as follows:
+
+[
+ { x: { type: 'int16_t' }},
+ { y: { type: 'int16_t' }}
+]
+
+When this is passed into the read routine, it would read the first two bytes
+(as defined by int16_t) to determine the Number to use for X, and then it would
+read the next two bytes to determine the value of Y. When read this could
+return something like:
+
+{
+ x: 42,
+ y: -23
+}
+
+When someone wants to write values, we use the same format as above, but with
+additional value field:
+
+[
+ { x: { type: 'int16_t', value: 42 }},
+ { y: { type: 'int16_t', value: -23 }}
+]
+
+Now, the structure above may be optionally annotated with offsets. This tells
+us to rather than read continuously we should read the given value at the
+specified offset. If an offset is provided, it is is effectively the equivalent
+of lseek(offset, SEEK_SET). Thus, subsequent values will be read from that
+offset and incremented by the appropriate value. As an example:
+
+[
+ { x: { type: 'int16_t' }},
+ { y: { type: 'int16_t', offset: 20 }},
+ { z: { type: 'int16_t' }}
+]
+
+We would read x from the first starting offset given to us, for the sake of
+example, let's assume that's 0. After reading x, the next offset to read from
+would be 2; however, y specifies an offset, thus we jump directly to that
+offset and read y from byte 20. We would then read z from byte 22.
+
+The same offsets may be used when writing values.
+
+Typedef
+
+The basic set of types while covers the basics, is somewhat limiting. To make
+this richer, there is functionality to typedef something like in C. One can use
+typedef to add a new name to an existing type or to define a name to refer to a
+struct. Thus the following are all examples of a typedef:
+
+typedef('size_t', 'uint32_t');
+typedef('ssize_t', 'int32_t');
+typedef('point_t', [
+ { x: { type: 'int16_t' }},
+ { y: { type: 'int16_t' }}
+]);
+
+Once something has been typedef'd it can be used in any of the definitions
+previously shown.
+
+One cannot remove a typedef once created, this is analogous to C.
+
+The set of defined types can be printed with lstypes. The format of this output
+is subject to change, but likely will look something like:
+
+> lstypes();
+{
+ size_t: 'uint32_t',
+ ssize_t: 'int32_t',
+ point_t: [
+ { x: { type: 'int16_t' }},
+ { y: { type: 'int16_t' }}
+ ]
+}
+
+Specifying arrays
+
+Arrays can be specified by appending []s to a type. Arrays must have the size
+specified. The size must be specified and it can be done in one of two ways:
+
+ * An explicit non-zero integer size
+ * A name of a previously declared variable in the struct whose value is a
+ number.
+
+Note, that when using the name of a variable, it should be the string name for
+the key. This is only valid inside structs and the value must be declared
+before the value with the array. The following are examples:
+
+[
+ { ip_addr4: { type: 'uint8_t[4]' }},
+ { len: { type: 'uint32_t' }},
+ { data: { type: 'uint8_t[len]' }}
+]
+
+Arrays are permitted in typedefs; however, they must have a declared integer
+size. The following are examples of valid and invalid arrays:
+
+typedef('path', 'char[1024]'); /* Good */
+typedef('path', 'char[len]'); /* Bad! */
+
+64 bit values:
+
+Unfortunately Javascript represents values with a double, so you lose precision
+and the ability to represent Integers roughly beyond 2^53. To alleviate this, I
+propose the following for returning 64 bit integers when read:
+
+value[2]: Each entry is a 32 bit number which can be reconstructed to the
+original by the following formula:
+
+value[0] << 32 + value[1] (Note this will not work in Javascript)
+
+CTF JSON data:
+
+node-ctype can also handle JSON data that mathces the format described in the
+documentation of the tool ctf2json. Given the JSON data which specifies type
+information, it will transform that into a parser that understands all of the
+types defined inside of it. This is useful for more complicated structures that
+have a lot of typedefs.
+
+Interface overview
+
+The following is the header-file like interface to the parser object:
+
+/*
+ * Create a new instance of the parser. Each parser has its own store of
+ * typedefs and endianness. Conf is an object with the following values:
+ *
+ * endian Either 'big' or 'little' do determine the endianness we
+ * want to read from or write to.
+ *
+ */
+function CTypeParser(conf);
+
+/*
+ * Parses the CTF JSON data and creates a parser that understands all of those
+ * types.
+ *
+ * data Parsed JSON data that maches that CTF JSON
+ * specification.
+ *
+ * conf The configuration object to create a new CTypeParser
+ * from.
+ */
+CTypeParser parseCTF(data, conf);
+
+/*
+ * This is what we were born to do. We read the data from a buffer and return it
+ * in an object whose keys match the values from the object.
+ *
+ * def The array definition of the data to read in
+ *
+ * buffer The buffer to read data from
+ *
+ * offset The offset to start writing to
+ *
+ * Returns an object where each key corresponds to an entry in def and the value
+ * is the read value.
+ */
+Object CTypeParser.readData(<Type Definition>, buffer, offset);
+
+/*
+ * This is the second half of what we were born to do, write out the data
+ * itself.
+ *
+ * def The array definition of the data to write out with
+ * values
+ *
+ * buffer The buffer to write to
+ *
+ * offset The offset in the buffer to write to
+ */
+void CTypeParser.writeData(<Type Definition>, buffer, offset);
+
+/*
+ * A user has requested to add a type, let us honor their request. Yet, if their
+ * request doth spurn us, send them unto the Hells which Dante describes.
+ *
+ * name The string for the type definition we're adding
+ *
+ * value Either a string that is a type/array name or an object
+ * that describes a struct.
+ */
+void CTypeParser.prototype.typedef(name, value);
+
+Object CTypeParser.prototype.lstypes();
+
+/*
+ * Get the endian value for the current parser
+ */
+String CTypeParser.prototype.getEndian();
+
+/*
+ * Sets the current endian value for the Parser. If the value is not valid,
+ * throws an Error.
+ *
+ * endian Either 'big' or 'little' do determine the endianness we
+ * want to read from or write to.
+ *
+ */
+void CTypeParser.protoype.setEndian(String);
+
+/*
+ * Attempts to convert an array of two integers returned from rsint64 / ruint64
+ * into an absolute 64 bit number. If however the value would exceed 2^52 this
+ * will instead throw an error. The mantissa in a double is a 52 bit number and
+ * rather than potentially give you a value that is an approximation this will
+ * error. If you would rather an approximation, please see toApprox64.
+ *
+ * val An array of two 32-bit integers
+ */
+Number function toAbs64(val)
+
+/*
+ * Will return the 64 bit value as returned in an array from rsint64 / ruint64
+ * to a value as close as it can. Note that Javascript stores all numbers as a
+ * double and the mantissa only has 52 bits. Thus this version may approximate
+ * the value.
+ *
+ * val An array of two 32-bit integers
+ */
+Number function toApprox64(val)
+
+Low Level API
+
+The following function are provided at the low level:
+
+Read unsigned integers from a buffer:
+Number ruint8(buffer, endian, offset);
+Number ruint16(buffer, endian, offset);
+Number ruint32(buffer, endian, offset);
+Number[] ruint64(buffer, endian, offset);
+
+Read signed integers from a buffer:
+Number rsint8(buffer, endian, offset);
+Number rsint16(buffer, endian, offset);
+Number rsint32(buffer, endian, offset);
+Number[] rsint64(buffer, endian, offset);
+
+Read floating point numbers from a buffer:
+Number rfloat(buffer, endian, offset); /* IEEE-754 Single precision */
+Number rdouble(buffer, endian, offset); /* IEEE-754 Double precision */
+
+Write unsigned integers to a buffer:
+void wuint8(Number, endian, buffer, offset);
+void wuint16(Number, endian, buffer, offset);
+void wuint32(Number, endian, buffer, offset);
+void wuint64(Number[], endian, buffer, offset);
+
+Write signed integers from a buffer:
+void wsint8(Number, endian, buffer, offset);
+void wsint16(Number, endian, buffer, offset);
+void wsint32(Number, endian, buffer, offset);
+void wsint64(Number[], endian, buffer offset);
+
+Write floating point numbers from a buffer:
+void wfloat(Number, buffer, endian, offset); /* IEEE-754 Single precision */
+void wdouble(Number, buffer, endian, offset); /* IEEE-754 Double precision */
+
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js b/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js
new file mode 100644
index 000000000..66d5f7352
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js
@@ -0,0 +1,245 @@
+/*
+ * ctf.js
+ *
+ * Understand and parse all of the different JSON formats of CTF data and
+ * translate that into a series of node-ctype friendly pieces. The reason for
+ * the abstraction is to handle different changes in the file format.
+ *
+ * We have to be careful here that we don't end up using a name that is already
+ * a built in type.
+ */
+var mod_assert = require('assert');
+var ASSERT = mod_assert.ok;
+
+var ctf_versions = [ '1.0' ];
+var ctf_entries = [ 'integer', 'float', 'typedef', 'struct' ];
+var ctf_deftypes = [ 'int8_t', 'uint8_t', 'int16_t', 'uint16_t', 'int32_t',
+ 'uint32_t', 'float', 'double' ];
+
+function ctfParseInteger(entry, ctype)
+{
+ var name, sign, len, type;
+
+ name = entry['name'];
+ if (!('signed' in entry['integer']))
+ throw (new Error('Malformed CTF JSON: integer missing ' +
+ 'signed value'));
+
+
+ if (!('length' in entry['integer']))
+ throw (new Error('Malformed CTF JSON: integer missing ' +
+ 'length value'));
+
+ sign = entry['integer']['signed'];
+ len = entry['integer']['length'];
+ type = null;
+
+ if (sign && len == 1)
+ type = 'int8_t';
+ else if (len == 1)
+ type = 'uint8_t';
+ else if (sign && len == 2)
+ type = 'int16_t';
+ else if (len == 2)
+ type = 'uint16_t';
+ else if (sign && len == 4)
+ type = 'int32_t';
+ else if (len == 4)
+ type = 'uint32_t';
+ else if (sign && len == 8)
+ type = 'int64_t';
+ else if (len == 8)
+ type = 'uint64_t';
+
+ if (type === null)
+ throw (new Error('Malformed CTF JSON: integer has ' +
+ 'unsupported length and sign - ' + len + '/' + sign));
+
+ /*
+ * This means that this is the same as one of our built in types. If
+ * that's the case defining it would be an error. So instead of trying
+ * to typedef it, we'll return here.
+ */
+ if (name == type)
+ return;
+
+ if (name == 'char') {
+ ASSERT(type == 'int8_t');
+ return;
+ }
+
+ ctype.typedef(name, type);
+}
+
+function ctfParseFloat(entry, ctype)
+{
+ var name, len;
+
+ name = entry['name'];
+ if (!('length' in entry['float']))
+ throw (new Error('Malformed CTF JSON: float missing ' +
+ 'length value'));
+
+ len = entry['float']['length'];
+ if (len != 4 && len != 8)
+ throw (new Error('Malformed CTF JSON: float has invalid ' +
+ 'length value'));
+
+ if (len == 4) {
+ if (name == 'float')
+ return;
+ ctype.typedef(name, 'float');
+ } else if (len == 8) {
+ if (name == 'double')
+ return;
+ ctype.typedef(name, 'double');
+ }
+}
+
+function ctfParseTypedef(entry, ctype)
+{
+ var name, type, ii;
+
+ name = entry['name'];
+ if (typeof (entry['typedef']) != 'string')
+ throw (new Error('Malformed CTF JSON: typedef value in not ' +
+ 'a string'));
+
+ type = entry['typedef'];
+
+ /*
+ * We need to ensure that we're not looking at type that's one of our
+ * built in types. Traditionally in C a uint32_t would be a typedef to
+ * some kind of integer. However, those size types are built ins.
+ */
+ for (ii = 0; ii < ctf_deftypes.length; ii++) {
+ if (name == ctf_deftypes[ii])
+ return;
+ }
+
+ ctype.typedef(name, type);
+}
+
+function ctfParseStruct(entry, ctype)
+{
+ var name, type, ii, val, index, member, push;
+
+ member = [];
+ if (!Array.isArray(entry['struct']))
+ throw (new Error('Malformed CTF JSON: struct value is not ' +
+ 'an array'));
+
+ for (ii = 0; ii < entry['struct'].length; ii++) {
+ val = entry['struct'][ii];
+ if (!('name' in val))
+ throw (new Error('Malformed CTF JSON: struct member ' +
+ 'missing name'));
+
+ if (!('type' in val))
+ throw (new Error('Malformed CTF JSON: struct member ' +
+ 'missing type'));
+
+ if (typeof (val['name']) != 'string')
+ throw (new Error('Malformed CTF JSON: struct member ' +
+ 'name isn\'t a string'));
+
+ if (typeof (val['type']) != 'string')
+ throw (new Error('Malformed CTF JSON: struct member ' +
+ 'type isn\'t a string'));
+
+ /*
+ * CTF version 2 specifies array names as <type> [<num>] where
+ * as node-ctype does this as <type>[<num>].
+ */
+ name = val['name'];
+ type = val['type'];
+ index = type.indexOf(' [');
+ if (index != -1) {
+ type = type.substring(0, index) +
+ type.substring(index + 1, type.length);
+ }
+ push = {};
+ push[name] = { 'type': type };
+ member.push(push);
+ }
+
+ name = entry['name'];
+ ctype.typedef(name, member);
+}
+
+function ctfParseEntry(entry, ctype)
+{
+ var ii, found;
+
+ if (!('name' in entry))
+ throw (new Error('Malformed CTF JSON: entry missing "name" ' +
+ 'section'));
+
+ for (ii = 0; ii < ctf_entries.length; ii++) {
+ if (ctf_entries[ii] in entry)
+ found++;
+ }
+
+ if (found === 0)
+ throw (new Error('Malformed CTF JSON: found no entries'));
+
+ if (found >= 2)
+ throw (new Error('Malformed CTF JSON: found more than one ' +
+ 'entry'));
+
+ if ('integer' in entry) {
+ ctfParseInteger(entry, ctype);
+ return;
+ }
+
+ if ('float' in entry) {
+ ctfParseFloat(entry, ctype);
+ return;
+ }
+
+ if ('typedef' in entry) {
+ ctfParseTypedef(entry, ctype);
+ return;
+ }
+
+ if ('struct' in entry) {
+ ctfParseStruct(entry, ctype);
+ return;
+ }
+
+ ASSERT(false, 'shouldn\'t reach here');
+}
+
+function ctfParseJson(json, ctype)
+{
+ var version, ii;
+
+ ASSERT(json);
+ ASSERT(ctype);
+ if (!('metadata' in json))
+ throw (new Error('Invalid CTF JSON: missing metadata section'));
+
+ if (!('ctf2json_version' in json['metadata']))
+ throw (new Error('Invalid CTF JSON: missing ctf2json_version'));
+
+ version = json['metadata']['ctf2json_version'];
+ for (ii = 0; ii < ctf_versions.length; ii++) {
+ if (ctf_versions[ii] == version)
+ break;
+ }
+
+ if (ii == ctf_versions.length)
+ throw (new Error('Unsuported ctf2json_version: ' + version));
+
+ if (!('data' in json))
+ throw (new Error('Invalid CTF JSON: missing data section'));
+
+ if (!Array.isArray(json['data']))
+ throw (new Error('Malformed CTF JSON: data section is not ' +
+ 'an array'));
+
+ for (ii = 0; ii < json['data'].length; ii++)
+ ctfParseEntry(json['data'][ii], ctype);
+}
+
+exports.ctfParseJson = ctfParseJson;
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js b/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js
new file mode 100644
index 000000000..62c5d7b23
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js
@@ -0,0 +1,1485 @@
+/*
+ * rm - Feb 2011
+ * ctio.js:
+ *
+ * A simple way to read and write simple ctypes. Of course, as you'll find the
+ * code isn't as simple as it might appear. The following types are currently
+ * supported in big and little endian formats:
+ *
+ * uint8_t int8_t
+ * uint16_t int16_t
+ * uint32_t int32_t
+ * float (single precision IEEE 754)
+ * double (double precision IEEE 754)
+ *
+ * This is designed to work in Node and v8. It may in fact work in other
+ * Javascript interpreters (that'd be pretty neat), but it hasn't been tested.
+ * If you find that it does in fact work, that's pretty cool. Try and pass word
+ * back to the original author.
+ *
+ * Note to the reader: If you're tabstop isn't set to 8, parts of this may look
+ * weird.
+ */
+
+/*
+ * Numbers in Javascript have a secret: all numbers must be represented with an
+ * IEEE-754 double. The double has a mantissa with a length of 52 bits with an
+ * implicit one. Thus the range of integers that can be represented is limited
+ * to the size of the mantissa, this makes reading and writing 64-bit integers
+ * difficult, but far from impossible.
+ *
+ * Another side effect of this representation is what happens when you use the
+ * bitwise operators, i.e. shift left, shift right, and, or, etc. In Javascript,
+ * each operand and the result is cast to a signed 32-bit number. However, in
+ * the case of >>> the values are cast to an unsigned number.
+ */
+
+/*
+ * A reminder on endian related issues:
+ *
+ * Big Endian: MSB -> First byte
+ * Little Endian: MSB->Last byte
+ */
+var mod_assert = require('assert');
+
+/*
+ * An 8 bit unsigned integer involves doing no significant work.
+ */
+function ruint8(buffer, endian, offset)
+{
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ return (buffer[offset]);
+}
+
+/*
+ * For 16 bit unsigned numbers we can do all the casting that we want to do.
+ */
+function rgint16(buffer, endian, offset)
+{
+ var val = 0;
+
+ if (endian == 'big') {
+ val = buffer[offset] << 8;
+ val |= buffer[offset+1];
+ } else {
+ val = buffer[offset];
+ val |= buffer[offset+1] << 8;
+ }
+
+ return (val);
+
+}
+
+function ruint16(buffer, endian, offset)
+{
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset + 1 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ return (rgint16(buffer, endian, offset));
+}
+
+/*
+ * Because most bitshifting is done using signed numbers, if we would go into
+ * the realm where we use that 32nd bit, we'll end up going into the negative
+ * range. i.e.:
+ * > 200 << 24
+ * -939524096
+ *
+ * Not the value you'd expect. To work around this, we end up having to do some
+ * abuse of the JavaScript standard. in this case, we know that a >>> shift is
+ * defined to cast our value to an *unsigned* 32-bit number. Because of that, we
+ * use that instead to save us some additional math, though it does feel a
+ * little weird and it isn't obvious as to why you woul dwant to do this at
+ * first.
+ */
+function rgint32(buffer, endian, offset)
+{
+ var val = 0;
+
+ if (endian == 'big') {
+ val = buffer[offset+1] << 16;
+ val |= buffer[offset+2] << 8;
+ val |= buffer[offset+3];
+ val = val + (buffer[offset] << 24 >>> 0);
+ } else {
+ val = buffer[offset+2] << 16;
+ val |= buffer[offset+1] << 8;
+ val |= buffer[offset];
+ val = val + (buffer[offset + 3] << 24 >>> 0);
+ }
+
+ return (val);
+}
+
+function ruint32(buffer, endian, offset)
+{
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset + 3 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ return (rgint32(buffer, endian, offset));
+}
+
+/*
+ * Reads a 64-bit unsigned number. The astue observer will note that this
+ * doesn't quite work. Javascript has chosen to only have numbers that can be
+ * represented by a double. A double only has 52 bits of mantissa with an
+ * implicit 1, thus we have up to 53 bits to represent an integer. However, 2^53
+ * doesn't quite give us what we want. Isn't 53 bits enough for anyone? What
+ * could you have possibly wanted to represent that was larger than that? Oh,
+ * maybe a size? You mean we bypassed the 4 GB limit on file sizes, when did
+ * that happen?
+ *
+ * To get around this egregious language issue, we're going to instead construct
+ * an array of two 32 bit unsigned integers. Where arr[0] << 32 + arr[1] would
+ * give the actual number. However, note that the above code probably won't
+ * produce the desired results because of the way Javascript numbers are
+ * doubles.
+ */
+function rgint64(buffer, endian, offset)
+{
+ var val = new Array(2);
+
+ if (endian == 'big') {
+ val[0] = ruint32(buffer, endian, offset);
+ val[1] = ruint32(buffer, endian, offset+4);
+ } else {
+ val[0] = ruint32(buffer, endian, offset+4);
+ val[1] = ruint32(buffer, endian, offset);
+ }
+
+ return (val);
+}
+
+function ruint64(buffer, endian, offset)
+{
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset + 7 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ return (rgint64(buffer, endian, offset));
+}
+
+
+/*
+ * Signed integer types, yay team! A reminder on how two's complement actually
+ * works. The first bit is the signed bit, i.e. tells us whether or not the
+ * number should be positive or negative. If the two's complement value is
+ * positive, then we're done, as it's equivalent to the unsigned representation.
+ *
+ * Now if the number is positive, you're pretty much done, you can just leverage
+ * the unsigned translations and return those. Unfortunately, negative numbers
+ * aren't quite that straightforward.
+ *
+ * At first glance, one might be inclined to use the traditional formula to
+ * translate binary numbers between the positive and negative values in two's
+ * complement. (Though it doesn't quite work for the most negative value)
+ * Mainly:
+ * - invert all the bits
+ * - add one to the result
+ *
+ * Of course, this doesn't quite work in Javascript. Take for example the value
+ * of -128. This could be represented in 16 bits (big-endian) as 0xff80. But of
+ * course, Javascript will do the following:
+ *
+ * > ~0xff80
+ * -65409
+ *
+ * Whoh there, Javascript, that's not quite right. But wait, according to
+ * Javascript that's perfectly correct. When Javascript ends up seeing the
+ * constant 0xff80, it has no notion that it is actually a signed number. It
+ * assumes that we've input the unsigned value 0xff80. Thus, when it does the
+ * binary negation, it casts it into a signed value, (positive 0xff80). Then
+ * when you perform binary negation on that, it turns it into a negative number.
+ *
+ * Instead, we're going to have to use the following general formula, that works
+ * in a rather Javascript friendly way. I'm glad we don't support this kind of
+ * weird numbering scheme in the kernel.
+ *
+ * (BIT-MAX - (unsigned)val + 1) * -1
+ *
+ * The astute observer, may think that this doesn't make sense for 8-bit numbers
+ * (really it isn't necessary for them). However, when you get 16-bit numbers,
+ * you do. Let's go back to our prior example and see how this will look:
+ *
+ * (0xffff - 0xff80 + 1) * -1
+ * (0x007f + 1) * -1
+ * (0x0080) * -1
+ *
+ * Doing it this way ends up allowing us to treat it appropriately in
+ * Javascript. Sigh, that's really quite ugly for what should just be a few bit
+ * shifts, ~ and &.
+ */
+
+/*
+ * Endianness doesn't matter for 8-bit signed values. We could in fact optimize
+ * this case because the more traditional methods work, but for consistency,
+ * we'll keep doing this the same way.
+ */
+function rsint8(buffer, endian, offset)
+{
+ var neg;
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ neg = buffer[offset] & 0x80;
+ if (!neg)
+ return (buffer[offset]);
+
+ return ((0xff - buffer[offset] + 1) * -1);
+}
+
+/*
+ * The 16-bit version requires a bit more effort. In this case, we can leverage
+ * our unsigned code to generate the value we want to return.
+ */
+function rsint16(buffer, endian, offset)
+{
+ var neg, val;
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset + 1 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ val = rgint16(buffer, endian, offset);
+ neg = val & 0x8000;
+ if (!neg)
+ return (val);
+
+ return ((0xffff - val + 1) * -1);
+}
+
+/*
+ * We really shouldn't leverage our 32-bit code here and instead utilize the
+ * fact that we know that since these are signed numbers, we can do all the
+ * shifting and binary anding to generate the 32-bit number. But, for
+ * consistency we'll do the same. If we want to do otherwise, we should instead
+ * make the 32 bit unsigned code do the optimization. But as long as there
+ * aren't floats secretly under the hood for that, we /should/ be okay.
+ */
+function rsint32(buffer, endian, offset)
+{
+ var neg, val;
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset + 3 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ val = rgint32(buffer, endian, offset);
+ neg = val & 0x80000000;
+ if (!neg)
+ return (val);
+
+ return ((0xffffffff - val + 1) * -1);
+}
+
+/*
+ * The signed version of this code suffers from all of the same problems of the
+ * other 64 bit version.
+ */
+function rsint64(buffer, endian, offset)
+{
+ var neg, val;
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset + 3 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ val = rgint64(buffer, endian, offset);
+ neg = val[0] & 0x80000000;
+
+ if (!neg)
+ return (val);
+
+ val[0] = (0xffffffff - val[0]) * -1;
+ val[1] = (0xffffffff - val[1] + 1) * -1;
+
+ /*
+ * If we had the key 0x8000000000000000, that would leave the lower 32
+ * bits as 0xffffffff, however, since we're goint to add one, that would
+ * actually leave the lower 32-bits as 0x100000000, which would break
+ * our ability to write back a value that we received. To work around
+ * this, if we actually get that value, we're going to bump the upper
+ * portion by 1 and set this to zero.
+ */
+ mod_assert.ok(val[1] <= 0x100000000);
+ if (val[1] == -0x100000000) {
+ val[1] = 0;
+ val[0]--;
+ }
+
+ return (val);
+}
+
+/*
+ * We now move onto IEEE 754: The traditional form for floating point numbers
+ * and what is secretly hiding at the heart of everything in this. I really hope
+ * that someone is actually using this, as otherwise, this effort is probably
+ * going to be more wasted.
+ *
+ * One might be tempted to use parseFloat here, but that wouldn't work at all
+ * for several reasons. Mostly due to the way floats actually work, and
+ * parseFloat only actually works in base 10. I don't see base 10 anywhere near
+ * this file.
+ *
+ * In this case we'll implement the single and double precision versions. The
+ * quadruple precision, while probably useful, wouldn't really be accepted by
+ * Javascript, so let's not even waste our time.
+ *
+ * So let's review how this format looks like. A single precision value is 32
+ * bits and has three parts:
+ * - Sign bit
+ * - Exponent (Using bias notation)
+ * - Mantissa
+ *
+ * |s|eeeeeeee|mmmmmmmmmmmmmmmmmmmmmmmmm|
+ * 31| 30-23 | 22 - 0 |
+ *
+ * The exponent is stored in a biased input. The bias in this case 127.
+ * Therefore, our exponent is equal to the 8-bit value - 127.
+ *
+ * By default, a number is normalized in IEEE, that means that the mantissa has
+ * an implicit one that we don't see. So really the value stored is 1.m.
+ * However, if the exponent is all zeros, then instead we have to shift
+ * everything to the right one and there is no more implicit one.
+ *
+ * Special values:
+ * - Positive Infinity:
+ * Sign: 0
+ * Exponent: All 1s
+ * Mantissa: 0
+ * - Negative Infinity:
+ * Sign: 1
+ * Exponent: All 1s
+ * Mantissa: 0
+ * - NaN:
+ * Sign: *
+ * Exponent: All 1s
+ * Mantissa: non-zero
+ * - Zero:
+ * Sign: *
+ * Exponent: All 0s
+ * Mantissa: 0
+ *
+ * In the case of zero, the sign bit determines whether we get a positive or
+ * negative zero. However, since Javascript cannot determine the difference
+ * between the two: i.e. -0 == 0, we just always return 0.
+ *
+ */
+function rfloat(buffer, endian, offset)
+{
+ var bytes = [];
+ var sign, exponent, mantissa, val;
+ var bias = 127;
+ var maxexp = 0xff;
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset + 3 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ /* Normalize the bytes to be in endian order */
+ if (endian == 'big') {
+ bytes[0] = buffer[offset];
+ bytes[1] = buffer[offset+1];
+ bytes[2] = buffer[offset+2];
+ bytes[3] = buffer[offset+3];
+ } else {
+ bytes[3] = buffer[offset];
+ bytes[2] = buffer[offset+1];
+ bytes[1] = buffer[offset+2];
+ bytes[0] = buffer[offset+3];
+ }
+
+ sign = bytes[0] & 0x80;
+ exponent = (bytes[0] & 0x7f) << 1;
+ exponent |= (bytes[1] & 0x80) >>> 7;
+ mantissa = (bytes[1] & 0x7f) << 16;
+ mantissa |= bytes[2] << 8;
+ mantissa |= bytes[3];
+
+ /* Check for special cases before we do general parsing */
+ if (!sign && exponent == maxexp && mantissa === 0)
+ return (Number.POSITIVE_INFINITY);
+
+ if (sign && exponent == maxexp && mantissa === 0)
+ return (Number.NEGATIVE_INFINITY);
+
+ if (exponent == maxexp && mantissa !== 0)
+ return (Number.NaN);
+
+ /*
+ * Javascript really doesn't have support for positive or negative zero.
+ * So we're not going to try and give it to you. That would be just
+ * plain weird. Besides -0 == 0.
+ */
+ if (exponent === 0 && mantissa === 0)
+ return (0);
+
+ /*
+ * Now we can deal with the bias and the determine whether the mantissa
+ * has the implicit one or not.
+ */
+ exponent -= bias;
+ if (exponent == -bias) {
+ exponent++;
+ val = 0;
+ } else {
+ val = 1;
+ }
+
+ val = (val + mantissa * Math.pow(2, -23)) * Math.pow(2, exponent);
+
+ if (sign)
+ val *= -1;
+
+ return (val);
+}
+
+/*
+ * Doubles in IEEE 754 are like their brothers except for a few changes and
+ * increases in size:
+ * - The exponent is now 11 bits
+ * - The mantissa is now 52 bits
+ * - The bias is now 1023
+ *
+ * |s|eeeeeeeeeee|mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm|
+ * 63| 62 - 52 | 51 - 0 |
+ * 63| 62 - 52 | 51 - 0 |
+ *
+ * While the size has increased a fair amount, we're going to end up keeping the
+ * same general formula for calculating the final value. As a reminder, this
+ * formula is:
+ *
+ * (-1)^s * (n + m) * 2^(e-b)
+ *
+ * Where:
+ * s is the sign bit
+ * n is (exponent > 0) ? 1 : 0 -- Determines whether we're normalized
+ * or not
+ * m is the mantissa
+ * e is the exponent specified
+ * b is the bias for the exponent
+ *
+ */
+function rdouble(buffer, endian, offset)
+{
+ var bytes = [];
+ var sign, exponent, mantissa, val, lowmant;
+ var bias = 1023;
+ var maxexp = 0x7ff;
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset + 7 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ /* Normalize the bytes to be in endian order */
+ if (endian == 'big') {
+ bytes[0] = buffer[offset];
+ bytes[1] = buffer[offset+1];
+ bytes[2] = buffer[offset+2];
+ bytes[3] = buffer[offset+3];
+ bytes[4] = buffer[offset+4];
+ bytes[5] = buffer[offset+5];
+ bytes[6] = buffer[offset+6];
+ bytes[7] = buffer[offset+7];
+ } else {
+ bytes[7] = buffer[offset];
+ bytes[6] = buffer[offset+1];
+ bytes[5] = buffer[offset+2];
+ bytes[4] = buffer[offset+3];
+ bytes[3] = buffer[offset+4];
+ bytes[2] = buffer[offset+5];
+ bytes[1] = buffer[offset+6];
+ bytes[0] = buffer[offset+7];
+ }
+
+ /*
+ * We can construct the exponent and mantissa the same way as we did in
+ * the case of a float, just increase the range of the exponent.
+ */
+ sign = bytes[0] & 0x80;
+ exponent = (bytes[0] & 0x7f) << 4;
+ exponent |= (bytes[1] & 0xf0) >>> 4;
+
+ /*
+ * This is going to be ugly but then again, we're dealing with IEEE 754.
+ * This could probably be done as a node add on in a few lines of C++,
+ * but oh we'll, we've made it this far so let's be native the rest of
+ * the way...
+ *
+ * What we're going to do is break the mantissa into two parts, the
+ * lower 24 bits and the upper 28 bits. We'll multiply the upper 28 bits
+ * by the appropriate power and then add in the lower 24-bits. Not
+ * really that great. It's pretty much a giant kludge to deal with
+ * Javascript eccentricities around numbers.
+ */
+ lowmant = bytes[7];
+ lowmant |= bytes[6] << 8;
+ lowmant |= bytes[5] << 16;
+ mantissa = bytes[4];
+ mantissa |= bytes[3] << 8;
+ mantissa |= bytes[2] << 16;
+ mantissa |= (bytes[1] & 0x0f) << 24;
+ mantissa *= Math.pow(2, 24); /* Equivalent to << 24, but JS compat */
+ mantissa += lowmant;
+
+ /* Check for special cases before we do general parsing */
+ if (!sign && exponent == maxexp && mantissa === 0)
+ return (Number.POSITIVE_INFINITY);
+
+ if (sign && exponent == maxexp && mantissa === 0)
+ return (Number.NEGATIVE_INFINITY);
+
+ if (exponent == maxexp && mantissa !== 0)
+ return (Number.NaN);
+
+ /*
+ * Javascript really doesn't have support for positive or negative zero.
+ * So we're not going to try and give it to you. That would be just
+ * plain weird. Besides -0 == 0.
+ */
+ if (exponent === 0 && mantissa === 0)
+ return (0);
+
+ /*
+ * Now we can deal with the bias and the determine whether the mantissa
+ * has the implicit one or not.
+ */
+ exponent -= bias;
+ if (exponent == -bias) {
+ exponent++;
+ val = 0;
+ } else {
+ val = 1;
+ }
+
+ val = (val + mantissa * Math.pow(2, -52)) * Math.pow(2, exponent);
+
+ if (sign)
+ val *= -1;
+
+ return (val);
+}
+
+/*
+ * Now that we have gone through the pain of reading the individual types, we're
+ * probably going to want some way to write these back. None of this is going to
+ * be good. But since we have Javascript numbers this should certainly be more
+ * interesting. Though we can constrain this end a little bit more in what is
+ * valid. For now, let's go back to our friends the unsigned value.
+ */
+
+/*
+ * Unsigned numbers seem deceptively easy. Here are the general steps and rules
+ * that we are going to take:
+ * - If the number is negative, throw an Error
+ * - Truncate any floating point portion
+ * - Take the modulus of the number in our base
+ * - Write it out to the buffer in the endian format requested at the offset
+ */
+
+/*
+ * We have to make sure that the value is a valid integer. This means that it is
+ * non-negative. It has no fractional component and that it does not exceed the
+ * maximum allowed value.
+ *
+ * value The number to check for validity
+ *
+ * max The maximum value
+ */
+function prepuint(value, max)
+{
+ if (typeof (value) != 'number')
+ throw (new (Error('cannot write a non-number as a number')));
+
+ if (value < 0)
+ throw (new Error('specified a negative value for writing an ' +
+ 'unsigned value'));
+
+ if (value > max)
+ throw (new Error('value is larger than maximum value for ' +
+ 'type'));
+
+ if (Math.floor(value) !== value)
+ throw (new Error('value has a fractional component'));
+
+ return (value);
+}
+
+/*
+ * 8-bit version, classy. We can ignore endianness which is good.
+ */
+function wuint8(value, endian, buffer, offset)
+{
+ var val;
+
+ if (value === undefined)
+ throw (new Error('missing value'));
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ val = prepuint(value, 0xff);
+ buffer[offset] = val;
+}
+
+/*
+ * Pretty much the same as the 8-bit version, just this time we need to worry
+ * about endian related issues.
+ */
+function wgint16(val, endian, buffer, offset)
+{
+ if (endian == 'big') {
+ buffer[offset] = (val & 0xff00) >>> 8;
+ buffer[offset+1] = val & 0x00ff;
+ } else {
+ buffer[offset+1] = (val & 0xff00) >>> 8;
+ buffer[offset] = val & 0x00ff;
+ }
+}
+
+function wuint16(value, endian, buffer, offset)
+{
+ var val;
+
+ if (value === undefined)
+ throw (new Error('missing value'));
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset + 1 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ val = prepuint(value, 0xffff);
+ wgint16(val, endian, buffer, offset);
+}
+
+/*
+ * The 32-bit version is going to have to be a little different unfortunately.
+ * We can't quite bitshift to get the largest byte, because that would end up
+ * getting us caught by the signed values.
+ *
+ * And yes, we do want to subtract out the lower part by default. This means
+ * that when we do the division, it will be treated as a bit shift and we won't
+ * end up generating a floating point value. If we did generate a floating point
+ * value we'd have to truncate it intelligently, this saves us that problem and
+ * may even be somewhat faster under the hood.
+ */
+function wgint32(val, endian, buffer, offset)
+{
+ if (endian == 'big') {
+ buffer[offset] = (val - (val & 0x00ffffff)) / Math.pow(2, 24);
+ buffer[offset+1] = (val >>> 16) & 0xff;
+ buffer[offset+2] = (val >>> 8) & 0xff;
+ buffer[offset+3] = val & 0xff;
+ } else {
+ buffer[offset+3] = (val - (val & 0x00ffffff)) /
+ Math.pow(2, 24);
+ buffer[offset+2] = (val >>> 16) & 0xff;
+ buffer[offset+1] = (val >>> 8) & 0xff;
+ buffer[offset] = val & 0xff;
+ }
+}
+
+function wuint32(value, endian, buffer, offset)
+{
+ var val;
+
+ if (value === undefined)
+ throw (new Error('missing value'));
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset + 3 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ val = prepuint(value, 0xffffffff);
+ wgint32(val, endian, buffer, offset);
+}
+
+/*
+ * Unlike the other versions, we expect the value to be in the form of two
+ * arrays where value[0] << 32 + value[1] would result in the value that we
+ * want.
+ */
+function wgint64(value, endian, buffer, offset)
+{
+ if (endian == 'big') {
+ wgint32(value[0], endian, buffer, offset);
+ wgint32(value[1], endian, buffer, offset+4);
+ } else {
+ wgint32(value[0], endian, buffer, offset+4);
+ wgint32(value[1], endian, buffer, offset);
+ }
+}
+
+function wuint64(value, endian, buffer, offset)
+{
+ if (value === undefined)
+ throw (new Error('missing value'));
+
+ if (!(value instanceof Array))
+ throw (new Error('value must be an array'));
+
+ if (value.length != 2)
+ throw (new Error('value must be an array of length 2'));
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset + 7 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ prepuint(value[0], 0xffffffff);
+ prepuint(value[1], 0xffffffff);
+ wgint64(value, endian, buffer, offset);
+}
+
+/*
+ * We now move onto our friends in the signed number category. Unlike unsigned
+ * numbers, we're going to have to worry a bit more about how we put values into
+ * arrays. Since we are only worrying about signed 32-bit values, we're in
+ * slightly better shape. Unfortunately, we really can't do our favorite binary
+ * & in this system. It really seems to do the wrong thing. For example:
+ *
+ * > -32 & 0xff
+ * 224
+ *
+ * What's happening above is really: 0xe0 & 0xff = 0xe0. However, the results of
+ * this aren't treated as a signed number. Ultimately a bad thing.
+ *
+ * What we're going to want to do is basically create the unsigned equivalent of
+ * our representation and pass that off to the wuint* functions. To do that
+ * we're going to do the following:
+ *
+ * - if the value is positive
+ * we can pass it directly off to the equivalent wuint
+ * - if the value is negative
+ * we do the following computation:
+ * mb + val + 1, where
+ * mb is the maximum unsigned value in that byte size
+ * val is the Javascript negative integer
+ *
+ *
+ * As a concrete value, take -128. In signed 16 bits this would be 0xff80. If
+ * you do out the computations:
+ *
+ * 0xffff - 128 + 1
+ * 0xffff - 127
+ * 0xff80
+ *
+ * You can then encode this value as the signed version. This is really rather
+ * hacky, but it should work and get the job done which is our goal here.
+ *
+ * Thus the overall flow is:
+ * - Truncate the floating point part of the number
+ * - We don't have to take the modulus, because the unsigned versions will
+ * take care of that for us. And we don't have to worry about that
+ * potentially causing bad things to happen because of sign extension
+ * - Pass it off to the appropriate unsigned version, potentially modifying
+ * the negative portions as necessary.
+ */
+
+/*
+ * A series of checks to make sure we actually have a signed 32-bit number
+ */
+function prepsint(value, max, min)
+{
+ if (typeof (value) != 'number')
+ throw (new (Error('cannot write a non-number as a number')));
+
+ if (value > max)
+ throw (new Error('value larger than maximum allowed value'));
+
+ if (value < min)
+ throw (new Error('value smaller than minimum allowed value'));
+
+ if (Math.floor(value) !== value)
+ throw (new Error('value has a fractional component'));
+
+ return (value);
+}
+
+/*
+ * The 8-bit version of the signed value. Overall, fairly straightforward.
+ */
+function wsint8(value, endian, buffer, offset)
+{
+ var val;
+
+ if (value === undefined)
+ throw (new Error('missing value'));
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ val = prepsint(value, 0x7f, -0x80);
+ if (val >= 0)
+ wuint8(val, endian, buffer, offset);
+ else
+ wuint8(0xff + val + 1, endian, buffer, offset);
+}
+
+/*
+ * The 16-bit version of the signed value. Also, fairly straightforward.
+ */
+function wsint16(value, endian, buffer, offset)
+{
+ var val;
+
+ if (value === undefined)
+ throw (new Error('missing value'));
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset + 1 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ val = prepsint(value, 0x7fff, -0x8000);
+ if (val >= 0)
+ wgint16(val, endian, buffer, offset);
+ else
+ wgint16(0xffff + val + 1, endian, buffer, offset);
+
+}
+
+/*
+ * We can do this relatively easily by leveraging the code used for 32-bit
+ * unsigned code.
+ */
+function wsint32(value, endian, buffer, offset)
+{
+ var val;
+
+ if (value === undefined)
+ throw (new Error('missing value'));
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset + 3 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ val = prepsint(value, 0x7fffffff, -0x80000000);
+ if (val >= 0)
+ wgint32(val, endian, buffer, offset);
+ else
+ wgint32(0xffffffff + val + 1, endian, buffer, offset);
+}
+
+/*
+ * The signed 64 bit integer should by in the same format as when received.
+ * Mainly it should ensure that the value is an array of two integers where
+ * value[0] << 32 + value[1] is the desired number. Furthermore, the two values
+ * need to be equal.
+ */
+function wsint64(value, endian, buffer, offset)
+{
+ var vzpos, vopos;
+ var vals = new Array(2);
+
+ if (value === undefined)
+ throw (new Error('missing value'));
+
+ if (!(value instanceof Array))
+ throw (new Error('value must be an array'));
+
+ if (value.length != 2)
+ throw (new Error('value must be an array of length 2'));
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+ if (offset + 7 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ /*
+ * We need to make sure that we have the same sign on both values. The
+ * hokiest way to to do this is to multiply the number by +inf. If we do
+ * this, we'll get either +/-inf depending on the sign of the value.
+ * Once we have this, we can compare it to +inf to see if the number is
+ * positive or not.
+ */
+ vzpos = (value[0] * Number.POSITIVE_INFINITY) ==
+ Number.POSITIVE_INFINITY;
+ vopos = (value[1] * Number.POSITIVE_INFINITY) ==
+ Number.POSITIVE_INFINITY;
+
+ /*
+ * If either of these is zero, then we don't actually need this check.
+ */
+ if (value[0] != 0 && value[1] != 0 && vzpos != vopos)
+ throw (new Error('Both entries in the array must have ' +
+ 'the same sign'));
+
+ /*
+ * Doing verification for a signed 64-bit integer is actually a big
+ * trickier than it appears. We can't quite use our standard techniques
+ * because we need to compare both sets of values. The first value is
+ * pretty straightforward. If the first value is beond the extremes than
+ * we error out. However, the valid range of the second value varies
+ * based on the first one. If the first value is negative, and *not* the
+ * largest negative value, than it can be any integer within the range [
+ * 0, 0xffffffff ]. If it is the largest negative number, it must be
+ * zero.
+ *
+ * If the first number is positive, than it doesn't matter what the
+ * value is. We just simply have to make sure we have a valid positive
+ * integer.
+ */
+ if (vzpos) {
+ prepuint(value[0], 0x7fffffff);
+ prepuint(value[1], 0xffffffff);
+ } else {
+ prepsint(value[0], 0, -0x80000000);
+ prepsint(value[1], 0, -0xffffffff);
+ if (value[0] == -0x80000000 && value[1] != 0)
+ throw (new Error('value smaller than minimum ' +
+ 'allowed value'));
+ }
+
+ /* Fix negative numbers */
+ if (value[0] < 0 || value[1] < 0) {
+ vals[0] = 0xffffffff - Math.abs(value[0]);
+ vals[1] = 0x100000000 - Math.abs(value[1]);
+ if (vals[1] == 0x100000000) {
+ vals[1] = 0;
+ vals[0]++;
+ }
+ } else {
+ vals[0] = value[0];
+ vals[1] = value[1];
+ }
+ wgint64(vals, endian, buffer, offset);
+}
+
+/*
+ * Now we are moving onto the weirder of these, the float and double. For this
+ * we're going to just have to do something that's pretty weird. First off, we
+ * have no way to get at the underlying float representation, at least not
+ * easily. But that doesn't mean we can't figure it out, we just have to use our
+ * heads.
+ *
+ * One might propose to use Number.toString(2). Of course, this is not really
+ * that good, because the ECMAScript 262 v3 Standard says the following Section
+ * 15.7.4.2-Number.prototype.toString (radix):
+ *
+ * If radix is an integer from 2 to 36, but not 10, the result is a string, the
+ * choice of which is implementation-dependent.
+ *
+ * Well that doesn't really help us one bit now does it? We could use the
+ * standard base 10 version of the string, but that's just going to create more
+ * errors as we end up trying to convert it back to a binary value. So, really
+ * this just means we have to be non-lazy and parse the structure intelligently.
+ *
+ * First off, we can do the basic checks: NaN, positive and negative infinity.
+ *
+ * Now that those are done we can work backwards to generate the mantissa and
+ * exponent.
+ *
+ * The first thing we need to do is determine the sign bit, easy to do, check
+ * whether the value is less than 0. And convert the number to its absolute
+ * value representation. Next, we need to determine if the value is less than
+ * one or greater than or equal to one and from there determine what power was
+ * used to get there. What follows is now specific to floats, though the general
+ * ideas behind this will hold for doubles as well, but the exact numbers
+ * involved will change.
+ *
+ * Once we have that power we can determine the exponent and the mantissa. Call
+ * the value that has the number of bits to reach the power ebits. In the
+ * general case they have the following values:
+ *
+ * exponent 127 + ebits
+ * mantissa value * 2^(23 - ebits) & 0x7fffff
+ *
+ * In the case where the value of ebits is <= -127 we are now in the case where
+ * we no longer have normalized numbers. In this case the values take on the
+ * following values:
+ *
+ * exponent 0
+ * mantissa value * 2^149 & 0x7fffff
+ *
+ * Once we have the values for the sign, mantissa, and exponent. We reconstruct
+ * the four bytes as follows:
+ *
+ * byte0 sign bit and seven most significant bits from the exp
+ * sign << 7 | (exponent & 0xfe) >>> 1
+ *
+ * byte1 lsb from the exponent and 7 top bits from the mantissa
+ * (exponent & 0x01) << 7 | (mantissa & 0x7f0000) >>> 16
+ *
+ * byte2 bits 8-15 (zero indexing) from mantissa
+ * mantissa & 0xff00 >> 8
+ *
+ * byte3 bits 0-7 from mantissa
+ * mantissa & 0xff
+ *
+ * Once we have this we have to assign them into the buffer in proper endian
+ * order.
+ */
+
+/*
+ * Compute the log base 2 of the value. Now, someone who remembers basic
+ * properties of logarithms will point out that we could use the change of base
+ * formula for logs, and in fact that would be astute, because that's what we'll
+ * do for now. It feels cleaner, albeit it may be less efficient than just
+ * iterating and dividing by 2. We may want to come back and revisit that some
+ * day.
+ */
+function log2(value)
+{
+ return (Math.log(value) / Math.log(2));
+}
+
+/*
+ * Helper to determine the exponent of the number we're looking at.
+ */
+function intexp(value)
+{
+ return (Math.floor(log2(value)));
+}
+
+/*
+ * Helper to determine the exponent of the fractional part of the value.
+ */
+function fracexp(value)
+{
+ return (Math.floor(log2(value)));
+}
+
+function wfloat(value, endian, buffer, offset)
+{
+ var sign, exponent, mantissa, ebits;
+ var bytes = [];
+
+ if (value === undefined)
+ throw (new Error('missing value'));
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+
+ if (offset + 3 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ if (isNaN(value)) {
+ sign = 0;
+ exponent = 0xff;
+ mantissa = 23;
+ } else if (value == Number.POSITIVE_INFINITY) {
+ sign = 0;
+ exponent = 0xff;
+ mantissa = 0;
+ } else if (value == Number.NEGATIVE_INFINITY) {
+ sign = 1;
+ exponent = 0xff;
+ mantissa = 0;
+ } else {
+ /* Well we have some work to do */
+
+ /* Thankfully the sign bit is trivial */
+ if (value < 0) {
+ sign = 1;
+ value = Math.abs(value);
+ } else {
+ sign = 0;
+ }
+
+ /* Use the correct function to determine number of bits */
+ if (value < 1)
+ ebits = fracexp(value);
+ else
+ ebits = intexp(value);
+
+ /* Time to deal with the issues surrounding normalization */
+ if (ebits <= -127) {
+ exponent = 0;
+ mantissa = (value * Math.pow(2, 149)) & 0x7fffff;
+ } else {
+ exponent = 127 + ebits;
+ mantissa = value * Math.pow(2, 23 - ebits);
+ mantissa &= 0x7fffff;
+ }
+ }
+
+ bytes[0] = sign << 7 | (exponent & 0xfe) >>> 1;
+ bytes[1] = (exponent & 0x01) << 7 | (mantissa & 0x7f0000) >>> 16;
+ bytes[2] = (mantissa & 0x00ff00) >>> 8;
+ bytes[3] = mantissa & 0x0000ff;
+
+ if (endian == 'big') {
+ buffer[offset] = bytes[0];
+ buffer[offset+1] = bytes[1];
+ buffer[offset+2] = bytes[2];
+ buffer[offset+3] = bytes[3];
+ } else {
+ buffer[offset] = bytes[3];
+ buffer[offset+1] = bytes[2];
+ buffer[offset+2] = bytes[1];
+ buffer[offset+3] = bytes[0];
+ }
+}
+
+/*
+ * Now we move onto doubles. Doubles are similar to floats in pretty much all
+ * ways except that the processing isn't quite as straightforward because we
+ * can't always use shifting, i.e. we have > 32 bit values.
+ *
+ * We're going to proceed in an identical fashion to floats and utilize the same
+ * helper functions. All that really is changing are the specific values that we
+ * use to do the calculations. Thus, to review we have to do the following.
+ *
+ * First get the sign bit and convert the value to its absolute value
+ * representation. Next, we determine the number of bits that we used to get to
+ * the value, branching whether the value is greater than or less than 1. Once
+ * we have that value which we will again call ebits, we have to do the
+ * following in the general case:
+ *
+ * exponent 1023 + ebits
+ * mantissa [value * 2^(52 - ebits)] % 2^52
+ *
+ * In the case where the value of ebits <= -1023 we no longer use normalized
+ * numbers, thus like with floats we have to do slightly different processing:
+ *
+ * exponent 0
+ * mantissa [value * 2^1074] % 2^52
+ *
+ * Once we have determined the sign, exponent and mantissa we can construct the
+ * bytes as follows:
+ *
+ * byte0 sign bit and seven most significant bits form the exp
+ * sign << 7 | (exponent & 0x7f0) >>> 4
+ *
+ * byte1 Remaining 4 bits from the exponent and the four most
+ * significant bits from the mantissa 48-51
+ * (exponent & 0x00f) << 4 | mantissa >>> 48
+ *
+ * byte2 Bits 40-47 from the mantissa
+ * (mantissa >>> 40) & 0xff
+ *
+ * byte3 Bits 32-39 from the mantissa
+ * (mantissa >>> 32) & 0xff
+ *
+ * byte4 Bits 24-31 from the mantissa
+ * (mantissa >>> 24) & 0xff
+ *
+ * byte5 Bits 16-23 from the Mantissa
+ * (mantissa >>> 16) & 0xff
+ *
+ * byte6 Bits 8-15 from the mantissa
+ * (mantissa >>> 8) & 0xff
+ *
+ * byte7 Bits 0-7 from the mantissa
+ * mantissa & 0xff
+ *
+ * Now we can't quite do the right shifting that we want in bytes 1 - 3, because
+ * we'll have extended too far and we'll lose those values when we try and do
+ * the shift. Instead we have to use an alternate approach. To try and stay out
+ * of floating point, what we'll do is say that mantissa -= bytes[4-7] and then
+ * divide by 2^32. Once we've done that we can use binary arithmetic. Oof,
+ * that's ugly, but it seems to avoid using floating point (just based on how v8
+ * seems to be optimizing for base 2 arithmetic).
+ */
+function wdouble(value, endian, buffer, offset)
+{
+ var sign, exponent, mantissa, ebits;
+ var bytes = [];
+
+ if (value === undefined)
+ throw (new Error('missing value'));
+
+ if (endian === undefined)
+ throw (new Error('missing endian'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset'));
+
+
+ if (offset + 7 >= buffer.length)
+ throw (new Error('Trying to read beyond buffer length'));
+
+ if (isNaN(value)) {
+ sign = 0;
+ exponent = 0x7ff;
+ mantissa = 23;
+ } else if (value == Number.POSITIVE_INFINITY) {
+ sign = 0;
+ exponent = 0x7ff;
+ mantissa = 0;
+ } else if (value == Number.NEGATIVE_INFINITY) {
+ sign = 1;
+ exponent = 0x7ff;
+ mantissa = 0;
+ } else {
+ /* Well we have some work to do */
+
+ /* Thankfully the sign bit is trivial */
+ if (value < 0) {
+ sign = 1;
+ value = Math.abs(value);
+ } else {
+ sign = 0;
+ }
+
+ /* Use the correct function to determine number of bits */
+ if (value < 1)
+ ebits = fracexp(value);
+ else
+ ebits = intexp(value);
+
+ /*
+ * This is a total hack to determine a denormalized value.
+ * Unfortunately, we sometimes do not get a proper value for
+ * ebits, i.e. we lose the values that would get rounded off.
+ *
+ *
+ * The astute observer may wonder why we would be
+ * multiplying by two Math.pows rather than just summing
+ * them. Well, that's to get around a small bug in the
+ * way v8 seems to implement the function. On occasion
+ * doing:
+ *
+ * foo * Math.pow(2, 1023 + 51)
+ *
+ * Causes us to overflow to infinity, where as doing:
+ *
+ * foo * Math.pow(2, 1023) * Math.pow(2, 51)
+ *
+ * Does not cause us to overflow. Go figure.
+ *
+ */
+ if (value <= 2.225073858507201e-308 || ebits <= -1023) {
+ exponent = 0;
+ mantissa = value * Math.pow(2, 1023) * Math.pow(2, 51);
+ mantissa %= Math.pow(2, 52);
+ } else {
+ /*
+ * We might have gotten fucked by our floating point
+ * logarithm magic. This is rather crappy, but that's
+ * our luck. If we just had a log base 2 or access to
+ * the stupid underlying representation this would have
+ * been much easier and we wouldn't have such stupid
+ * kludges or hacks.
+ */
+ if (ebits > 1023)
+ ebits = 1023;
+ exponent = 1023 + ebits;
+ mantissa = value * Math.pow(2, -ebits);
+ mantissa *= Math.pow(2, 52);
+ mantissa %= Math.pow(2, 52);
+ }
+ }
+
+ /* Fill the bytes in backwards to deal with the size issues */
+ bytes[7] = mantissa & 0xff;
+ bytes[6] = (mantissa >>> 8) & 0xff;
+ bytes[5] = (mantissa >>> 16) & 0xff;
+ mantissa = (mantissa - (mantissa & 0xffffff)) / Math.pow(2, 24);
+ bytes[4] = mantissa & 0xff;
+ bytes[3] = (mantissa >>> 8) & 0xff;
+ bytes[2] = (mantissa >>> 16) & 0xff;
+ bytes[1] = (exponent & 0x00f) << 4 | mantissa >>> 24;
+ bytes[0] = (sign << 7) | (exponent & 0x7f0) >>> 4;
+
+ if (endian == 'big') {
+ buffer[offset] = bytes[0];
+ buffer[offset+1] = bytes[1];
+ buffer[offset+2] = bytes[2];
+ buffer[offset+3] = bytes[3];
+ buffer[offset+4] = bytes[4];
+ buffer[offset+5] = bytes[5];
+ buffer[offset+6] = bytes[6];
+ buffer[offset+7] = bytes[7];
+ } else {
+ buffer[offset+7] = bytes[0];
+ buffer[offset+6] = bytes[1];
+ buffer[offset+5] = bytes[2];
+ buffer[offset+4] = bytes[3];
+ buffer[offset+3] = bytes[4];
+ buffer[offset+2] = bytes[5];
+ buffer[offset+1] = bytes[6];
+ buffer[offset] = bytes[7];
+ }
+}
+
+/*
+ * Actually export our work above. One might argue that we shouldn't expose
+ * these interfaces and just force people to use the higher level abstractions
+ * around this work. However, unlike say other libraries we've come across, this
+ * interface has several properties: it makes sense, it's simple, and it's
+ * useful.
+ */
+exports.ruint8 = ruint8;
+exports.ruint16 = ruint16;
+exports.ruint32 = ruint32;
+exports.ruint64 = ruint64;
+exports.wuint8 = wuint8;
+exports.wuint16 = wuint16;
+exports.wuint32 = wuint32;
+exports.wuint64 = wuint64;
+
+exports.rsint8 = rsint8;
+exports.rsint16 = rsint16;
+exports.rsint32 = rsint32;
+exports.rsint64 = rsint64;
+exports.wsint8 = wsint8;
+exports.wsint16 = wsint16;
+exports.wsint32 = wsint32;
+exports.wsint64 = wsint64;
+
+exports.rfloat = rfloat;
+exports.rdouble = rdouble;
+exports.wfloat = wfloat;
+exports.wdouble = wdouble;
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js b/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js
new file mode 100644
index 000000000..7d2f4a5a6
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js
@@ -0,0 +1,944 @@
+/*
+ * rm - Feb 2011
+ * ctype.js
+ *
+ * This module provides a simple abstraction towards reading and writing
+ * different types of binary data. It is designed to use ctio.js and provide a
+ * richer and more expressive API on top of it.
+ *
+ * By default we support the following as built in basic types:
+ * int8_t
+ * int16_t
+ * int32_t
+ * uint8_t
+ * uint16_t
+ * uint32_t
+ * uint64_t
+ * float
+ * double
+ * char
+ * char[]
+ *
+ * Each type is returned as a Number, with the exception of char and char[]
+ * which are returned as Node Buffers. A char is considered a uint8_t.
+ *
+ * Requests to read and write data are specified as an array of JSON objects.
+ * This is also the same way that one declares structs. Even if just a single
+ * value is requested, it must be done as a struct. The array order determines
+ * the order that we try and read values. Each entry has the following format
+ * with values marked with a * being optional.
+ *
+ * { key: { type: /type/, value*: /value/, offset*: /offset/ }
+ *
+ * If offset is defined, we lseek(offset, SEEK_SET) before reading the next
+ * value. Value is defined when we're writing out data, otherwise it's ignored.
+ *
+ */
+
+var mod_ctf = require('./ctf.js');
+var mod_ctio = require('./ctio.js');
+var mod_assert = require('assert');
+
+/*
+ * This is the set of basic types that we support.
+ *
+ * read The function to call to read in a value from a buffer
+ *
+ * write The function to call to write a value to a buffer
+ *
+ */
+var deftypes = {
+ 'uint8_t': { read: ctReadUint8, write: ctWriteUint8 },
+ 'uint16_t': { read: ctReadUint16, write: ctWriteUint16 },
+ 'uint32_t': { read: ctReadUint32, write: ctWriteUint32 },
+ 'uint64_t': { read: ctReadUint64, write: ctWriteUint64 },
+ 'int8_t': { read: ctReadSint8, write: ctWriteSint8 },
+ 'int16_t': { read: ctReadSint16, write: ctWriteSint16 },
+ 'int32_t': { read: ctReadSint32, write: ctWriteSint32 },
+ 'int64_t': { read: ctReadSint64, write: ctWriteSint64 },
+ 'float': { read: ctReadFloat, write: ctWriteFloat },
+ 'double': { read: ctReadDouble, write: ctWriteDouble },
+ 'char': { read: ctReadChar, write: ctWriteChar },
+ 'char[]': { read: ctReadCharArray, write: ctWriteCharArray }
+};
+
+/*
+ * The following are wrappers around the CType IO low level API. They encode
+ * knowledge about the size and return something in the expected format.
+ */
+function ctReadUint8(endian, buffer, offset)
+{
+ var val = mod_ctio.ruint8(buffer, endian, offset);
+ return ({ value: val, size: 1 });
+}
+
+function ctReadUint16(endian, buffer, offset)
+{
+ var val = mod_ctio.ruint16(buffer, endian, offset);
+ return ({ value: val, size: 2 });
+}
+
+function ctReadUint32(endian, buffer, offset)
+{
+ var val = mod_ctio.ruint32(buffer, endian, offset);
+ return ({ value: val, size: 4 });
+}
+
+function ctReadUint64(endian, buffer, offset)
+{
+ var val = mod_ctio.ruint64(buffer, endian, offset);
+ return ({ value: val, size: 8 });
+}
+
+function ctReadSint8(endian, buffer, offset)
+{
+ var val = mod_ctio.rsint8(buffer, endian, offset);
+ return ({ value: val, size: 1 });
+}
+
+function ctReadSint16(endian, buffer, offset)
+{
+ var val = mod_ctio.rsint16(buffer, endian, offset);
+ return ({ value: val, size: 2 });
+}
+
+function ctReadSint32(endian, buffer, offset)
+{
+ var val = mod_ctio.rsint32(buffer, endian, offset);
+ return ({ value: val, size: 4 });
+}
+
+function ctReadSint64(endian, buffer, offset)
+{
+ var val = mod_ctio.rsint64(buffer, endian, offset);
+ return ({ value: val, size: 8 });
+}
+
+function ctReadFloat(endian, buffer, offset)
+{
+ var val = mod_ctio.rfloat(buffer, endian, offset);
+ return ({ value: val, size: 4 });
+}
+
+function ctReadDouble(endian, buffer, offset)
+{
+ var val = mod_ctio.rdouble(buffer, endian, offset);
+ return ({ value: val, size: 8 });
+}
+
+/*
+ * Reads a single character into a node buffer
+ */
+function ctReadChar(endian, buffer, offset)
+{
+ var res = new Buffer(1);
+ res[0] = mod_ctio.ruint8(buffer, endian, offset);
+ return ({ value: res, size: 1 });
+}
+
+function ctReadCharArray(length, endian, buffer, offset)
+{
+ var ii;
+ var res = new Buffer(length);
+
+ for (ii = 0; ii < length; ii++)
+ res[ii] = mod_ctio.ruint8(buffer, endian, offset + ii);
+
+ return ({ value: res, size: length });
+}
+
+function ctWriteUint8(value, endian, buffer, offset)
+{
+ mod_ctio.wuint8(value, endian, buffer, offset);
+ return (1);
+}
+
+function ctWriteUint16(value, endian, buffer, offset)
+{
+ mod_ctio.wuint16(value, endian, buffer, offset);
+ return (2);
+}
+
+function ctWriteUint32(value, endian, buffer, offset)
+{
+ mod_ctio.wuint32(value, endian, buffer, offset);
+ return (4);
+}
+
+function ctWriteUint64(value, endian, buffer, offset)
+{
+ mod_ctio.wuint64(value, endian, buffer, offset);
+ return (8);
+}
+
+function ctWriteSint8(value, endian, buffer, offset)
+{
+ mod_ctio.wsint8(value, endian, buffer, offset);
+ return (1);
+}
+
+function ctWriteSint16(value, endian, buffer, offset)
+{
+ mod_ctio.wsint16(value, endian, buffer, offset);
+ return (2);
+}
+
+function ctWriteSint32(value, endian, buffer, offset)
+{
+ mod_ctio.wsint32(value, endian, buffer, offset);
+ return (4);
+}
+
+function ctWriteSint64(value, endian, buffer, offset)
+{
+ mod_ctio.wsint64(value, endian, buffer, offset);
+ return (8);
+}
+
+function ctWriteFloat(value, endian, buffer, offset)
+{
+ mod_ctio.wfloat(value, endian, buffer, offset);
+ return (4);
+}
+
+function ctWriteDouble(value, endian, buffer, offset)
+{
+ mod_ctio.wdouble(value, endian, buffer, offset);
+ return (8);
+}
+
+/*
+ * Writes a single character into a node buffer
+ */
+function ctWriteChar(value, endian, buffer, offset)
+{
+ if (!(value instanceof Buffer))
+ throw (new Error('Input must be a buffer'));
+
+ mod_ctio.ruint8(value[0], endian, buffer, offset);
+ return (1);
+}
+
+/*
+ * We're going to write 0s into the buffer if the string is shorter than the
+ * length of the array.
+ */
+function ctWriteCharArray(value, length, endian, buffer, offset)
+{
+ var ii;
+
+ if (!(value instanceof Buffer))
+ throw (new Error('Input must be a buffer'));
+
+ if (value.length > length)
+ throw (new Error('value length greater than array length'));
+
+ for (ii = 0; ii < value.length && ii < length; ii++)
+ mod_ctio.wuint8(value[ii], endian, buffer, offset + ii);
+
+ for (; ii < length; ii++)
+ mod_ctio.wuint8(0, endian, offset + ii);
+
+
+ return (length);
+}
+
+/*
+ * Each parser has their own set of types. We want to make sure that they each
+ * get their own copy as they may need to modify it.
+ */
+function ctGetBasicTypes()
+{
+ var ret = {};
+ var key;
+ for (key in deftypes)
+ ret[key] = deftypes[key];
+
+ return (ret);
+}
+
+/*
+ * Given a string in the form of type[length] we want to split this into an
+ * object that extracts that information. We want to note that we could possibly
+ * have nested arrays so this should only check the furthest one. It may also be
+ * the case that we have no [] pieces, in which case we just return the current
+ * type.
+ */
+function ctParseType(str)
+{
+ var begInd, endInd;
+ var type, len;
+ if (typeof (str) != 'string')
+ throw (new Error('type must be a Javascript string'));
+
+ endInd = str.lastIndexOf(']');
+ if (endInd == -1) {
+ if (str.lastIndexOf('[') != -1)
+ throw (new Error('found invalid type with \'[\' but ' +
+ 'no corresponding \']\''));
+
+ return ({ type: str });
+ }
+
+ begInd = str.lastIndexOf('[');
+ if (begInd == -1)
+ throw (new Error('found invalid type with \']\' but ' +
+ 'no corresponding \'[\''));
+
+ if (begInd >= endInd)
+ throw (new Error('malformed type, \']\' appears before \'[\''));
+
+ type = str.substring(0, begInd);
+ len = str.substring(begInd + 1, endInd);
+
+ return ({ type: type, len: len });
+}
+
+/*
+ * Given a request validate that all of the fields for it are valid and make
+ * sense. This includes verifying the following notions:
+ * - Each type requested is present in types
+ * - Only allow a name for a field to be specified once
+ * - If an array is specified, validate that the requested field exists and
+ * comes before it.
+ * - If fields is defined, check that each entry has the occurrence of field
+ */
+function ctCheckReq(def, types, fields)
+{
+ var ii, jj;
+ var req, keys, key;
+ var found = {};
+
+ if (!(def instanceof Array))
+ throw (new Error('definition is not an array'));
+
+ if (def.length === 0)
+ throw (new Error('definition must have at least one element'));
+
+ for (ii = 0; ii < def.length; ii++) {
+ req = def[ii];
+ if (!(req instanceof Object))
+ throw (new Error('definition must be an array of' +
+ 'objects'));
+
+ keys = Object.keys(req);
+ if (keys.length != 1)
+ throw (new Error('definition entry must only have ' +
+ 'one key'));
+
+ if (keys[0] in found)
+ throw (new Error('Specified name already ' +
+ 'specified: ' + keys[0]));
+
+ if (!('type' in req[keys[0]]))
+ throw (new Error('missing required type definition'));
+
+ key = ctParseType(req[keys[0]]['type']);
+
+ /*
+ * We may have nested arrays, we need to check the validity of
+ * the types until the len field is undefined in key. However,
+ * each time len is defined we need to verify it is either an
+ * integer or corresponds to an already seen key.
+ */
+ while (key['len'] !== undefined) {
+ if (isNaN(parseInt(key['len'], 10))) {
+ if (!(key['len'] in found))
+ throw (new Error('Given an array ' +
+ 'length without a matching type'));
+
+ }
+
+ key = ctParseType(key['type']);
+ }
+
+ /* Now we can validate if the type is valid */
+ if (!(key['type'] in types))
+ throw (new Error('type not found or typdefed: ' +
+ key['type']));
+
+ /* Check for any required fields */
+ if (fields !== undefined) {
+ for (jj = 0; jj < fields.length; jj++) {
+ if (!(fields[jj] in req[keys[0]]))
+ throw (new Error('Missing required ' +
+ 'field: ' + fields[jj]));
+ }
+ }
+
+ found[keys[0]] = true;
+ }
+}
+
+
+/*
+ * Create a new instance of the parser. Each parser has its own store of
+ * typedefs and endianness. Conf is an object with the following required
+ * values:
+ *
+ * endian Either 'big' or 'little' do determine the endianness we
+ * want to read from or write to.
+ *
+ * And the following optional values:
+ *
+ * char-type Valid options here are uint8 and int8. If uint8 is
+ * specified this changes the default behavior of a single
+ * char from being a buffer of a single character to being
+ * a uint8_t. If int8, it becomes an int8_t instead.
+ */
+function CTypeParser(conf)
+{
+ if (!conf) throw (new Error('missing required argument'));
+
+ if (!('endian' in conf))
+ throw (new Error('missing required endian value'));
+
+ if (conf['endian'] != 'big' && conf['endian'] != 'little')
+ throw (new Error('Invalid endian type'));
+
+ if ('char-type' in conf && (conf['char-type'] != 'uint8' &&
+ conf['char-type'] != 'int8'))
+ throw (new Error('invalid option for char-type: ' +
+ conf['char-type']));
+
+ this.endian = conf['endian'];
+ this.types = ctGetBasicTypes();
+
+ /*
+ * There may be a more graceful way to do this, but this will have to
+ * serve.
+ */
+ if ('char-type' in conf && conf['char-type'] == 'uint8')
+ this.types['char'] = this.types['uint8_t'];
+
+ if ('char-type' in conf && conf['char-type'] == 'int8')
+ this.types['char'] = this.types['int8_t'];
+}
+
+/*
+ * Sets the current endian value for the Parser. If the value is not valid,
+ * throws an Error.
+ *
+ * endian Either 'big' or 'little' do determine the endianness we
+ * want to read from or write to.
+ *
+ */
+CTypeParser.prototype.setEndian = function (endian)
+{
+ if (endian != 'big' && endian != 'little')
+ throw (new Error('invalid endian type, must be big or ' +
+ 'little'));
+
+ this.endian = endian;
+};
+
+/*
+ * Returns the current value of the endian value for the parser.
+ */
+CTypeParser.prototype.getEndian = function ()
+{
+ return (this.endian);
+};
+
+/*
+ * A user has requested to add a type, let us honor their request. Yet, if their
+ * request doth spurn us, send them unto the Hells which Dante describes.
+ *
+ * name The string for the type definition we're adding
+ *
+ * value Either a string that is a type/array name or an object
+ * that describes a struct.
+ */
+CTypeParser.prototype.typedef = function (name, value)
+{
+ var type;
+
+ if (name === undefined)
+ throw (new (Error('missing required typedef argument: name')));
+
+ if (value === undefined)
+ throw (new (Error('missing required typedef argument: value')));
+
+ if (typeof (name) != 'string')
+ throw (new (Error('the name of a type must be a string')));
+
+ type = ctParseType(name);
+
+ if (type['len'] !== undefined)
+ throw (new Error('Cannot have an array in the typedef name'));
+
+ if (name in this.types)
+ throw (new Error('typedef name already present: ' + name));
+
+ if (typeof (value) != 'string' && !(value instanceof Array))
+ throw (new Error('typedef value must either be a string or ' +
+ 'struct'));
+
+ if (typeof (value) == 'string') {
+ type = ctParseType(value);
+ if (type['len'] !== undefined) {
+ if (isNaN(parseInt(type['len'], 10)))
+ throw (new (Error('typedef value must use ' +
+ 'fixed size array when outside of a ' +
+ 'struct')));
+ }
+
+ this.types[name] = value;
+ } else {
+ /* We have a struct, validate it */
+ ctCheckReq(value, this.types);
+ this.types[name] = value;
+ }
+};
+
+/*
+ * Include all of the typedefs, but none of the built in types. This should be
+ * treated as read-only.
+ */
+CTypeParser.prototype.lstypes = function ()
+{
+ var key;
+ var ret = {};
+
+ for (key in this.types) {
+ if (key in deftypes)
+ continue;
+ ret[key] = this.types[key];
+ }
+
+ return (ret);
+};
+
+/*
+ * Given a type string that may have array types that aren't numbers, try and
+ * fill them in from the values object. The object should be of the format where
+ * indexing into it should return a number for that type.
+ *
+ * str The type string
+ *
+ * values An object that can be used to fulfill type information
+ */
+function ctResolveArray(str, values)
+{
+ var ret = '';
+ var type = ctParseType(str);
+
+ while (type['len'] !== undefined) {
+ if (isNaN(parseInt(type['len'], 10))) {
+ if (typeof (values[type['len']]) != 'number')
+ throw (new Error('cannot sawp in non-number ' +
+ 'for array value'));
+ ret = '[' + values[type['len']] + ']' + ret;
+ } else {
+ ret = '[' + type['len'] + ']' + ret;
+ }
+ type = ctParseType(type['type']);
+ }
+
+ ret = type['type'] + ret;
+
+ return (ret);
+}
+
+/*
+ * [private] Either the typedef resolves to another type string or to a struct.
+ * If it resolves to a struct, we just pass it off to read struct. If not, we
+ * can just pass it off to read entry.
+ */
+CTypeParser.prototype.resolveTypedef = function (type, dispatch, buffer,
+ offset, value)
+{
+ var pt;
+
+ mod_assert.ok(type in this.types);
+ if (typeof (this.types[type]) == 'string') {
+ pt = ctParseType(this.types[type]);
+ if (dispatch == 'read')
+ return (this.readEntry(pt, buffer, offset));
+ else if (dispatch == 'write')
+ return (this.writeEntry(value, pt, buffer, offset));
+ else
+ throw (new Error('invalid dispatch type to ' +
+ 'resolveTypedef'));
+ } else {
+ if (dispatch == 'read')
+ return (this.readStruct(this.types[type], buffer,
+ offset));
+ else if (dispatch == 'write')
+ return (this.writeStruct(value, this.types[type],
+ buffer, offset));
+ else
+ throw (new Error('invalid dispatch type to ' +
+ 'resolveTypedef'));
+ }
+
+};
+
+/*
+ * [private] Try and read in the specific entry.
+ */
+CTypeParser.prototype.readEntry = function (type, buffer, offset)
+{
+ var parse, len;
+
+ /*
+ * Because we want to special case char[]s this is unfortunately
+ * a bit uglier than it really should be. We want to special
+ * case char[]s so that we return a node buffer, thus they are a
+ * first class type where as all other arrays just call into a
+ * generic array routine which calls their data-specific routine
+ * the specified number of times.
+ *
+ * The valid dispatch options we have are:
+ * - Array and char => char[] handler
+ * - Generic array handler
+ * - Generic typedef handler
+ * - Basic type handler
+ */
+ if (type['len'] !== undefined) {
+ len = parseInt(type['len'], 10);
+ if (isNaN(len))
+ throw (new Error('somehow got a non-numeric length'));
+
+ if (type['type'] == 'char')
+ parse = this.types['char[]']['read'](len,
+ this.endian, buffer, offset);
+ else
+ parse = this.readArray(type['type'],
+ len, buffer, offset);
+ } else {
+ if (type['type'] in deftypes)
+ parse = this.types[type['type']]['read'](this.endian,
+ buffer, offset);
+ else
+ parse = this.resolveTypedef(type['type'], 'read',
+ buffer, offset);
+ }
+
+ return (parse);
+};
+
+/*
+ * [private] Read an array of data
+ */
+CTypeParser.prototype.readArray = function (type, length, buffer, offset)
+{
+ var ii, ent, pt;
+ var baseOffset = offset;
+ var ret = new Array(length);
+ pt = ctParseType(type);
+
+ for (ii = 0; ii < length; ii++) {
+ ent = this.readEntry(pt, buffer, offset);
+ offset += ent['size'];
+ ret[ii] = ent['value'];
+ }
+
+ return ({ value: ret, size: offset - baseOffset });
+};
+
+/*
+ * [private] Read a single struct in.
+ */
+CTypeParser.prototype.readStruct = function (def, buffer, offset)
+{
+ var parse, ii, type, entry, key;
+ var baseOffset = offset;
+ var ret = {};
+
+ /* Walk it and handle doing what's necessary */
+ for (ii = 0; ii < def.length; ii++) {
+ key = Object.keys(def[ii])[0];
+ entry = def[ii][key];
+
+ /* Resolve all array values */
+ type = ctParseType(ctResolveArray(entry['type'], ret));
+
+ if ('offset' in entry)
+ offset = baseOffset + entry['offset'];
+
+ parse = this.readEntry(type, buffer, offset);
+
+ offset += parse['size'];
+ ret[key] = parse['value'];
+ }
+
+ return ({ value: ret, size: (offset-baseOffset)});
+};
+
+/*
+ * This is what we were born to do. We read the data from a buffer and return it
+ * in an object whose keys match the values from the object.
+ *
+ * def The array definition of the data to read in
+ *
+ * buffer The buffer to read data from
+ *
+ * offset The offset to start writing to
+ *
+ * Returns an object where each key corresponds to an entry in def and the value
+ * is the read value.
+ */
+CTypeParser.prototype.readData = function (def, buffer, offset)
+{
+ /* Sanity check for arguments */
+ if (def === undefined)
+ throw (new Error('missing definition for what we should be' +
+ 'parsing'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer for what we should be ' +
+ 'parsing'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset for what we should be ' +
+ 'parsing'));
+
+ /* Sanity check the object definition */
+ ctCheckReq(def, this.types);
+
+ return (this.readStruct(def, buffer, offset)['value']);
+};
+
+/*
+ * [private] Write out an array of data
+ */
+CTypeParser.prototype.writeArray = function (value, type, length, buffer,
+ offset)
+{
+ var ii, pt;
+ var baseOffset = offset;
+ if (!(value instanceof Array))
+ throw (new Error('asked to write an array, but value is not ' +
+ 'an array'));
+
+ if (value.length != length)
+ throw (new Error('asked to write array of length ' + length +
+ ' but that does not match value length: ' + value.length));
+
+ pt = ctParseType(type);
+ for (ii = 0; ii < length; ii++)
+ offset += this.writeEntry(value[ii], pt, buffer, offset);
+
+ return (offset - baseOffset);
+};
+
+/*
+ * [private] Write the specific entry
+ */
+CTypeParser.prototype.writeEntry = function (value, type, buffer, offset)
+{
+ var len, ret;
+
+ if (type['len'] !== undefined) {
+ len = parseInt(type['len'], 10);
+ if (isNaN(len))
+ throw (new Error('somehow got a non-numeric length'));
+
+ if (type['type'] == 'char')
+ ret = this.types['char[]']['write'](value, len,
+ this.endian, buffer, offset);
+ else
+ ret = this.writeArray(value, type['type'],
+ len, buffer, offset);
+ } else {
+ if (type['type'] in deftypes)
+ ret = this.types[type['type']]['write'](value,
+ this.endian, buffer, offset);
+ else
+ ret = this.resolveTypedef(type['type'], 'write',
+ buffer, offset, value);
+ }
+
+ return (ret);
+};
+
+/*
+ * [private] Write a single struct out.
+ */
+CTypeParser.prototype.writeStruct = function (value, def, buffer, offset)
+{
+ var ii, entry, type, key;
+ var baseOffset = offset;
+ var vals = {};
+
+ for (ii = 0; ii < def.length; ii++) {
+ key = Object.keys(def[ii])[0];
+ entry = def[ii][key];
+
+ type = ctParseType(ctResolveArray(entry['type'], vals));
+
+ if ('offset' in entry)
+ offset = baseOffset + entry['offset'];
+
+ offset += this.writeEntry(value[ii], type, buffer, offset);
+ /* Now that we've written it out, we can use it for arrays */
+ vals[key] = value[ii];
+ }
+
+ return (offset);
+};
+
+/*
+ * Unfortunately, we're stuck with the sins of an initial poor design. Because
+ * of that, we are going to have to support the old way of writing data via
+ * writeData. There we insert the values that you want to write into the
+ * definition. A little baroque. Internally, we use the new model. So we need to
+ * just get those values out of there. But to maintain the principle of least
+ * surprise, we're not going to modify the input data.
+ */
+function getValues(def)
+{
+ var ii, out, key;
+ out = [];
+ for (ii = 0; ii < def.length; ii++) {
+ key = Object.keys(def[ii])[0];
+ mod_assert.ok('value' in def[ii][key]);
+ out.push(def[ii][key]['value']);
+ }
+
+ return (out);
+}
+
+/*
+ * This is the second half of what we were born to do, write out the data
+ * itself. Historically this function required you to put your values in the
+ * definition section. This was not the smartest thing to do and a bit of an
+ * oversight to be honest. As such, this function now takes a values argument.
+ * If values is non-null and non-undefined, it will be used to determine the
+ * values. This means that the old method is still supported, but is no longer
+ * acceptable.
+ *
+ * def The array definition of the data to write out with
+ * values
+ *
+ * buffer The buffer to write to
+ *
+ * offset The offset in the buffer to write to
+ *
+ * values An array of values to write.
+ */
+CTypeParser.prototype.writeData = function (def, buffer, offset, values)
+{
+ var hv;
+
+ if (def === undefined)
+ throw (new Error('missing definition for what we should be' +
+ 'parsing'));
+
+ if (buffer === undefined)
+ throw (new Error('missing buffer for what we should be ' +
+ 'parsing'));
+
+ if (offset === undefined)
+ throw (new Error('missing offset for what we should be ' +
+ 'parsing'));
+
+ hv = (values != null && values != undefined);
+ if (hv) {
+ if (!Array.isArray(values))
+ throw (new Error('missing values for writing'));
+ ctCheckReq(def, this.types);
+ } else {
+ ctCheckReq(def, this.types, [ 'value' ]);
+ }
+
+ this.writeStruct(hv ? values : getValues(def), def, buffer, offset);
+};
+
+/*
+ * Functions to go to and from 64 bit numbers in a way that is compatible with
+ * Javascript limitations. There are two sets. One where the user is okay with
+ * an approximation and one where they are definitely not okay with an
+ * approximation.
+ */
+
+/*
+ * Attempts to convert an array of two integers returned from rsint64 / ruint64
+ * into an absolute 64 bit number. If however the value would exceed 2^52 this
+ * will instead throw an error. The mantissa in a double is a 52 bit number and
+ * rather than potentially give you a value that is an approximation this will
+ * error. If you would rather an approximation, please see toApprox64.
+ *
+ * val An array of two 32-bit integers
+ */
+function toAbs64(val)
+{
+ if (val === undefined)
+ throw (new Error('missing required arg: value'));
+
+ if (!Array.isArray(val))
+ throw (new Error('value must be an array'));
+
+ if (val.length != 2)
+ throw (new Error('value must be an array of length 2'));
+
+ /* We have 20 bits worth of precision in this range */
+ if (val[0] >= 0x100000)
+ throw (new Error('value would become approximated'));
+
+ return (val[0] * Math.pow(2, 32) + val[1]);
+}
+
+/*
+ * Will return the 64 bit value as returned in an array from rsint64 / ruint64
+ * to a value as close as it can. Note that Javascript stores all numbers as a
+ * double and the mantissa only has 52 bits. Thus this version may approximate
+ * the value.
+ *
+ * val An array of two 32-bit integers
+ */
+function toApprox64(val)
+{
+ if (val === undefined)
+ throw (new Error('missing required arg: value'));
+
+ if (!Array.isArray(val))
+ throw (new Error('value must be an array'));
+
+ if (val.length != 2)
+ throw (new Error('value must be an array of length 2'));
+
+ return (Math.pow(2, 32) * val[0] + val[1]);
+}
+
+function parseCTF(json, conf)
+{
+ var ctype = new CTypeParser(conf);
+ mod_ctf.ctfParseJson(json, ctype);
+
+ return (ctype);
+}
+
+/*
+ * Export the few things we actually want to. Currently this is just the CType
+ * Parser and ctio.
+ */
+exports.Parser = CTypeParser;
+exports.toAbs64 = toAbs64;
+exports.toApprox64 = toApprox64;
+
+exports.parseCTF = parseCTF;
+
+exports.ruint8 = mod_ctio.ruint8;
+exports.ruint16 = mod_ctio.ruint16;
+exports.ruint32 = mod_ctio.ruint32;
+exports.ruint64 = mod_ctio.ruint64;
+exports.wuint8 = mod_ctio.wuint8;
+exports.wuint16 = mod_ctio.wuint16;
+exports.wuint32 = mod_ctio.wuint32;
+exports.wuint64 = mod_ctio.wuint64;
+
+exports.rsint8 = mod_ctio.rsint8;
+exports.rsint16 = mod_ctio.rsint16;
+exports.rsint32 = mod_ctio.rsint32;
+exports.rsint64 = mod_ctio.rsint64;
+exports.wsint8 = mod_ctio.wsint8;
+exports.wsint16 = mod_ctio.wsint16;
+exports.wsint32 = mod_ctio.wsint32;
+exports.wsint64 = mod_ctio.wsint64;
+
+exports.rfloat = mod_ctio.rfloat;
+exports.rdouble = mod_ctio.rdouble;
+exports.wfloat = mod_ctio.wfloat;
+exports.wdouble = mod_ctio.wdouble;
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype b/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype
new file mode 100644
index 000000000..3f94986a1
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype
@@ -0,0 +1,241 @@
+'\" te
+.\" Copyright (c) 2011, Robert Mustacchi. All Rights Reserved.
+.\" Copyright (c) 2011, Joyent, Inc. All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining a copy
+.\" of this software and associated documentation files (the "Software"), to
+.\" deal in the Software without restriction, including without limitation the
+.\" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+.\" sell copies of the Software, and to permit persons to whom the Software is
+.\" furnished to do so, subject to the following conditions:
+.\"
+.\" The above copyright notice and this permission notice shall be included in
+.\" all copies or substantial portions of the Software.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+.\" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+.\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+.\" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+.\" IN THE SOFTWARE.
+.TH CTIO 3CTYPE "December 12, 2011"
+.SH NAME
+ctio, ruint8, ruint16, ruint32, ruint64, wuint8, wuint16, wuint32, wuint64,
+rsint8, rsint16, rsint32, rsint64, wsint8, wsint16, wsint32, wsint64, rfloat,
+rdouble, wfloat, wdouble \- integer and float operations
+.SH SYNOPSIS
+.LP
+.nf
+var mod_ctype = require('ctype');
+
+\fBNumber\fR \fBmod_ctype.ruint8\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.ruint16\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.ruint32\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber[2]\fR \fBmod_ctype.ruint64\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.rsint8\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.rsint16\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.rsint32\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber[2]\fR \fBmod_ctype.rsint64\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.rfloat\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.rdouble\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wuint8\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wuint16\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wuint32\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wuint64\fR(\fBNumber[2]\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wsint8\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wsint16\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wsint32\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wsint64\fR(\fBNumber[2]\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wfloat\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wdouble\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The argument \fIbuf\fR refers to a valid buffer (from calling new Buffer()). The
+argument \fIendian\fR is either the string 'big' or 'little' and controls
+whether the data in the buffer is interpreted as big or little endian. The argument
+\fIoffset\fR indicates the starting index into the buffer to read or write. All
+functions ensure that starting at \fIoffset\fR does not overflow the end of the
+buffer. The argument \fIvalue\fR is a Number that is the valid type for the
+specific function. All functions that take \fIvalue\fR as an argument, verify
+that the passed value is valid.
+
+.SS "\fBruint8()\fR, \fBruint16()\fR, \fBruint32()\fR"
+.sp
+.LP
+The \fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR functions read an 8,
+16, and 32-bit unsigned value from \fIbuf\fR and return it. The value read is
+influenced by the values of \fIoffset\fR and \fRendian\fI.
+
+
+.SS "\fBrsint8()\fR, \fBrsint16()\fR, \fBrsint32()\fR"
+.sp
+.LP
+The \fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR functions work just as
+\fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR, except they return signed
+integers.
+
+.SS "\fBruint64()\fR, \fBrsint64()\fR"
+.sp
+.LP
+The \fBruint64()\fR and \fBrsint64()\fR functions read unsigned and signed 64
+bit integers respectively from \fBbuf\fR. Due to the limitations of ECMAScript's
+\fBNumber\fR type, they cannot be stored as one value without a loss of
+precision. Instead of returning the values as a single \fBNumber\fR, the
+functions return an array of two numbers. The first entry always contains the
+upper 32-bits and the second value contains the lower 32-bits. The lossy
+transformation into a number would be \fIres[0]*Math.pow(2,32)+res[1]\fR.
+Note that, unless an entry is zero, both array entries are guaranteed to have
+the same sign.
+
+.SS "\fBwuint8()\fR, \fBwuint16()\fR, \fBwuint32()\fR"
+.sp
+.LP
+The functions \fBwuint8()\fR, \fBwuint16()\fR, and \fBwuint32()\fR modify the
+contents of \fBbuf\fR by writing an 8, 16, and 32-bit unsigned integer
+respectively to \fBbuf\fR. It is illegal to pass a number that is not an integer
+within the domain of the integer size, for example, for \fBwuint8()\fR the valid
+range is \fB[0, 255]\fR. The value will be written in either big or little
+endian format based upon the value of \fBendian\fR.
+
+
+.SS "\fBwsint8()\fR, \fBwsint16()\fR, \fBwsint32()\fR"
+.sp
+.LP
+The functions \fBwsint8()\fR, \fBwsint16()\fR, and \fBwsint32()\fR function
+identically to the functions \fBwuint8()\fR, \fBwuint16()\fR, and
+\fBwuint32()\fR except that they the valid domain for \fBvalue\fR is that of a
+signed number instead of an unsigned number. For example the \fBwsint8()\fR has
+a domain of \fB[-128, 127]\fR.
+
+.SS "\fBwuint64()\fR, \fBwsint64()\fR"
+.sp
+.LP
+The functions \fBwuint64()\fR and \fBswint64()\fR write out 64-bit unsigned and
+signed integers to \fBbuf\fR. The \fBvalue\fR argument must be in the same
+format as described in \fBruint64()\fR and \fBrsint64()\fR.
+
+.SS "\fBrfloat()\fR, \fBrdouble()\fR"
+.sp
+.LP
+The functions "\fBrfloat()\fR and \fBrdouble()\fR" work like the other read
+functions, except that they read a single precision and double precision
+IEEE-754 floating point value instead.
+
+.SS "\fBwfloat()\fR, \fBwdouble()\fR"
+.sp
+.LP
+The functions "\fBrfloat()\fR and \fBrdouble()\fR" work like the other write
+functions, except that the domain for a float is that of a single precision 4
+byte value. The domain for a double is any \fBNumber\fR in ECMAScript, which is
+defined to be represented by a double.
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE ATTRIBUTE VALUE
+_
+Interface Stability Committed
+_
+MT-Level See below.
+_
+Standard Not standardized.
+.TE
+
+.sp
+.LP
+
+All functions are MT-safe in so far as there aren't shared memory MT concerns in
+most node programs. If one where to concoct such an environment, these functions
+wouldn't be MT-safe.
+
+.SH SEE ALSO
+.sp
+.LP
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
new file mode 100644
index 000000000..c33f8a574
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json
@@ -0,0 +1,42 @@
+{
+ "name": "ctype",
+ "version": "0.5.3",
+ "description": "read and write binary structures and data types",
+ "homepage": "https://github.com/rmustacc/node-ctype",
+ "author": {
+ "name": "Robert Mustacchi",
+ "email": "rm@fingolfin.org"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "main": "ctype.js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/rmustacc/node-ctype.git"
+ },
+ "_id": "ctype@0.5.3",
+ "dist": {
+ "shasum": "82c18c2461f74114ef16c135224ad0b9144ca12f",
+ "tarball": "http://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz"
+ },
+ "_npmVersion": "1.1.59",
+ "_npmUser": {
+ "name": "rm",
+ "email": "rm@fingolfin.org"
+ },
+ "maintainers": [
+ {
+ "name": "rm",
+ "email": "rm@fingolfin.org"
+ }
+ ],
+ "directories": {},
+ "_shasum": "82c18c2461f74114ef16c135224ad0b9144ca12f",
+ "_resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz",
+ "_from": "ctype@0.5.3",
+ "bugs": {
+ "url": "https://github.com/rmustacc/node-ctype/issues"
+ },
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf b/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf
new file mode 100755
index 000000000..845f367a2
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf
@@ -0,0 +1,129 @@
+#
+# Configuration File for JavaScript Lint 0.3.0
+# Developed by Matthias Miller (http://www.JavaScriptLint.com)
+#
+# This configuration file can be used to lint a collection of scripts, or to enable
+# or disable warnings for scripts that are linted via the command line.
+#
+
+### Warnings
+# Enable or disable warnings based on requirements.
+# Use "+WarningName" to display or "-WarningName" to suppress.
+#
++no_return_value # function {0} does not always return a value
++duplicate_formal # duplicate formal argument {0}
++equal_as_assign # test for equality (==) mistyped as assignment (=)?{0}
++var_hides_arg # variable {0} hides argument
++redeclared_var # redeclaration of {0} {1}
++anon_no_return_value # anonymous function does not always return a value
++missing_semicolon # missing semicolon
++meaningless_block # meaningless block; curly braces have no impact
++comma_separated_stmts # multiple statements separated by commas (use semicolons?)
++unreachable_code # unreachable code
++missing_break # missing break statement
++missing_break_for_last_case # missing break statement for last case in switch
++comparison_type_conv # comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==)
+-inc_dec_within_stmt # increment (++) and decrement (--) operators used as part of greater statement
++useless_void # use of the void type may be unnecessary (void is always undefined)
+-useless_quotes # quotation marks are unnecessary
++multiple_plus_minus # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs
++use_of_label # use of label
+-block_without_braces # block statement without curly braces
++leading_decimal_point # leading decimal point may indicate a number or an object member
++trailing_decimal_point # trailing decimal point may indicate a number or an object member
+-octal_number # leading zeros make an octal number
++nested_comment # nested comment
++misplaced_regex # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma
++ambiguous_newline # unexpected end of line; it is ambiguous whether these lines are part of the same statement
++empty_statement # empty statement or extra semicolon
+-missing_option_explicit # the "option explicit" control comment is missing
++partial_option_explicit # the "option explicit" control comment, if used, must be in the first script tag
++dup_option_explicit # duplicate "option explicit" control comment
++useless_assign # useless assignment
++ambiguous_nested_stmt # block statements containing block statements should use curly braces to resolve ambiguity
++ambiguous_else_stmt # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent)
++missing_default_case # missing default case in switch statement
++duplicate_case_in_switch # duplicate case in switch statements
++default_not_at_end # the default case is not at the end of the switch statement
++legacy_cc_not_understood # couldn't understand control comment using /*@keyword@*/ syntax
++jsl_cc_not_understood # couldn't understand control comment using /*jsl:keyword*/ syntax
++useless_comparison # useless comparison; comparing identical expressions
++with_statement # with statement hides undeclared variables; use temporary variable instead
++trailing_comma_in_array # extra comma is not recommended in array initializers
++assign_to_function_call # assignment to a function call
++parseint_missing_radix # parseInt missing radix parameter
+-unreferenced_argument # argument declared but never referenced: {name}
+
+### Output format
+# Customize the format of the error message.
+# __FILE__ indicates current file path
+# __FILENAME__ indicates current file name
+# __LINE__ indicates current line
+# __ERROR__ indicates error message
+#
+# Visual Studio syntax (default):
++output-format __FILE__(__LINE__): __ERROR__
+# Alternative syntax:
+#+output-format __FILE__:__LINE__: __ERROR__
+
+
+### Context
+# Show the in-line position of the error.
+# Use "+context" to display or "-context" to suppress.
+#
++context
+
+
+### Semicolons
+# By default, assignments of an anonymous function to a variable or
+# property (such as a function prototype) must be followed by a semicolon.
+#
+#+lambda_assign_requires_semicolon # deprecated setting
+
+
+### Control Comments
+# Both JavaScript Lint and the JScript interpreter confuse each other with the syntax for
+# the /*@keyword@*/ control comments and JScript conditional comments. (The latter is
+# enabled in JScript with @cc_on@). The /*jsl:keyword*/ syntax is preferred for this reason,
+# although legacy control comments are enabled by default for backward compatibility.
+#
++legacy_control_comments
+
+
+### JScript Function Extensions
+# JScript allows member functions to be defined like this:
+# function MyObj() { /*constructor*/ }
+# function MyObj.prototype.go() { /*member function*/ }
+#
+# It also allows events to be attached like this:
+# function window::onload() { /*init page*/ }
+#
+# This is a Microsoft-only JavaScript extension. Enable this setting to allow them.
+#
+#-jscript_function_extensions # deprecated setting
+
+
+### Defining identifiers
+# By default, "option explicit" is enabled on a per-file basis.
+# To enable this for all files, use "+always_use_option_explicit"
+-always_use_option_explicit
+
+# Define certain identifiers of which the lint is not aware.
+# (Use this in conjunction with the "undeclared identifier" warning.)
+#
+# Common uses for webpages might be:
+#+define window
+#+define document
++define require
++define exports
++define console
++define Buffer
++define JSON
+
+### Files
+# Specify which files to lint
+# Use "+recurse" to enable recursion (disabled by default).
+# To add a set of files, use "+process FileName", "+process Folder\Path\*.js",
+# or "+process Folder\Path\*.htm".
+#
+#+process jsl-test.js
diff --git a/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle b/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle
new file mode 100755
index 000000000..96c72b6d7
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle
@@ -0,0 +1,839 @@
+#!/usr/bin/env perl
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# Copyright 2011 Joyent, Inc. All rights reserved.
+#
+# jsstyle - check for some common stylistic errors.
+#
+# jsstyle is a sort of "lint" for Javascript coding style. This tool is
+# derived from the cstyle tool, used to check for the style used in the
+# Solaris kernel, sometimes known as "Bill Joy Normal Form".
+#
+# There's a lot this can't check for, like proper indentation of code
+# blocks. There's also a lot more this could check for.
+#
+# A note to the non perl literate:
+#
+# perl regular expressions are pretty much like egrep
+# regular expressions, with the following special symbols
+#
+# \s any space character
+# \S any non-space character
+# \w any "word" character [a-zA-Z0-9_]
+# \W any non-word character
+# \d a digit [0-9]
+# \D a non-digit
+# \b word boundary (between \w and \W)
+# \B non-word boundary
+#
+
+require 5.0;
+use IO::File;
+use Getopt::Std;
+use strict;
+
+my $usage =
+"usage: jsstyle [-chvC] [-o constructs] file ...
+ -c check continuation indentation inside functions
+ -h perform heuristic checks that are sometimes wrong
+ -v verbose
+ -C don't check anything in header block comments
+ -o constructs
+ allow a comma-seperated list of optional constructs:
+ doxygen allow doxygen-style block comments (/** /*!)
+ splint allow splint-style lint comments (/*@ ... @*/)
+";
+
+my %opts;
+
+if (!getopts("cho:vC", \%opts)) {
+ print $usage;
+ exit 2;
+}
+
+my $check_continuation = $opts{'c'};
+my $heuristic = $opts{'h'};
+my $verbose = $opts{'v'};
+my $ignore_hdr_comment = $opts{'C'};
+
+my $doxygen_comments = 0;
+my $splint_comments = 0;
+
+if (defined($opts{'o'})) {
+ for my $x (split /,/, $opts{'o'}) {
+ if ($x eq "doxygen") {
+ $doxygen_comments = 1;
+ } elsif ($x eq "splint") {
+ $splint_comments = 1;
+ } else {
+ print "jsstyle: unrecognized construct \"$x\"\n";
+ print $usage;
+ exit 2;
+ }
+ }
+}
+
+my ($filename, $line, $prev); # shared globals
+
+my $fmt;
+my $hdr_comment_start;
+
+if ($verbose) {
+ $fmt = "%s: %d: %s\n%s\n";
+} else {
+ $fmt = "%s: %d: %s\n";
+}
+
+if ($doxygen_comments) {
+ # doxygen comments look like "/*!" or "/**"; allow them.
+ $hdr_comment_start = qr/^\s*\/\*[\!\*]?$/;
+} else {
+ $hdr_comment_start = qr/^\s*\/\*$/;
+}
+
+# Note, following must be in single quotes so that \s and \w work right.
+my $lint_re = qr/\/\*(?:
+ jsl:\w+?|ARGSUSED[0-9]*|NOTREACHED|LINTLIBRARY|VARARGS[0-9]*|
+ CONSTCOND|CONSTANTCOND|CONSTANTCONDITION|EMPTY|
+ FALLTHRU|FALLTHROUGH|LINTED.*?|PRINTFLIKE[0-9]*|
+ PROTOLIB[0-9]*|SCANFLIKE[0-9]*|JSSTYLED.*?
+ )\*\//x;
+
+my $splint_re = qr/\/\*@.*?@\*\//x;
+
+my $err_stat = 0; # exit status
+
+if ($#ARGV >= 0) {
+ foreach my $arg (@ARGV) {
+ my $fh = new IO::File $arg, "r";
+ if (!defined($fh)) {
+ printf "%s: cannot open\n", $arg;
+ } else {
+ &jsstyle($arg, $fh);
+ close $fh;
+ }
+ }
+} else {
+ &jsstyle("<stdin>", *STDIN);
+}
+exit $err_stat;
+
+my $no_errs = 0; # set for JSSTYLED-protected lines
+
+sub err($) {
+ my ($error) = @_;
+ unless ($no_errs) {
+ printf $fmt, $filename, $., $error, $line;
+ $err_stat = 1;
+ }
+}
+
+sub err_prefix($$) {
+ my ($prevline, $error) = @_;
+ my $out = $prevline."\n".$line;
+ unless ($no_errs) {
+ printf $fmt, $filename, $., $error, $out;
+ $err_stat = 1;
+ }
+}
+
+sub err_prev($) {
+ my ($error) = @_;
+ unless ($no_errs) {
+ printf $fmt, $filename, $. - 1, $error, $prev;
+ $err_stat = 1;
+ }
+}
+
+sub jsstyle($$) {
+
+my ($fn, $filehandle) = @_;
+$filename = $fn; # share it globally
+
+my $in_cpp = 0;
+my $next_in_cpp = 0;
+
+my $in_comment = 0;
+my $in_header_comment = 0;
+my $comment_done = 0;
+my $in_function = 0;
+my $in_function_header = 0;
+my $in_declaration = 0;
+my $note_level = 0;
+my $nextok = 0;
+my $nocheck = 0;
+
+my $in_string = 0;
+
+my ($okmsg, $comment_prefix);
+
+$line = '';
+$prev = '';
+reset_indent();
+
+line: while (<$filehandle>) {
+ s/\r?\n$//; # strip return and newline
+
+ # save the original line, then remove all text from within
+ # double or single quotes, we do not want to check such text.
+
+ $line = $_;
+
+ #
+ # C allows strings to be continued with a backslash at the end of
+ # the line. We translate that into a quoted string on the previous
+ # line followed by an initial quote on the next line.
+ #
+ # (we assume that no-one will use backslash-continuation with character
+ # constants)
+ #
+ $_ = '"' . $_ if ($in_string && !$nocheck && !$in_comment);
+
+ #
+ # normal strings and characters
+ #
+ s/'([^\\']|\\.)*'/\'\'/g;
+ s/"([^\\"]|\\.)*"/\"\"/g;
+
+ #
+ # detect string continuation
+ #
+ if ($nocheck || $in_comment) {
+ $in_string = 0;
+ } else {
+ #
+ # Now that all full strings are replaced with "", we check
+ # for unfinished strings continuing onto the next line.
+ #
+ $in_string =
+ (s/([^"](?:"")*)"([^\\"]|\\.)*\\$/$1""/ ||
+ s/^("")*"([^\\"]|\\.)*\\$/""/);
+ }
+
+ #
+ # figure out if we are in a cpp directive
+ #
+ $in_cpp = $next_in_cpp || /^\s*#/; # continued or started
+ $next_in_cpp = $in_cpp && /\\$/; # only if continued
+
+ # strip off trailing backslashes, which appear in long macros
+ s/\s*\\$//;
+
+ # an /* END JSSTYLED */ comment ends a no-check block.
+ if ($nocheck) {
+ if (/\/\* *END *JSSTYLED *\*\//) {
+ $nocheck = 0;
+ } else {
+ reset_indent();
+ next line;
+ }
+ }
+
+ # a /*JSSTYLED*/ comment indicates that the next line is ok.
+ if ($nextok) {
+ if ($okmsg) {
+ err($okmsg);
+ }
+ $nextok = 0;
+ $okmsg = 0;
+ if (/\/\* *JSSTYLED.*\*\//) {
+ /^.*\/\* *JSSTYLED *(.*) *\*\/.*$/;
+ $okmsg = $1;
+ $nextok = 1;
+ }
+ $no_errs = 1;
+ } elsif ($no_errs) {
+ $no_errs = 0;
+ }
+
+ # check length of line.
+ # first, a quick check to see if there is any chance of being too long.
+ if (($line =~ tr/\t/\t/) * 7 + length($line) > 80) {
+ # yes, there is a chance.
+ # replace tabs with spaces and check again.
+ my $eline = $line;
+ 1 while $eline =~
+ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e;
+ if (length($eline) > 80) {
+ err("line > 80 characters");
+ }
+ }
+
+ # ignore NOTE(...) annotations (assumes NOTE is on lines by itself).
+ if ($note_level || /\b_?NOTE\s*\(/) { # if in NOTE or this is NOTE
+ s/[^()]//g; # eliminate all non-parens
+ $note_level += s/\(//g - length; # update paren nest level
+ next;
+ }
+
+ # a /* BEGIN JSSTYLED */ comment starts a no-check block.
+ if (/\/\* *BEGIN *JSSTYLED *\*\//) {
+ $nocheck = 1;
+ }
+
+ # a /*JSSTYLED*/ comment indicates that the next line is ok.
+ if (/\/\* *JSSTYLED.*\*\//) {
+ /^.*\/\* *JSSTYLED *(.*) *\*\/.*$/;
+ $okmsg = $1;
+ $nextok = 1;
+ }
+ if (/\/\/ *JSSTYLED/) {
+ /^.*\/\/ *JSSTYLED *(.*)$/;
+ $okmsg = $1;
+ $nextok = 1;
+ }
+
+ # universal checks; apply to everything
+ if (/\t +\t/) {
+ err("spaces between tabs");
+ }
+ if (/ \t+ /) {
+ err("tabs between spaces");
+ }
+ if (/\s$/) {
+ err("space or tab at end of line");
+ }
+ if (/[^ \t(]\/\*/ && !/\w\(\/\*.*\*\/\);/) {
+ err("comment preceded by non-blank");
+ }
+
+ # is this the beginning or ending of a function?
+ # (not if "struct foo\n{\n")
+ if (/^{$/ && $prev =~ /\)\s*(const\s*)?(\/\*.*\*\/\s*)?\\?$/) {
+ $in_function = 1;
+ $in_declaration = 1;
+ $in_function_header = 0;
+ $prev = $line;
+ next line;
+ }
+ if (/^}\s*(\/\*.*\*\/\s*)*$/) {
+ if ($prev =~ /^\s*return\s*;/) {
+ err_prev("unneeded return at end of function");
+ }
+ $in_function = 0;
+ reset_indent(); # we don't check between functions
+ $prev = $line;
+ next line;
+ }
+ if (/^\w*\($/) {
+ $in_function_header = 1;
+ }
+
+ # a blank line terminates the declarations within a function.
+ # XXX - but still a problem in sub-blocks.
+ if ($in_declaration && /^$/) {
+ $in_declaration = 0;
+ }
+
+ if ($comment_done) {
+ $in_comment = 0;
+ $in_header_comment = 0;
+ $comment_done = 0;
+ }
+ # does this looks like the start of a block comment?
+ if (/$hdr_comment_start/) {
+ if (!/^\t*\/\*/) {
+ err("block comment not indented by tabs");
+ }
+ $in_comment = 1;
+ /^(\s*)\//;
+ $comment_prefix = $1;
+ if ($comment_prefix eq "") {
+ $in_header_comment = 1;
+ }
+ $prev = $line;
+ next line;
+ }
+ # are we still in the block comment?
+ if ($in_comment) {
+ if (/^$comment_prefix \*\/$/) {
+ $comment_done = 1;
+ } elsif (/\*\//) {
+ $comment_done = 1;
+ err("improper block comment close")
+ unless ($ignore_hdr_comment && $in_header_comment);
+ } elsif (!/^$comment_prefix \*[ \t]/ &&
+ !/^$comment_prefix \*$/) {
+ err("improper block comment")
+ unless ($ignore_hdr_comment && $in_header_comment);
+ }
+ }
+
+ if ($in_header_comment && $ignore_hdr_comment) {
+ $prev = $line;
+ next line;
+ }
+
+ # check for errors that might occur in comments and in code.
+
+ # allow spaces to be used to draw pictures in header comments.
+ #if (/[^ ] / && !/".* .*"/ && !$in_header_comment) {
+ # err("spaces instead of tabs");
+ #}
+ #if (/^ / && !/^ \*[ \t\/]/ && !/^ \*$/ &&
+ # (!/^ \w/ || $in_function != 0)) {
+ # err("indent by spaces instead of tabs");
+ #}
+ if (/^ {2,}/ && !/^ [^ ]/) {
+ err("indent by spaces instead of tabs");
+ }
+ if (/^\t+ [^ \t\*]/ || /^\t+ \S/ || /^\t+ \S/) {
+ err("continuation line not indented by 4 spaces");
+ }
+
+ if (/^\s*\/\*./ && !/^\s*\/\*.*\*\// && !/$hdr_comment_start/) {
+ err("improper first line of block comment");
+ }
+
+ if ($in_comment) { # still in comment, don't do further checks
+ $prev = $line;
+ next line;
+ }
+
+ if ((/[^(]\/\*\S/ || /^\/\*\S/) &&
+ !(/$lint_re/ || ($splint_comments && /$splint_re/))) {
+ err("missing blank after open comment");
+ }
+ if (/\S\*\/[^)]|\S\*\/$/ &&
+ !(/$lint_re/ || ($splint_comments && /$splint_re/))) {
+ err("missing blank before close comment");
+ }
+ if (/\/\/\S/) { # C++ comments
+ err("missing blank after start comment");
+ }
+ # check for unterminated single line comments, but allow them when
+ # they are used to comment out the argument list of a function
+ # declaration.
+ if (/\S.*\/\*/ && !/\S.*\/\*.*\*\// && !/\(\/\*/) {
+ err("unterminated single line comment");
+ }
+
+ if (/^(#else|#endif|#include)(.*)$/) {
+ $prev = $line;
+ next line;
+ }
+
+ #
+ # delete any comments and check everything else. Note that
+ # ".*?" is a non-greedy match, so that we don't get confused by
+ # multiple comments on the same line.
+ #
+ s/\/\*.*?\*\///g;
+ s/\/\/.*$//; # C++ comments
+
+ # delete any trailing whitespace; we have already checked for that.
+ s/\s*$//;
+
+ # following checks do not apply to text in comments.
+ if (/"/) {
+ err("literal string using double-quote instead of single");
+ }
+
+ if (/[^=!<>\s][!<>=]=/ || /[^<>!=][!<>=]==?[^\s,=]/ ||
+ (/[^->]>[^,=>\s]/ && !/[^->]>$/) ||
+ (/[^<]<[^,=<\s]/ && !/[^<]<$/) ||
+ /[^<\s]<[^<]/ || /[^->\s]>[^>]/) {
+ err("missing space around relational operator");
+ }
+ if (/\S>>=/ || /\S<<=/ || />>=\S/ || /<<=\S/ || /\S[-+*\/&|^%]=/ ||
+ (/[^-+*\/&|^%!<>=\s]=[^=]/ && !/[^-+*\/&|^%!<>=\s]=$/) ||
+ (/[^!<>=]=[^=\s]/ && !/[^!<>=]=$/)) {
+ # XXX - should only check this for C++ code
+ # XXX - there are probably other forms that should be allowed
+ if (!/\soperator=/) {
+ err("missing space around assignment operator");
+ }
+ }
+ if (/[,;]\S/ && !/\bfor \(;;\)/) {
+ err("comma or semicolon followed by non-blank");
+ }
+ # allow "for" statements to have empty "while" clauses
+ if (/\s[,;]/ && !/^[\t]+;$/ && !/^\s*for \([^;]*; ;[^;]*\)/) {
+ err("comma or semicolon preceded by blank");
+ }
+ if (/^\s*(&&|\|\|)/) {
+ err("improper boolean continuation");
+ }
+ if (/\S *(&&|\|\|)/ || /(&&|\|\|) *\S/) {
+ err("more than one space around boolean operator");
+ }
+ if (/\b(delete|typeof|instanceOf|throw|with|catch|new|function|in|for|if|while|switch|return|case)\(/) {
+ err("missing space between keyword and paren");
+ }
+ if (/(\b(catch|for|if|with|while|switch|return)\b.*){2,}/) {
+ # multiple "case" and "sizeof" allowed
+ err("more than one keyword on line");
+ }
+ if (/\b(delete|typeof|instanceOf|with|throw|catch|new|function|in|for|if|while|switch|return|case)\s\s+\(/ &&
+ !/^#if\s+\(/) {
+ err("extra space between keyword and paren");
+ }
+ # try to detect "func (x)" but not "if (x)" or
+ # "#define foo (x)" or "int (*func)();"
+ if (/\w\s\(/) {
+ my $s = $_;
+ # strip off all keywords on the line
+ s/\b(delete|typeof|instanceOf|throw|with|catch|new|function|in|for|if|while|switch|return|case)\s\(/XXX(/g;
+ s/#elif\s\(/XXX(/g;
+ s/^#define\s+\w+\s+\(/XXX(/;
+ # do not match things like "void (*f)();"
+ # or "typedef void (func_t)();"
+ s/\w\s\(+\*/XXX(*/g;
+ s/\b(void)\s+\(+/XXX(/og;
+ if (/\w\s\(/) {
+ err("extra space between function name and left paren");
+ }
+ $_ = $s;
+ }
+
+ if (/^\s*return\W[^;]*;/ && !/^\s*return\s*\(.*\);/) {
+ err("unparenthesized return expression");
+ }
+ if (/\btypeof\b/ && !/\btypeof\s*\(.*\)/) {
+ err("unparenthesized typeof expression");
+ }
+ if (/\(\s/) {
+ err("whitespace after left paren");
+ }
+ # allow "for" statements to have empty "continue" clauses
+ if (/\s\)/ && !/^\s*for \([^;]*;[^;]*; \)/) {
+ err("whitespace before right paren");
+ }
+ if (/^\s*\(void\)[^ ]/) {
+ err("missing space after (void) cast");
+ }
+ if (/\S{/ && !/({|\(){/) {
+ err("missing space before left brace");
+ }
+ if ($in_function && /^\s+{/ &&
+ ($prev =~ /\)\s*$/ || $prev =~ /\bstruct\s+\w+$/)) {
+ err("left brace starting a line");
+ }
+ if (/}(else|while)/) {
+ err("missing space after right brace");
+ }
+ if (/}\s\s+(else|while)/) {
+ err("extra space after right brace");
+ }
+ if (/^\s+#/) {
+ err("preprocessor statement not in column 1");
+ }
+ if (/^#\s/) {
+ err("blank after preprocessor #");
+ }
+
+ #
+ # We completely ignore, for purposes of indentation:
+ # * lines outside of functions
+ # * preprocessor lines
+ #
+ if ($check_continuation && $in_function && !$in_cpp) {
+ process_indent($_);
+ }
+
+ if ($heuristic) {
+ # cannot check this everywhere due to "struct {\n...\n} foo;"
+ if ($in_function && !$in_declaration &&
+ /}./ && !/}\s+=/ && !/{.*}[;,]$/ && !/}(\s|)*$/ &&
+ !/} (else|while)/ && !/}}/) {
+ err("possible bad text following right brace");
+ }
+ # cannot check this because sub-blocks in
+ # the middle of code are ok
+ if ($in_function && /^\s+{/) {
+ err("possible left brace starting a line");
+ }
+ }
+ if (/^\s*else\W/) {
+ if ($prev =~ /^\s*}$/) {
+ err_prefix($prev,
+ "else and right brace should be on same line");
+ }
+ }
+ $prev = $line;
+}
+
+if ($prev eq "") {
+ err("last line in file is blank");
+}
+
+}
+
+#
+# Continuation-line checking
+#
+# The rest of this file contains the code for the continuation checking
+# engine. It's a pretty simple state machine which tracks the expression
+# depth (unmatched '('s and '['s).
+#
+# Keep in mind that the argument to process_indent() has already been heavily
+# processed; all comments have been replaced by control-A, and the contents of
+# strings and character constants have been elided.
+#
+
+my $cont_in; # currently inside of a continuation
+my $cont_off; # skipping an initializer or definition
+my $cont_noerr; # suppress cascading errors
+my $cont_start; # the line being continued
+my $cont_base; # the base indentation
+my $cont_first; # this is the first line of a statement
+my $cont_multiseg; # this continuation has multiple segments
+
+my $cont_special; # this is a C statement (if, for, etc.)
+my $cont_macro; # this is a macro
+my $cont_case; # this is a multi-line case
+
+my @cont_paren; # the stack of unmatched ( and [s we've seen
+
+sub
+reset_indent()
+{
+ $cont_in = 0;
+ $cont_off = 0;
+}
+
+sub
+delabel($)
+{
+ #
+ # replace labels with tabs. Note that there may be multiple
+ # labels on a line.
+ #
+ local $_ = $_[0];
+
+ while (/^(\t*)( *(?:(?:\w+\s*)|(?:case\b[^:]*)): *)(.*)$/) {
+ my ($pre_tabs, $label, $rest) = ($1, $2, $3);
+ $_ = $pre_tabs;
+ while ($label =~ s/^([^\t]*)(\t+)//) {
+ $_ .= "\t" x (length($2) + length($1) / 8);
+ }
+ $_ .= ("\t" x (length($label) / 8)).$rest;
+ }
+
+ return ($_);
+}
+
+sub
+process_indent($)
+{
+ require strict;
+ local $_ = $_[0]; # preserve the global $_
+
+ s///g; # No comments
+ s/\s+$//; # Strip trailing whitespace
+
+ return if (/^$/); # skip empty lines
+
+ # regexps used below; keywords taking (), macros, and continued cases
+ my $special = '(?:(?:\}\s*)?else\s+)?(?:if|for|while|switch)\b';
+ my $macro = '[A-Z_][A-Z_0-9]*\(';
+ my $case = 'case\b[^:]*$';
+
+ # skip over enumerations, array definitions, initializers, etc.
+ if ($cont_off <= 0 && !/^\s*$special/ &&
+ (/(?:(?:\b(?:enum|struct|union)\s*[^\{]*)|(?:\s+=\s*)){/ ||
+ (/^\s*{/ && $prev =~ /=\s*(?:\/\*.*\*\/\s*)*$/))) {
+ $cont_in = 0;
+ $cont_off = tr/{/{/ - tr/}/}/;
+ return;
+ }
+ if ($cont_off) {
+ $cont_off += tr/{/{/ - tr/}/}/;
+ return;
+ }
+
+ if (!$cont_in) {
+ $cont_start = $line;
+
+ if (/^\t* /) {
+ err("non-continuation indented 4 spaces");
+ $cont_noerr = 1; # stop reporting
+ }
+ $_ = delabel($_); # replace labels with tabs
+
+ # check if the statement is complete
+ return if (/^\s*\}?$/);
+ return if (/^\s*\}?\s*else\s*\{?$/);
+ return if (/^\s*do\s*\{?$/);
+ return if (/{$/);
+ return if (/}[,;]?$/);
+
+ # Allow macros on their own lines
+ return if (/^\s*[A-Z_][A-Z_0-9]*$/);
+
+ # cases we don't deal with, generally non-kosher
+ if (/{/) {
+ err("stuff after {");
+ return;
+ }
+
+ # Get the base line, and set up the state machine
+ /^(\t*)/;
+ $cont_base = $1;
+ $cont_in = 1;
+ @cont_paren = ();
+ $cont_first = 1;
+ $cont_multiseg = 0;
+
+ # certain things need special processing
+ $cont_special = /^\s*$special/? 1 : 0;
+ $cont_macro = /^\s*$macro/? 1 : 0;
+ $cont_case = /^\s*$case/? 1 : 0;
+ } else {
+ $cont_first = 0;
+
+ # Strings may be pulled back to an earlier (half-)tabstop
+ unless ($cont_noerr || /^$cont_base / ||
+ (/^\t*(?: )?(?:gettext\()?\"/ && !/^$cont_base\t/)) {
+ err_prefix($cont_start,
+ "continuation should be indented 4 spaces");
+ }
+ }
+
+ my $rest = $_; # keeps the remainder of the line
+
+ #
+ # The split matches 0 characters, so that each 'special' character
+ # is processed separately. Parens and brackets are pushed and
+ # popped off the @cont_paren stack. For normal processing, we wait
+ # until a ; or { terminates the statement. "special" processing
+ # (if/for/while/switch) is allowed to stop when the stack empties,
+ # as is macro processing. Case statements are terminated with a :
+ # and an empty paren stack.
+ #
+ foreach $_ (split /[^\(\)\[\]\{\}\;\:]*/) {
+ next if (length($_) == 0);
+
+ # rest contains the remainder of the line
+ my $rxp = "[^\Q$_\E]*\Q$_\E";
+ $rest =~ s/^$rxp//;
+
+ if (/\(/ || /\[/) {
+ push @cont_paren, $_;
+ } elsif (/\)/ || /\]/) {
+ my $cur = $_;
+ tr/\)\]/\(\[/;
+
+ my $old = (pop @cont_paren);
+ if (!defined($old)) {
+ err("unexpected '$cur'");
+ $cont_in = 0;
+ last;
+ } elsif ($old ne $_) {
+ err("'$cur' mismatched with '$old'");
+ $cont_in = 0;
+ last;
+ }
+
+ #
+ # If the stack is now empty, do special processing
+ # for if/for/while/switch and macro statements.
+ #
+ next if (@cont_paren != 0);
+ if ($cont_special) {
+ if ($rest =~ /^\s*{?$/) {
+ $cont_in = 0;
+ last;
+ }
+ if ($rest =~ /^\s*;$/) {
+ err("empty if/for/while body ".
+ "not on its own line");
+ $cont_in = 0;
+ last;
+ }
+ if (!$cont_first && $cont_multiseg == 1) {
+ err_prefix($cont_start,
+ "multiple statements continued ".
+ "over multiple lines");
+ $cont_multiseg = 2;
+ } elsif ($cont_multiseg == 0) {
+ $cont_multiseg = 1;
+ }
+ # We've finished this section, start
+ # processing the next.
+ goto section_ended;
+ }
+ if ($cont_macro) {
+ if ($rest =~ /^$/) {
+ $cont_in = 0;
+ last;
+ }
+ }
+ } elsif (/\;/) {
+ if ($cont_case) {
+ err("unexpected ;");
+ } elsif (!$cont_special) {
+ err("unexpected ;") if (@cont_paren != 0);
+ if (!$cont_first && $cont_multiseg == 1) {
+ err_prefix($cont_start,
+ "multiple statements continued ".
+ "over multiple lines");
+ $cont_multiseg = 2;
+ } elsif ($cont_multiseg == 0) {
+ $cont_multiseg = 1;
+ }
+ if ($rest =~ /^$/) {
+ $cont_in = 0;
+ last;
+ }
+ if ($rest =~ /^\s*special/) {
+ err("if/for/while/switch not started ".
+ "on its own line");
+ }
+ goto section_ended;
+ }
+ } elsif (/\{/) {
+ err("{ while in parens/brackets") if (@cont_paren != 0);
+ err("stuff after {") if ($rest =~ /[^\s}]/);
+ $cont_in = 0;
+ last;
+ } elsif (/\}/) {
+ err("} while in parens/brackets") if (@cont_paren != 0);
+ if (!$cont_special && $rest !~ /^\s*(while|else)\b/) {
+ if ($rest =~ /^$/) {
+ err("unexpected }");
+ } else {
+ err("stuff after }");
+ }
+ $cont_in = 0;
+ last;
+ }
+ } elsif (/\:/ && $cont_case && @cont_paren == 0) {
+ err("stuff after multi-line case") if ($rest !~ /$^/);
+ $cont_in = 0;
+ last;
+ }
+ next;
+section_ended:
+ # End of a statement or if/while/for loop. Reset
+ # cont_special and cont_macro based on the rest of the
+ # line.
+ $cont_special = ($rest =~ /^\s*$special/)? 1 : 0;
+ $cont_macro = ($rest =~ /^\s*$macro/)? 1 : 0;
+ $cont_case = 0;
+ next;
+ }
+ $cont_noerr = 0 if (!$cont_in);
+}
diff --git a/node_modules/request/node_modules/http-signature/package.json b/node_modules/request/node_modules/http-signature/package.json
new file mode 100644
index 000000000..47d76cffc
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/package.json
@@ -0,0 +1,77 @@
+{
+ "name": "http-signature",
+ "description": "Reference implementation of Joyent's HTTP Signature scheme.",
+ "version": "0.11.0",
+ "license": "MIT",
+ "author": {
+ "name": "Joyent, Inc"
+ },
+ "contributors": [
+ {
+ "name": "Mark Cavage",
+ "email": "mcavage@gmail.com"
+ },
+ {
+ "name": "David I. Lehn",
+ "email": "dil@lehn.org"
+ },
+ {
+ "name": "Patrick Mooney",
+ "email": "patrick.f.mooney@gmail.com"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/joyent/node-http-signature.git"
+ },
+ "homepage": "https://github.com/joyent/node-http-signature/",
+ "bugs": {
+ "url": "https://github.com/joyent/node-http-signature/issues"
+ },
+ "keywords": [
+ "https",
+ "request"
+ ],
+ "engines": {
+ "node": ">=0.8"
+ },
+ "main": "lib/index.js",
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "dependencies": {
+ "assert-plus": "^0.1.5",
+ "asn1": "0.1.11",
+ "ctype": "0.5.3"
+ },
+ "devDependencies": {
+ "node-uuid": "^1.4.1",
+ "tap": "0.4.2"
+ },
+ "_id": "http-signature@0.11.0",
+ "_shasum": "1796cf67a001ad5cd6849dca0991485f09089fe6",
+ "_resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.11.0.tgz",
+ "_from": "http-signature@>=0.11.0 <0.12.0",
+ "_npmVersion": "2.5.1",
+ "_nodeVersion": "0.10.36",
+ "_npmUser": {
+ "name": "pfmooney",
+ "email": "patrick.f.mooney@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mcavage",
+ "email": "mcavage@gmail.com"
+ },
+ {
+ "name": "pfmooney",
+ "email": "patrick.f.mooney@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "1796cf67a001ad5cd6849dca0991485f09089fe6",
+ "tarball": "http://registry.npmjs.org/http-signature/-/http-signature-0.11.0.tgz"
+ },
+ "directories": {},
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/isstream/.npmignore b/node_modules/request/node_modules/isstream/.npmignore
new file mode 100644
index 000000000..aa1ec1ea0
--- /dev/null
+++ b/node_modules/request/node_modules/isstream/.npmignore
@@ -0,0 +1 @@
+*.tgz
diff --git a/node_modules/request/node_modules/isstream/.travis.yml b/node_modules/request/node_modules/isstream/.travis.yml
new file mode 100644
index 000000000..1fec2ab9a
--- /dev/null
+++ b/node_modules/request/node_modules/isstream/.travis.yml
@@ -0,0 +1,12 @@
+language: node_js
+node_js:
+ - "0.8"
+ - "0.10"
+ - "0.11"
+branches:
+ only:
+ - master
+notifications:
+ email:
+ - rod@vagg.org
+script: npm test
diff --git a/node_modules/request/node_modules/isstream/LICENSE.md b/node_modules/request/node_modules/isstream/LICENSE.md
new file mode 100644
index 000000000..43f7153f9
--- /dev/null
+++ b/node_modules/request/node_modules/isstream/LICENSE.md
@@ -0,0 +1,11 @@
+The MIT License (MIT)
+=====================
+
+Copyright (c) 2015 Rod Vagg
+---------------------------
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/request/node_modules/isstream/README.md b/node_modules/request/node_modules/isstream/README.md
new file mode 100644
index 000000000..06770e82f
--- /dev/null
+++ b/node_modules/request/node_modules/isstream/README.md
@@ -0,0 +1,66 @@
+# isStream
+
+[![Build Status](https://secure.travis-ci.org/rvagg/isstream.png)](http://travis-ci.org/rvagg/isstream)
+
+**Test if an object is a `Stream`**
+
+[![NPM](https://nodei.co/npm/isstream.svg)](https://nodei.co/npm/isstream/)
+
+The missing `Stream.isStream(obj)`: determine if an object is standard Node.js `Stream`. Works for Node-core `Stream` objects (for 0.8, 0.10, 0.11, and in theory, older and newer versions) and all versions of **[readable-stream](https://github.com/isaacs/readable-stream)**.
+
+## Usage:
+
+```js
+var isStream = require('isstream')
+var Stream = require('stream')
+
+isStream(new Stream()) // true
+
+isStream({}) // false
+
+isStream(new Stream.Readable()) // true
+isStream(new Stream.Writable()) // true
+isStream(new Stream.Duplex()) // true
+isStream(new Stream.Transform()) // true
+isStream(new Stream.PassThrough()) // true
+```
+
+## But wait! There's more!
+
+You can also test for `isReadable(obj)`, `isWritable(obj)` and `isDuplex(obj)` to test for implementations of Streams2 (and Streams3) base classes.
+
+```js
+var isReadable = require('isstream').isReadable
+var isWritable = require('isstream').isWritable
+var isDuplex = require('isstream').isDuplex
+var Stream = require('stream')
+
+isReadable(new Stream()) // false
+isWritable(new Stream()) // false
+isDuplex(new Stream()) // false
+
+isReadable(new Stream.Readable()) // true
+isReadable(new Stream.Writable()) // false
+isReadable(new Stream.Duplex()) // true
+isReadable(new Stream.Transform()) // true
+isReadable(new Stream.PassThrough()) // true
+
+isWritable(new Stream.Readable()) // false
+isWritable(new Stream.Writable()) // true
+isWritable(new Stream.Duplex()) // true
+isWritable(new Stream.Transform()) // true
+isWritable(new Stream.PassThrough()) // true
+
+isDuplex(new Stream.Readable()) // false
+isDuplex(new Stream.Writable()) // false
+isDuplex(new Stream.Duplex()) // true
+isDuplex(new Stream.Transform()) // true
+isDuplex(new Stream.PassThrough()) // true
+```
+
+*Reminder: when implementing your own streams, please [use **readable-stream** rather than core streams](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).*
+
+
+## License
+
+**isStream** is Copyright (c) 2015 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.
diff --git a/node_modules/request/node_modules/isstream/isstream.js b/node_modules/request/node_modules/isstream/isstream.js
new file mode 100644
index 000000000..a1d104a7a
--- /dev/null
+++ b/node_modules/request/node_modules/isstream/isstream.js
@@ -0,0 +1,27 @@
+var stream = require('stream')
+
+
+function isStream (obj) {
+ return obj instanceof stream.Stream
+}
+
+
+function isReadable (obj) {
+ return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object'
+}
+
+
+function isWritable (obj) {
+ return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object'
+}
+
+
+function isDuplex (obj) {
+ return isReadable(obj) && isWritable(obj)
+}
+
+
+module.exports = isStream
+module.exports.isReadable = isReadable
+module.exports.isWritable = isWritable
+module.exports.isDuplex = isDuplex
diff --git a/node_modules/request/node_modules/isstream/package.json b/node_modules/request/node_modules/isstream/package.json
new file mode 100644
index 000000000..87c26fe12
--- /dev/null
+++ b/node_modules/request/node_modules/isstream/package.json
@@ -0,0 +1,42 @@
+{
+ "name": "isstream",
+ "version": "0.1.2",
+ "description": "Determine if an object is a Stream",
+ "main": "isstream.js",
+ "scripts": {
+ "test": "tar --xform 's/^package/readable-stream-1.0/' -zxf readable-stream-1.0.*.tgz && tar --xform 's/^package/readable-stream-1.1/' -zxf readable-stream-1.1.*.tgz && node test.js; rm -rf readable-stream-1.?/"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/rvagg/isstream.git"
+ },
+ "keywords": [
+ "stream",
+ "type",
+ "streams",
+ "readable-stream",
+ "hippo"
+ ],
+ "devDependencies": {
+ "tape": "~2.12.3",
+ "core-util-is": "~1.0.0",
+ "isarray": "0.0.1",
+ "string_decoder": "~0.10.x",
+ "inherits": "~2.0.1"
+ },
+ "author": {
+ "name": "Rod Vagg",
+ "email": "rod@vagg.org"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/rvagg/isstream/issues"
+ },
+ "homepage": "https://github.com/rvagg/isstream",
+ "readme": "# isStream\n\n[![Build Status](https://secure.travis-ci.org/rvagg/isstream.png)](http://travis-ci.org/rvagg/isstream)\n\n**Test if an object is a `Stream`**\n\n[![NPM](https://nodei.co/npm/isstream.svg)](https://nodei.co/npm/isstream/)\n\nThe missing `Stream.isStream(obj)`: determine if an object is standard Node.js `Stream`. Works for Node-core `Stream` objects (for 0.8, 0.10, 0.11, and in theory, older and newer versions) and all versions of **[readable-stream](https://github.com/isaacs/readable-stream)**.\n\n## Usage:\n\n```js\nvar isStream = require('isstream')\nvar Stream = require('stream')\n\nisStream(new Stream()) // true\n\nisStream({}) // false\n\nisStream(new Stream.Readable()) // true\nisStream(new Stream.Writable()) // true\nisStream(new Stream.Duplex()) // true\nisStream(new Stream.Transform()) // true\nisStream(new Stream.PassThrough()) // true\n```\n\n## But wait! There's more!\n\nYou can also test for `isReadable(obj)`, `isWritable(obj)` and `isDuplex(obj)` to test for implementations of Streams2 (and Streams3) base classes.\n\n```js\nvar isReadable = require('isstream').isReadable\nvar isWritable = require('isstream').isWritable\nvar isDuplex = require('isstream').isDuplex\nvar Stream = require('stream')\n\nisReadable(new Stream()) // false\nisWritable(new Stream()) // false\nisDuplex(new Stream()) // false\n\nisReadable(new Stream.Readable()) // true\nisReadable(new Stream.Writable()) // false\nisReadable(new Stream.Duplex()) // true\nisReadable(new Stream.Transform()) // true\nisReadable(new Stream.PassThrough()) // true\n\nisWritable(new Stream.Readable()) // false\nisWritable(new Stream.Writable()) // true\nisWritable(new Stream.Duplex()) // true\nisWritable(new Stream.Transform()) // true\nisWritable(new Stream.PassThrough()) // true\n\nisDuplex(new Stream.Readable()) // false\nisDuplex(new Stream.Writable()) // false\nisDuplex(new Stream.Duplex()) // true\nisDuplex(new Stream.Transform()) // true\nisDuplex(new Stream.PassThrough()) // true\n```\n\n*Reminder: when implementing your own streams, please [use **readable-stream** rather than core streams](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).*\n\n\n## License\n\n**isStream** is Copyright (c) 2015 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.\n",
+ "readmeFilename": "README.md",
+ "_id": "isstream@0.1.2",
+ "_shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a",
+ "_resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
+ "_from": "isstream@>=0.1.2 <0.2.0"
+}
diff --git a/node_modules/request/node_modules/isstream/test.js b/node_modules/request/node_modules/isstream/test.js
new file mode 100644
index 000000000..8c950c55e
--- /dev/null
+++ b/node_modules/request/node_modules/isstream/test.js
@@ -0,0 +1,168 @@
+var tape = require('tape')
+ , EE = require('events').EventEmitter
+ , util = require('util')
+
+
+ , isStream = require('./')
+ , isReadable = require('./').isReadable
+ , isWritable = require('./').isWritable
+ , isDuplex = require('./').isDuplex
+
+ , CoreStreams = require('stream')
+ , ReadableStream10 = require('./readable-stream-1.0/')
+ , ReadableStream11 = require('./readable-stream-1.1/')
+
+
+function test (pass, type, stream) {
+ tape('isStream(' + type + ')', function (t) {
+ t.plan(1)
+ t.ok(pass === isStream(stream), type)
+ })
+}
+
+
+function testReadable (pass, type, stream) {
+ tape('isReadable(' + type + ')', function (t) {
+ t.plan(1)
+ t.ok(pass === isReadable(stream), type)
+ })
+}
+
+
+function testWritable (pass, type, stream) {
+ tape('isWritable(' + type + ')', function (t) {
+ t.plan(1)
+ t.ok(pass === isWritable(stream), type)
+ })
+}
+
+
+function testDuplex (pass, type, stream) {
+ tape('isDuplex(' + type + ')', function (t) {
+ t.plan(1)
+ t.ok(pass === isDuplex(stream), type)
+ })
+}
+
+
+[ undefined, null, '', true, false, 0, 1, 1.0, 'string', {}, function foo () {} ].forEach(function (o) {
+ test(false, 'non-stream / primitive: ' + (JSON.stringify(o) || (o && o.toString()) || o), o)
+})
+
+
+test(false, 'fake stream obj', { pipe: function () {} })
+
+
+;(function () {
+
+ // looks like a stream!
+
+ function Stream () {
+ EE.call(this)
+ }
+ util.inherits(Stream, EE)
+ Stream.prototype.pipe = function () {}
+ Stream.Stream = Stream
+
+ test(false, 'fake stream "new Stream()"', new Stream())
+
+}())
+
+
+test(true, 'CoreStreams.Stream', new (CoreStreams.Stream)())
+test(true, 'CoreStreams.Readable', new (CoreStreams.Readable)())
+test(true, 'CoreStreams.Writable', new (CoreStreams.Writable)())
+test(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)())
+test(true, 'CoreStreams.Transform', new (CoreStreams.Transform)())
+test(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)())
+
+test(true, 'ReadableStream10.Readable', new (ReadableStream10.Readable)())
+test(true, 'ReadableStream10.Writable', new (ReadableStream10.Writable)())
+test(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)())
+test(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)())
+test(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)())
+
+test(true, 'ReadableStream11.Readable', new (ReadableStream11.Readable)())
+test(true, 'ReadableStream11.Writable', new (ReadableStream11.Writable)())
+test(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)())
+test(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)())
+test(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)())
+
+
+testReadable(false, 'CoreStreams.Stream', new (CoreStreams.Stream)())
+testReadable(true, 'CoreStreams.Readable', new (CoreStreams.Readable)())
+testReadable(false, 'CoreStreams.Writable', new (CoreStreams.Writable)())
+testReadable(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)())
+testReadable(true, 'CoreStreams.Transform', new (CoreStreams.Transform)())
+testReadable(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)())
+
+testReadable(true, 'ReadableStream10.Readable', new (ReadableStream10.Readable)())
+testReadable(false, 'ReadableStream10.Writable', new (ReadableStream10.Writable)())
+testReadable(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)())
+testReadable(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)())
+testReadable(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)())
+
+testReadable(true, 'ReadableStream11.Readable', new (ReadableStream11.Readable)())
+testReadable(false, 'ReadableStream11.Writable', new (ReadableStream11.Writable)())
+testReadable(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)())
+testReadable(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)())
+testReadable(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)())
+
+
+testWritable(false, 'CoreStreams.Stream', new (CoreStreams.Stream)())
+testWritable(false, 'CoreStreams.Readable', new (CoreStreams.Readable)())
+testWritable(true, 'CoreStreams.Writable', new (CoreStreams.Writable)())
+testWritable(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)())
+testWritable(true, 'CoreStreams.Transform', new (CoreStreams.Transform)())
+testWritable(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)())
+
+testWritable(false, 'ReadableStream10.Readable', new (ReadableStream10.Readable)())
+testWritable(true, 'ReadableStream10.Writable', new (ReadableStream10.Writable)())
+testWritable(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)())
+testWritable(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)())
+testWritable(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)())
+
+testWritable(false, 'ReadableStream11.Readable', new (ReadableStream11.Readable)())
+testWritable(true, 'ReadableStream11.Writable', new (ReadableStream11.Writable)())
+testWritable(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)())
+testWritable(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)())
+testWritable(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)())
+
+
+testDuplex(false, 'CoreStreams.Stream', new (CoreStreams.Stream)())
+testDuplex(false, 'CoreStreams.Readable', new (CoreStreams.Readable)())
+testDuplex(false, 'CoreStreams.Writable', new (CoreStreams.Writable)())
+testDuplex(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)())
+testDuplex(true, 'CoreStreams.Transform', new (CoreStreams.Transform)())
+testDuplex(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)())
+
+testDuplex(false, 'ReadableStream10.Readable', new (ReadableStream10.Readable)())
+testDuplex(false, 'ReadableStream10.Writable', new (ReadableStream10.Writable)())
+testDuplex(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)())
+testDuplex(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)())
+testDuplex(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)())
+
+testDuplex(false, 'ReadableStream11.Readable', new (ReadableStream11.Readable)())
+testDuplex(false, 'ReadableStream11.Writable', new (ReadableStream11.Writable)())
+testDuplex(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)())
+testDuplex(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)())
+testDuplex(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)())
+
+
+;[ CoreStreams, ReadableStream10, ReadableStream11 ].forEach(function (p) {
+ [ 'Stream', 'Readable', 'Writable', 'Duplex', 'Transform', 'PassThrough' ].forEach(function (k) {
+ if (!p[k])
+ return
+
+ function SubStream () {
+ p[k].call(this)
+ }
+ util.inherits(SubStream, p[k])
+
+ test(true, 'Stream subclass: ' + p.name + '.' + k, new SubStream())
+
+ })
+})
+
+
+
diff --git a/node_modules/request/node_modules/json-stringify-safe/.npmignore b/node_modules/request/node_modules/json-stringify-safe/.npmignore
new file mode 100644
index 000000000..17d6b3677
--- /dev/null
+++ b/node_modules/request/node_modules/json-stringify-safe/.npmignore
@@ -0,0 +1 @@
+/*.tgz
diff --git a/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md b/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md
new file mode 100644
index 000000000..42bcb60af
--- /dev/null
+++ b/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md
@@ -0,0 +1,14 @@
+## Unreleased
+- Fixes stringify to only take ancestors into account when checking
+ circularity.
+ It previously assumed every visited object was circular which led to [false
+ positives][issue9].
+ Uses the tiny serializer I wrote for [Must.js][must] a year and a half ago.
+- Fixes calling the `replacer` function in the proper context (`thisArg`).
+- Fixes calling the `cycleReplacer` function in the proper context (`thisArg`).
+- Speeds serializing by a factor of
+ Big-O(h-my-god-it-linearly-searched-every-object) it had ever seen. Searching
+ only the ancestors for a circular references speeds up things considerably.
+
+[must]: https://github.com/moll/js-must
+[issue9]: https://github.com/isaacs/json-stringify-safe/issues/9
diff --git a/node_modules/request/node_modules/json-stringify-safe/LICENSE b/node_modules/request/node_modules/json-stringify-safe/LICENSE
new file mode 100644
index 000000000..19129e315
--- /dev/null
+++ b/node_modules/request/node_modules/json-stringify-safe/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/request/node_modules/json-stringify-safe/Makefile b/node_modules/request/node_modules/json-stringify-safe/Makefile
new file mode 100644
index 000000000..36088c723
--- /dev/null
+++ b/node_modules/request/node_modules/json-stringify-safe/Makefile
@@ -0,0 +1,35 @@
+NODE_OPTS =
+TEST_OPTS =
+
+love:
+ @echo "Feel like makin' love."
+
+test:
+ @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot $(TEST_OPTS)
+
+spec:
+ @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec $(TEST_OPTS)
+
+autotest:
+ @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot --watch $(TEST_OPTS)
+
+autospec:
+ @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec --watch $(TEST_OPTS)
+
+pack:
+ @file=$$(npm pack); echo "$$file"; tar tf "$$file"
+
+publish:
+ npm publish
+
+tag:
+ git tag "v$$(node -e 'console.log(require("./package").version)')"
+
+clean:
+ rm -f *.tgz
+ npm prune --production
+
+.PHONY: love
+.PHONY: test spec autotest autospec
+.PHONY: pack publish tag
+.PHONY: clean
diff --git a/node_modules/request/node_modules/json-stringify-safe/README.md b/node_modules/request/node_modules/json-stringify-safe/README.md
new file mode 100644
index 000000000..a11f302a3
--- /dev/null
+++ b/node_modules/request/node_modules/json-stringify-safe/README.md
@@ -0,0 +1,52 @@
+# json-stringify-safe
+
+Like JSON.stringify, but doesn't throw on circular references.
+
+## Usage
+
+Takes the same arguments as `JSON.stringify`.
+
+```javascript
+var stringify = require('json-stringify-safe');
+var circularObj = {};
+circularObj.circularRef = circularObj;
+circularObj.list = [ circularObj, circularObj ];
+console.log(stringify(circularObj, null, 2));
+```
+
+Output:
+
+```json
+{
+ "circularRef": "[Circular]",
+ "list": [
+ "[Circular]",
+ "[Circular]"
+ ]
+}
+```
+
+## Details
+
+```
+stringify(obj, serializer, indent, decycler)
+```
+
+The first three arguments are the same as to JSON.stringify. The last
+is an argument that's only used when the object has been seen already.
+
+The default `decycler` function returns the string `'[Circular]'`.
+If, for example, you pass in `function(k,v){}` (return nothing) then it
+will prune cycles. If you pass in `function(k,v){ return {foo: 'bar'}}`,
+then cyclical objects will always be represented as `{"foo":"bar"}` in
+the result.
+
+```
+stringify.getSerialize(serializer, decycler)
+```
+
+Returns a serializer that can be used elsewhere. This is the actual
+function that's passed to JSON.stringify.
+
+**Note** that the function returned from `getSerialize` is stateful for now, so
+do **not** use it more than once.
diff --git a/node_modules/request/node_modules/json-stringify-safe/package.json b/node_modules/request/node_modules/json-stringify-safe/package.json
new file mode 100644
index 000000000..f09f9d571
--- /dev/null
+++ b/node_modules/request/node_modules/json-stringify-safe/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "json-stringify-safe",
+ "version": "5.0.1",
+ "description": "Like JSON.stringify, but doesn't blow up on circular refs.",
+ "keywords": [
+ "json",
+ "stringify",
+ "circular",
+ "safe"
+ ],
+ "homepage": "https://github.com/isaacs/json-stringify-safe",
+ "bugs": {
+ "url": "https://github.com/isaacs/json-stringify-safe/issues"
+ },
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me"
+ },
+ "contributors": [
+ {
+ "name": "Andri Möll",
+ "email": "andri@dot.ee",
+ "url": "http://themoll.com"
+ }
+ ],
+ "license": "ISC",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/json-stringify-safe.git"
+ },
+ "main": "stringify.js",
+ "scripts": {
+ "test": "node test.js"
+ },
+ "devDependencies": {
+ "mocha": ">= 2.1.0 < 3",
+ "must": ">= 0.12 < 0.13",
+ "sinon": ">= 1.12.2 < 2"
+ },
+ "readme": "# json-stringify-safe\n\nLike JSON.stringify, but doesn't throw on circular references.\n\n## Usage\n\nTakes the same arguments as `JSON.stringify`.\n\n```javascript\nvar stringify = require('json-stringify-safe');\nvar circularObj = {};\ncircularObj.circularRef = circularObj;\ncircularObj.list = [ circularObj, circularObj ];\nconsole.log(stringify(circularObj, null, 2));\n```\n\nOutput:\n\n```json\n{\n \"circularRef\": \"[Circular]\",\n \"list\": [\n \"[Circular]\",\n \"[Circular]\"\n ]\n}\n```\n\n## Details\n\n```\nstringify(obj, serializer, indent, decycler)\n```\n\nThe first three arguments are the same as to JSON.stringify. The last\nis an argument that's only used when the object has been seen already.\n\nThe default `decycler` function returns the string `'[Circular]'`.\nIf, for example, you pass in `function(k,v){}` (return nothing) then it\nwill prune cycles. If you pass in `function(k,v){ return {foo: 'bar'}}`,\nthen cyclical objects will always be represented as `{\"foo\":\"bar\"}` in\nthe result.\n\n```\nstringify.getSerialize(serializer, decycler)\n```\n\nReturns a serializer that can be used elsewhere. This is the actual\nfunction that's passed to JSON.stringify.\n\n**Note** that the function returned from `getSerialize` is stateful for now, so\ndo **not** use it more than once.\n",
+ "readmeFilename": "README.md",
+ "_id": "json-stringify-safe@5.0.1",
+ "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb",
+ "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
+ "_from": "json-stringify-safe@>=5.0.1 <5.1.0"
+}
diff --git a/node_modules/request/node_modules/json-stringify-safe/stringify.js b/node_modules/request/node_modules/json-stringify-safe/stringify.js
new file mode 100644
index 000000000..124a45218
--- /dev/null
+++ b/node_modules/request/node_modules/json-stringify-safe/stringify.js
@@ -0,0 +1,27 @@
+exports = module.exports = stringify
+exports.getSerialize = serializer
+
+function stringify(obj, replacer, spaces, cycleReplacer) {
+ return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)
+}
+
+function serializer(replacer, cycleReplacer) {
+ var stack = [], keys = []
+
+ if (cycleReplacer == null) cycleReplacer = function(key, value) {
+ if (stack[0] === value) return "[Circular ~]"
+ return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"
+ }
+
+ return function(key, value) {
+ if (stack.length > 0) {
+ var thisPos = stack.indexOf(this)
+ ~thisPos ? stack.splice(thisPos + 1) : stack.push(this)
+ ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)
+ if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)
+ }
+ else stack.push(value)
+
+ return replacer == null ? value : replacer.call(this, key, value)
+ }
+}
diff --git a/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts b/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts
new file mode 100644
index 000000000..2544e5861
--- /dev/null
+++ b/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts
@@ -0,0 +1,2 @@
+--recursive
+--require must
diff --git a/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js b/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js
new file mode 100644
index 000000000..5b3258317
--- /dev/null
+++ b/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js
@@ -0,0 +1,246 @@
+var Sinon = require("sinon")
+var stringify = require("..")
+function jsonify(obj) { return JSON.stringify(obj, null, 2) }
+
+describe("Stringify", function() {
+ it("must stringify circular objects", function() {
+ var obj = {name: "Alice"}
+ obj.self = obj
+ var json = stringify(obj, null, 2)
+ json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"}))
+ })
+
+ it("must stringify circular objects with intermediaries", function() {
+ var obj = {name: "Alice"}
+ obj.identity = {self: obj}
+ var json = stringify(obj, null, 2)
+ json.must.eql(jsonify({name: "Alice", identity: {self: "[Circular ~]"}}))
+ })
+
+ it("must stringify circular objects deeper", function() {
+ var obj = {name: "Alice", child: {name: "Bob"}}
+ obj.child.self = obj.child
+
+ stringify(obj, null, 2).must.eql(jsonify({
+ name: "Alice",
+ child: {name: "Bob", self: "[Circular ~.child]"}
+ }))
+ })
+
+ it("must stringify circular objects deeper with intermediaries", function() {
+ var obj = {name: "Alice", child: {name: "Bob"}}
+ obj.child.identity = {self: obj.child}
+
+ stringify(obj, null, 2).must.eql(jsonify({
+ name: "Alice",
+ child: {name: "Bob", identity: {self: "[Circular ~.child]"}}
+ }))
+ })
+
+ it("must stringify circular objects in an array", function() {
+ var obj = {name: "Alice"}
+ obj.self = [obj, obj]
+
+ stringify(obj, null, 2).must.eql(jsonify({
+ name: "Alice", self: ["[Circular ~]", "[Circular ~]"]
+ }))
+ })
+
+ it("must stringify circular objects deeper in an array", function() {
+ var obj = {name: "Alice", children: [{name: "Bob"}, {name: "Eve"}]}
+ obj.children[0].self = obj.children[0]
+ obj.children[1].self = obj.children[1]
+
+ stringify(obj, null, 2).must.eql(jsonify({
+ name: "Alice",
+ children: [
+ {name: "Bob", self: "[Circular ~.children.0]"},
+ {name: "Eve", self: "[Circular ~.children.1]"}
+ ]
+ }))
+ })
+
+ it("must stringify circular arrays", function() {
+ var obj = []
+ obj.push(obj)
+ obj.push(obj)
+ var json = stringify(obj, null, 2)
+ json.must.eql(jsonify(["[Circular ~]", "[Circular ~]"]))
+ })
+
+ it("must stringify circular arrays with intermediaries", function() {
+ var obj = []
+ obj.push({name: "Alice", self: obj})
+ obj.push({name: "Bob", self: obj})
+
+ stringify(obj, null, 2).must.eql(jsonify([
+ {name: "Alice", self: "[Circular ~]"},
+ {name: "Bob", self: "[Circular ~]"}
+ ]))
+ })
+
+ it("must stringify repeated objects in objects", function() {
+ var obj = {}
+ var alice = {name: "Alice"}
+ obj.alice1 = alice
+ obj.alice2 = alice
+
+ stringify(obj, null, 2).must.eql(jsonify({
+ alice1: {name: "Alice"},
+ alice2: {name: "Alice"}
+ }))
+ })
+
+ it("must stringify repeated objects in arrays", function() {
+ var alice = {name: "Alice"}
+ var obj = [alice, alice]
+ var json = stringify(obj, null, 2)
+ json.must.eql(jsonify([{name: "Alice"}, {name: "Alice"}]))
+ })
+
+ it("must call given decycler and use its output", function() {
+ var obj = {}
+ obj.a = obj
+ obj.b = obj
+
+ var decycle = Sinon.spy(function() { return decycle.callCount })
+ var json = stringify(obj, null, 2, decycle)
+ json.must.eql(jsonify({a: 1, b: 2}, null, 2))
+
+ decycle.callCount.must.equal(2)
+ decycle.thisValues[0].must.equal(obj)
+ decycle.args[0][0].must.equal("a")
+ decycle.args[0][1].must.equal(obj)
+ decycle.thisValues[1].must.equal(obj)
+ decycle.args[1][0].must.equal("b")
+ decycle.args[1][1].must.equal(obj)
+ })
+
+ it("must call replacer and use its output", function() {
+ var obj = {name: "Alice", child: {name: "Bob"}}
+
+ var replacer = Sinon.spy(bangString)
+ var json = stringify(obj, replacer, 2)
+ json.must.eql(jsonify({name: "Alice!", child: {name: "Bob!"}}))
+
+ replacer.callCount.must.equal(4)
+ replacer.args[0][0].must.equal("")
+ replacer.args[0][1].must.equal(obj)
+ replacer.thisValues[1].must.equal(obj)
+ replacer.args[1][0].must.equal("name")
+ replacer.args[1][1].must.equal("Alice")
+ replacer.thisValues[2].must.equal(obj)
+ replacer.args[2][0].must.equal("child")
+ replacer.args[2][1].must.equal(obj.child)
+ replacer.thisValues[3].must.equal(obj.child)
+ replacer.args[3][0].must.equal("name")
+ replacer.args[3][1].must.equal("Bob")
+ })
+
+ it("must call replacer after describing circular references", function() {
+ var obj = {name: "Alice"}
+ obj.self = obj
+
+ var replacer = Sinon.spy(bangString)
+ var json = stringify(obj, replacer, 2)
+ json.must.eql(jsonify({name: "Alice!", self: "[Circular ~]!"}))
+
+ replacer.callCount.must.equal(3)
+ replacer.args[0][0].must.equal("")
+ replacer.args[0][1].must.equal(obj)
+ replacer.thisValues[1].must.equal(obj)
+ replacer.args[1][0].must.equal("name")
+ replacer.args[1][1].must.equal("Alice")
+ replacer.thisValues[2].must.equal(obj)
+ replacer.args[2][0].must.equal("self")
+ replacer.args[2][1].must.equal("[Circular ~]")
+ })
+
+ it("must call given decycler and use its output for nested objects",
+ function() {
+ var obj = {}
+ obj.a = obj
+ obj.b = {self: obj}
+
+ var decycle = Sinon.spy(function() { return decycle.callCount })
+ var json = stringify(obj, null, 2, decycle)
+ json.must.eql(jsonify({a: 1, b: {self: 2}}))
+
+ decycle.callCount.must.equal(2)
+ decycle.args[0][0].must.equal("a")
+ decycle.args[0][1].must.equal(obj)
+ decycle.args[1][0].must.equal("self")
+ decycle.args[1][1].must.equal(obj)
+ })
+
+ it("must use decycler's output when it returned null", function() {
+ var obj = {a: "b"}
+ obj.self = obj
+ obj.selves = [obj, obj]
+
+ function decycle() { return null }
+ stringify(obj, null, 2, decycle).must.eql(jsonify({
+ a: "b",
+ self: null,
+ selves: [null, null]
+ }))
+ })
+
+ it("must use decycler's output when it returned undefined", function() {
+ var obj = {a: "b"}
+ obj.self = obj
+ obj.selves = [obj, obj]
+
+ function decycle() {}
+ stringify(obj, null, 2, decycle).must.eql(jsonify({
+ a: "b",
+ selves: [null, null]
+ }))
+ })
+
+ it("must throw given a decycler that returns a cycle", function() {
+ var obj = {}
+ obj.self = obj
+ var err
+ function identity(key, value) { return value }
+ try { stringify(obj, null, 2, identity) } catch (ex) { err = ex }
+ err.must.be.an.instanceof(TypeError)
+ })
+
+ describe(".getSerialize", function() {
+ it("must stringify circular objects", function() {
+ var obj = {a: "b"}
+ obj.circularRef = obj
+ obj.list = [obj, obj]
+
+ var json = JSON.stringify(obj, stringify.getSerialize(), 2)
+ json.must.eql(jsonify({
+ "a": "b",
+ "circularRef": "[Circular ~]",
+ "list": ["[Circular ~]", "[Circular ~]"]
+ }))
+ })
+
+ // This is the behavior as of Mar 3, 2015.
+ // The serializer function keeps state inside the returned function and
+ // so far I'm not sure how to not do that. JSON.stringify's replacer is not
+ // called _after_ serialization.
+ xit("must return a function that could be called twice", function() {
+ var obj = {name: "Alice"}
+ obj.self = obj
+
+ var json
+ var serializer = stringify.getSerialize()
+
+ json = JSON.stringify(obj, serializer, 2)
+ json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"}))
+
+ json = JSON.stringify(obj, serializer, 2)
+ json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"}))
+ })
+ })
+})
+
+function bangString(key, value) {
+ return typeof value == "string" ? value + "!" : value
+}
diff --git a/node_modules/request/node_modules/mime-types/HISTORY.md b/node_modules/request/node_modules/mime-types/HISTORY.md
new file mode 100644
index 000000000..3057e4940
--- /dev/null
+++ b/node_modules/request/node_modules/mime-types/HISTORY.md
@@ -0,0 +1,171 @@
+2.1.7 / 2015-09-20
+==================
+
+ * deps: mime-db@~1.19.0
+ - Add new mime types
+
+2.1.6 / 2015-09-03
+==================
+
+ * deps: mime-db@~1.18.0
+ - Add new mime types
+
+2.1.5 / 2015-08-20
+==================
+
+ * deps: mime-db@~1.17.0
+ - Add new mime types
+
+2.1.4 / 2015-07-30
+==================
+
+ * deps: mime-db@~1.16.0
+ - Add new mime types
+
+2.1.3 / 2015-07-13
+==================
+
+ * deps: mime-db@~1.15.0
+ - Add new mime types
+
+2.1.2 / 2015-06-25
+==================
+
+ * deps: mime-db@~1.14.0
+ - Add new mime types
+
+2.1.1 / 2015-06-08
+==================
+
+ * perf: fix deopt during mapping
+
+2.1.0 / 2015-06-07
+==================
+
+ * Fix incorrectly treating extension-less file name as extension
+ - i.e. `'path/to/json'` will no longer return `application/json`
+ * Fix `.charset(type)` to accept parameters
+ * Fix `.charset(type)` to match case-insensitive
+ * Improve generation of extension to MIME mapping
+ * Refactor internals for readability and no argument reassignment
+ * Prefer `application/*` MIME types from the same source
+ * Prefer any type over `application/octet-stream`
+ * deps: mime-db@~1.13.0
+ - Add nginx as a source
+ - Add new mime types
+
+2.0.14 / 2015-06-06
+===================
+
+ * deps: mime-db@~1.12.0
+ - Add new mime types
+
+2.0.13 / 2015-05-31
+===================
+
+ * deps: mime-db@~1.11.0
+ - Add new mime types
+
+2.0.12 / 2015-05-19
+===================
+
+ * deps: mime-db@~1.10.0
+ - Add new mime types
+
+2.0.11 / 2015-05-05
+===================
+
+ * deps: mime-db@~1.9.1
+ - Add new mime types
+
+2.0.10 / 2015-03-13
+===================
+
+ * deps: mime-db@~1.8.0
+ - Add new mime types
+
+2.0.9 / 2015-02-09
+==================
+
+ * deps: mime-db@~1.7.0
+ - Add new mime types
+ - Community extensions ownership transferred from `node-mime`
+
+2.0.8 / 2015-01-29
+==================
+
+ * deps: mime-db@~1.6.0
+ - Add new mime types
+
+2.0.7 / 2014-12-30
+==================
+
+ * deps: mime-db@~1.5.0
+ - Add new mime types
+ - Fix various invalid MIME type entries
+
+2.0.6 / 2014-12-30
+==================
+
+ * deps: mime-db@~1.4.0
+ - Add new mime types
+ - Fix various invalid MIME type entries
+ - Remove example template MIME types
+
+2.0.5 / 2014-12-29
+==================
+
+ * deps: mime-db@~1.3.1
+ - Fix missing extensions
+
+2.0.4 / 2014-12-10
+==================
+
+ * deps: mime-db@~1.3.0
+ - Add new mime types
+
+2.0.3 / 2014-11-09
+==================
+
+ * deps: mime-db@~1.2.0
+ - Add new mime types
+
+2.0.2 / 2014-09-28
+==================
+
+ * deps: mime-db@~1.1.0
+ - Add new mime types
+ - Add additional compressible
+ - Update charsets
+
+2.0.1 / 2014-09-07
+==================
+
+ * Support Node.js 0.6
+
+2.0.0 / 2014-09-02
+==================
+
+ * Use `mime-db`
+ * Remove `.define()`
+
+1.0.2 / 2014-08-04
+==================
+
+ * Set charset=utf-8 for `text/javascript`
+
+1.0.1 / 2014-06-24
+==================
+
+ * Add `text/jsx` type
+
+1.0.0 / 2014-05-12
+==================
+
+ * Return `false` for unknown types
+ * Set charset=utf-8 for `application/json`
+
+0.1.0 / 2014-05-02
+==================
+
+ * Initial release
diff --git a/node_modules/request/node_modules/mime-types/LICENSE b/node_modules/request/node_modules/mime-types/LICENSE
new file mode 100644
index 000000000..06166077b
--- /dev/null
+++ b/node_modules/request/node_modules/mime-types/LICENSE
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
+Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/request/node_modules/mime-types/README.md b/node_modules/request/node_modules/mime-types/README.md
new file mode 100644
index 000000000..e26295d04
--- /dev/null
+++ b/node_modules/request/node_modules/mime-types/README.md
@@ -0,0 +1,103 @@
+# mime-types
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+The ultimate javascript content-type utility.
+
+Similar to [node-mime](https://github.com/broofa/node-mime), except:
+
+- __No fallbacks.__ Instead of naively returning the first available type, `mime-types` simply returns `false`,
+ so do `var type = mime.lookup('unrecognized') || 'application/octet-stream'`.
+- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.
+- Additional mime types are added such as jade and stylus via [mime-db](https://github.com/jshttp/mime-db)
+- No `.define()` functionality
+
+Otherwise, the API is compatible.
+
+## Install
+
+```sh
+$ npm install mime-types
+```
+
+## Adding Types
+
+All mime types are based on [mime-db](https://github.com/jshttp/mime-db),
+so open a PR there if you'd like to add mime types.
+
+## API
+
+```js
+var mime = require('mime-types')
+```
+
+All functions return `false` if input is invalid or not found.
+
+### mime.lookup(path)
+
+Lookup the content-type associated with a file.
+
+```js
+mime.lookup('json') // 'application/json'
+mime.lookup('.md') // 'text/x-markdown'
+mime.lookup('file.html') // 'text/html'
+mime.lookup('folder/file.js') // 'application/javascript'
+mime.lookup('folder/.htaccess') // false
+
+mime.lookup('cats') // false
+```
+
+### mime.contentType(type)
+
+Create a full content-type header given a content-type or extension.
+
+```js
+mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
+mime.contentType('file.json') // 'application/json; charset=utf-8'
+
+// from a full path
+mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'
+```
+
+### mime.extension(type)
+
+Get the default extension for a content-type.
+
+```js
+mime.extension('application/octet-stream') // 'bin'
+```
+
+### mime.charset(type)
+
+Lookup the implied default charset of a content-type.
+
+```js
+mime.charset('text/x-markdown') // 'UTF-8'
+```
+
+### var type = mime.types[extension]
+
+A map of content-types by extension.
+
+### [extensions...] = mime.extensions[type]
+
+A map of extensions by content-type.
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/mime-types.svg
+[npm-url]: https://npmjs.org/package/mime-types
+[node-version-image]: https://img.shields.io/node/v/mime-types.svg
+[node-version-url]: http://nodejs.org/download/
+[travis-image]: https://img.shields.io/travis/jshttp/mime-types/master.svg
+[travis-url]: https://travis-ci.org/jshttp/mime-types
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/mime-types
+[downloads-image]: https://img.shields.io/npm/dm/mime-types.svg
+[downloads-url]: https://npmjs.org/package/mime-types
diff --git a/node_modules/request/node_modules/mime-types/index.js b/node_modules/request/node_modules/mime-types/index.js
new file mode 100644
index 000000000..f7008b246
--- /dev/null
+++ b/node_modules/request/node_modules/mime-types/index.js
@@ -0,0 +1,188 @@
+/*!
+ * mime-types
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var db = require('mime-db')
+var extname = require('path').extname
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var extractTypeRegExp = /^\s*([^;\s]*)(?:;|\s|$)/
+var textTypeRegExp = /^text\//i
+
+/**
+ * Module exports.
+ * @public
+ */
+
+exports.charset = charset
+exports.charsets = { lookup: charset }
+exports.contentType = contentType
+exports.extension = extension
+exports.extensions = Object.create(null)
+exports.lookup = lookup
+exports.types = Object.create(null)
+
+// Populate the extensions/types maps
+populateMaps(exports.extensions, exports.types)
+
+/**
+ * Get the default charset for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
+
+function charset(type) {
+ if (!type || typeof type !== 'string') {
+ return false
+ }
+
+ // TODO: use media-typer
+ var match = extractTypeRegExp.exec(type)
+ var mime = match && db[match[1].toLowerCase()]
+
+ if (mime && mime.charset) {
+ return mime.charset
+ }
+
+ // default text/* to utf-8
+ if (match && textTypeRegExp.test(match[1])) {
+ return 'UTF-8'
+ }
+
+ return false
+}
+
+/**
+ * Create a full Content-Type header given a MIME type or extension.
+ *
+ * @param {string} str
+ * @return {boolean|string}
+ */
+
+function contentType(str) {
+ // TODO: should this even be in this module?
+ if (!str || typeof str !== 'string') {
+ return false
+ }
+
+ var mime = str.indexOf('/') === -1
+ ? exports.lookup(str)
+ : str
+
+ if (!mime) {
+ return false
+ }
+
+ // TODO: use content-type or other module
+ if (mime.indexOf('charset') === -1) {
+ var charset = exports.charset(mime)
+ if (charset) mime += '; charset=' + charset.toLowerCase()
+ }
+
+ return mime
+}
+
+/**
+ * Get the default extension for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
+
+function extension(type) {
+ if (!type || typeof type !== 'string') {
+ return false
+ }
+
+ // TODO: use media-typer
+ var match = extractTypeRegExp.exec(type)
+
+ // get extensions
+ var exts = match && exports.extensions[match[1].toLowerCase()]
+
+ if (!exts || !exts.length) {
+ return false
+ }
+
+ return exts[0]
+}
+
+/**
+ * Lookup the MIME type for a file path/extension.
+ *
+ * @param {string} path
+ * @return {boolean|string}
+ */
+
+function lookup(path) {
+ if (!path || typeof path !== 'string') {
+ return false
+ }
+
+ // get the extension ("ext" or ".ext" or full path)
+ var extension = extname('x.' + path)
+ .toLowerCase()
+ .substr(1)
+
+ if (!extension) {
+ return false
+ }
+
+ return exports.types[extension] || false
+}
+
+/**
+ * Populate the extensions and types maps.
+ * @private
+ */
+
+function populateMaps(extensions, types) {
+ // source preference (least -> most)
+ var preference = ['nginx', 'apache', undefined, 'iana']
+
+ Object.keys(db).forEach(function forEachMimeType(type) {
+ var mime = db[type]
+ var exts = mime.extensions
+
+ if (!exts || !exts.length) {
+ return
+ }
+
+ // mime -> extensions
+ extensions[type] = exts
+
+ // extension -> mime
+ for (var i = 0; i < exts.length; i++) {
+ var extension = exts[i]
+
+ if (types[extension]) {
+ var from = preference.indexOf(db[types[extension]].source)
+ var to = preference.indexOf(mime.source)
+
+ if (types[extension] !== 'application/octet-stream'
+ && from > to || (from === to && types[extension].substr(0, 12) === 'application/')) {
+ // skip the remapping
+ continue
+ }
+ }
+
+ // set the extension -> mime
+ types[extension] = type
+ }
+ })
+}
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md b/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
new file mode 100644
index 000000000..3088a726f
--- /dev/null
+++ b/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
@@ -0,0 +1,274 @@
+1.19.0 / 2015-09-17
+===================
+
+ * Add `application/vnd.3gpp-prose-pc3ch+xml`
+ * Add `application/vnd.3gpp.srvcc-info+xml`
+ * Add `application/vnd.apple.pkpass`
+ * Add `application/vnd.drive+json`
+
+1.18.0 / 2015-09-03
+===================
+
+ * Add `application/pkcs12`
+ * Add `application/vnd.3gpp-prose+xml`
+ * Add `application/vnd.3gpp.mid-call+xml`
+ * Add `application/vnd.3gpp.state-and-event-info+xml`
+ * Add `application/vnd.anki`
+ * Add `application/vnd.firemonkeys.cloudcell`
+ * Add `application/vnd.openblox.game+xml`
+ * Add `application/vnd.openblox.game-binary`
+
+1.17.0 / 2015-08-13
+===================
+
+ * Add `application/x-msdos-program`
+ * Add `audio/g711-0`
+ * Add `image/vnd.mozilla.apng`
+ * Add extension `.exe` to `application/x-msdos-program`
+
+1.16.0 / 2015-07-29
+===================
+
+ * Add `application/vnd.uri-map`
+
+1.15.0 / 2015-07-13
+===================
+
+ * Add `application/x-httpd-php`
+
+1.14.0 / 2015-06-25
+===================
+
+ * Add `application/scim+json`
+ * Add `application/vnd.3gpp.ussd+xml`
+ * Add `application/vnd.biopax.rdf+xml`
+ * Add `text/x-processing`
+
+1.13.0 / 2015-06-07
+===================
+
+ * Add nginx as a source
+ * Add `application/x-cocoa`
+ * Add `application/x-java-archive-diff`
+ * Add `application/x-makeself`
+ * Add `application/x-perl`
+ * Add `application/x-pilot`
+ * Add `application/x-redhat-package-manager`
+ * Add `application/x-sea`
+ * Add `audio/x-m4a`
+ * Add `audio/x-realaudio`
+ * Add `image/x-jng`
+ * Add `text/mathml`
+
+1.12.0 / 2015-06-05
+===================
+
+ * Add `application/bdoc`
+ * Add `application/vnd.hyperdrive+json`
+ * Add `application/x-bdoc`
+ * Add extension `.rtf` to `text/rtf`
+
+1.11.0 / 2015-05-31
+===================
+
+ * Add `audio/wav`
+ * Add `audio/wave`
+ * Add extension `.litcoffee` to `text/coffeescript`
+ * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data`
+ * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install`
+
+1.10.0 / 2015-05-19
+===================
+
+ * Add `application/vnd.balsamiq.bmpr`
+ * Add `application/vnd.microsoft.portable-executable`
+ * Add `application/x-ns-proxy-autoconfig`
+
+1.9.1 / 2015-04-19
+==================
+
+ * Remove `.json` extension from `application/manifest+json`
+ - This is causing bugs downstream
+
+1.9.0 / 2015-04-19
+==================
+
+ * Add `application/manifest+json`
+ * Add `application/vnd.micro+json`
+ * Add `image/vnd.zbrush.pcx`
+ * Add `image/x-ms-bmp`
+
+1.8.0 / 2015-03-13
+==================
+
+ * Add `application/vnd.citationstyles.style+xml`
+ * Add `application/vnd.fastcopy-disk-image`
+ * Add `application/vnd.gov.sk.xmldatacontainer+xml`
+ * Add extension `.jsonld` to `application/ld+json`
+
+1.7.0 / 2015-02-08
+==================
+
+ * Add `application/vnd.gerber`
+ * Add `application/vnd.msa-disk-image`
+
+1.6.1 / 2015-02-05
+==================
+
+ * Community extensions ownership transferred from `node-mime`
+
+1.6.0 / 2015-01-29
+==================
+
+ * Add `application/jose`
+ * Add `application/jose+json`
+ * Add `application/json-seq`
+ * Add `application/jwk+json`
+ * Add `application/jwk-set+json`
+ * Add `application/jwt`
+ * Add `application/rdap+json`
+ * Add `application/vnd.gov.sk.e-form+xml`
+ * Add `application/vnd.ims.imsccv1p3`
+
+1.5.0 / 2014-12-30
+==================
+
+ * Add `application/vnd.oracle.resource+json`
+ * Fix various invalid MIME type entries
+ - `application/mbox+xml`
+ - `application/oscp-response`
+ - `application/vwg-multiplexed`
+ - `audio/g721`
+
+1.4.0 / 2014-12-21
+==================
+
+ * Add `application/vnd.ims.imsccv1p2`
+ * Fix various invalid MIME type entries
+ - `application/vnd-acucobol`
+ - `application/vnd-curl`
+ - `application/vnd-dart`
+ - `application/vnd-dxr`
+ - `application/vnd-fdf`
+ - `application/vnd-mif`
+ - `application/vnd-sema`
+ - `application/vnd-wap-wmlc`
+ - `application/vnd.adobe.flash-movie`
+ - `application/vnd.dece-zip`
+ - `application/vnd.dvb_service`
+ - `application/vnd.micrografx-igx`
+ - `application/vnd.sealed-doc`
+ - `application/vnd.sealed-eml`
+ - `application/vnd.sealed-mht`
+ - `application/vnd.sealed-ppt`
+ - `application/vnd.sealed-tiff`
+ - `application/vnd.sealed-xls`
+ - `application/vnd.sealedmedia.softseal-html`
+ - `application/vnd.sealedmedia.softseal-pdf`
+ - `application/vnd.wap-slc`
+ - `application/vnd.wap-wbxml`
+ - `audio/vnd.sealedmedia.softseal-mpeg`
+ - `image/vnd-djvu`
+ - `image/vnd-svf`
+ - `image/vnd-wap-wbmp`
+ - `image/vnd.sealed-png`
+ - `image/vnd.sealedmedia.softseal-gif`
+ - `image/vnd.sealedmedia.softseal-jpg`
+ - `model/vnd-dwf`
+ - `model/vnd.parasolid.transmit-binary`
+ - `model/vnd.parasolid.transmit-text`
+ - `text/vnd-a`
+ - `text/vnd-curl`
+ - `text/vnd.wap-wml`
+ * Remove example template MIME types
+ - `application/example`
+ - `audio/example`
+ - `image/example`
+ - `message/example`
+ - `model/example`
+ - `multipart/example`
+ - `text/example`
+ - `video/example`
+
+1.3.1 / 2014-12-16
+==================
+
+ * Fix missing extensions
+ - `application/json5`
+ - `text/hjson`
+
+1.3.0 / 2014-12-07
+==================
+
+ * Add `application/a2l`
+ * Add `application/aml`
+ * Add `application/atfx`
+ * Add `application/atxml`
+ * Add `application/cdfx+xml`
+ * Add `application/dii`
+ * Add `application/json5`
+ * Add `application/lxf`
+ * Add `application/mf4`
+ * Add `application/vnd.apache.thrift.compact`
+ * Add `application/vnd.apache.thrift.json`
+ * Add `application/vnd.coffeescript`
+ * Add `application/vnd.enphase.envoy`
+ * Add `application/vnd.ims.imsccv1p1`
+ * Add `text/csv-schema`
+ * Add `text/hjson`
+ * Add `text/markdown`
+ * Add `text/yaml`
+
+1.2.0 / 2014-11-09
+==================
+
+ * Add `application/cea`
+ * Add `application/dit`
+ * Add `application/vnd.gov.sk.e-form+zip`
+ * Add `application/vnd.tmd.mediaflex.api+xml`
+ * Type `application/epub+zip` is now IANA-registered
+
+1.1.2 / 2014-10-23
+==================
+
+ * Rebuild database for `application/x-www-form-urlencoded` change
+
+1.1.1 / 2014-10-20
+==================
+
+ * Mark `application/x-www-form-urlencoded` as compressible.
+
+1.1.0 / 2014-09-28
+==================
+
+ * Add `application/font-woff2`
+
+1.0.3 / 2014-09-25
+==================
+
+ * Fix engine requirement in package
+
+1.0.2 / 2014-09-25
+==================
+
+ * Add `application/coap-group+json`
+ * Add `application/dcd`
+ * Add `application/vnd.apache.thrift.binary`
+ * Add `image/vnd.tencent.tap`
+ * Mark all JSON-derived types as compressible
+ * Update `text/vtt` data
+
+1.0.1 / 2014-08-30
+==================
+
+ * Fix extension ordering
+
+1.0.0 / 2014-08-30
+==================
+
+ * Add `application/atf`
+ * Add `application/merge-patch+json`
+ * Add `multipart/x-mixed-replace`
+ * Add `source: 'apache'` metadata
+ * Add `source: 'iana'` metadata
+ * Remove badly-assumed charset data
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/LICENSE b/node_modules/request/node_modules/mime-types/node_modules/mime-db/LICENSE
new file mode 100644
index 000000000..a7ae8ee9b
--- /dev/null
+++ b/node_modules/request/node_modules/mime-types/node_modules/mime-db/LICENSE
@@ -0,0 +1,22 @@
+
+The MIT License (MIT)
+
+Copyright (c) 2014 Jonathan Ong me@jongleberry.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md b/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md
new file mode 100644
index 000000000..164cca030
--- /dev/null
+++ b/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md
@@ -0,0 +1,82 @@
+# mime-db
+
+[![NPM Version][npm-version-image]][npm-url]
+[![NPM Downloads][npm-downloads-image]][npm-url]
+[![Node.js Version][node-image]][node-url]
+[![Build Status][travis-image]][travis-url]
+[![Coverage Status][coveralls-image]][coveralls-url]
+
+This is a database of all mime types.
+It consists of a single, public JSON file and does not include any logic,
+allowing it to remain as un-opinionated as possible with an API.
+It aggregates data from the following sources:
+
+- http://www.iana.org/assignments/media-types/media-types.xhtml
+- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
+- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types
+
+## Installation
+
+```bash
+npm install mime-db
+```
+
+### Database Download
+
+If you're crazy enough to use this in the browser, you can just grab the
+JSON file using [RawGit](https://rawgit.com/). It is recommended to replace
+`master` with [a release tag](https://github.com/jshttp/mime-db/tags) as the
+JSON format may change in the future.
+
+```
+https://cdn.rawgit.com/jshttp/mime-db/master/db.json
+```
+
+## Usage
+
+```js
+var db = require('mime-db');
+
+// grab data on .js files
+var data = db['application/javascript'];
+```
+
+## Data Structure
+
+The JSON file is a map lookup for lowercased mime types.
+Each mime type has the following properties:
+
+- `.source` - where the mime type is defined.
+ If not set, it's probably a custom media type.
+ - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)
+ - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml)
+ - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types)
+- `.extensions[]` - known extensions associated with this mime type.
+- `.compressible` - whether a file of this type is can be gzipped.
+- `.charset` - the default charset associated with this type, if any.
+
+If unknown, every property could be `undefined`.
+
+## Contributing
+
+To edit the database, only make PRs against `src/custom.json` or
+`src/custom-suffix.json`.
+
+To update the build, run `npm run build`.
+
+## Adding Custom Media Types
+
+The best way to get new media types included in this library is to register
+them with the IANA. The community registration procedure is outlined in
+[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types
+registered with the IANA are automatically pulled into this library.
+
+[npm-version-image]: https://img.shields.io/npm/v/mime-db.svg
+[npm-downloads-image]: https://img.shields.io/npm/dm/mime-db.svg
+[npm-url]: https://npmjs.org/package/mime-db
+[travis-image]: https://img.shields.io/travis/jshttp/mime-db/master.svg
+[travis-url]: https://travis-ci.org/jshttp/mime-db
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-db/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master
+[node-image]: https://img.shields.io/node/v/mime-db.svg
+[node-url]: http://nodejs.org/download/
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json b/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
new file mode 100644
index 000000000..f5b1a8c51
--- /dev/null
+++ b/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
@@ -0,0 +1,6474 @@
+{
+ "application/1d-interleaved-parityfec": {
+ "source": "iana"
+ },
+ "application/3gpdash-qoe-report+xml": {
+ "source": "iana"
+ },
+ "application/3gpp-ims+xml": {
+ "source": "iana"
+ },
+ "application/a2l": {
+ "source": "iana"
+ },
+ "application/activemessage": {
+ "source": "iana"
+ },
+ "application/alto-costmap+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-costmapfilter+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-directory+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-endpointcost+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-endpointcostparams+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-endpointprop+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-endpointpropparams+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-error+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-networkmap+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/alto-networkmapfilter+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/aml": {
+ "source": "iana"
+ },
+ "application/andrew-inset": {
+ "source": "iana",
+ "extensions": ["ez"]
+ },
+ "application/applefile": {
+ "source": "iana"
+ },
+ "application/applixware": {
+ "source": "apache",
+ "extensions": ["aw"]
+ },
+ "application/atf": {
+ "source": "iana"
+ },
+ "application/atfx": {
+ "source": "iana"
+ },
+ "application/atom+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["atom"]
+ },
+ "application/atomcat+xml": {
+ "source": "iana",
+ "extensions": ["atomcat"]
+ },
+ "application/atomdeleted+xml": {
+ "source": "iana"
+ },
+ "application/atomicmail": {
+ "source": "iana"
+ },
+ "application/atomsvc+xml": {
+ "source": "iana",
+ "extensions": ["atomsvc"]
+ },
+ "application/atxml": {
+ "source": "iana"
+ },
+ "application/auth-policy+xml": {
+ "source": "iana"
+ },
+ "application/bacnet-xdd+zip": {
+ "source": "iana"
+ },
+ "application/batch-smtp": {
+ "source": "iana"
+ },
+ "application/bdoc": {
+ "compressible": false,
+ "extensions": ["bdoc"]
+ },
+ "application/beep+xml": {
+ "source": "iana"
+ },
+ "application/calendar+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/calendar+xml": {
+ "source": "iana"
+ },
+ "application/call-completion": {
+ "source": "iana"
+ },
+ "application/cals-1840": {
+ "source": "iana"
+ },
+ "application/cbor": {
+ "source": "iana"
+ },
+ "application/ccmp+xml": {
+ "source": "iana"
+ },
+ "application/ccxml+xml": {
+ "source": "iana",
+ "extensions": ["ccxml"]
+ },
+ "application/cdfx+xml": {
+ "source": "iana"
+ },
+ "application/cdmi-capability": {
+ "source": "iana",
+ "extensions": ["cdmia"]
+ },
+ "application/cdmi-container": {
+ "source": "iana",
+ "extensions": ["cdmic"]
+ },
+ "application/cdmi-domain": {
+ "source": "iana",
+ "extensions": ["cdmid"]
+ },
+ "application/cdmi-object": {
+ "source": "iana",
+ "extensions": ["cdmio"]
+ },
+ "application/cdmi-queue": {
+ "source": "iana",
+ "extensions": ["cdmiq"]
+ },
+ "application/cea": {
+ "source": "iana"
+ },
+ "application/cea-2018+xml": {
+ "source": "iana"
+ },
+ "application/cellml+xml": {
+ "source": "iana"
+ },
+ "application/cfw": {
+ "source": "iana"
+ },
+ "application/cms": {
+ "source": "iana"
+ },
+ "application/cnrp+xml": {
+ "source": "iana"
+ },
+ "application/coap-group+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/commonground": {
+ "source": "iana"
+ },
+ "application/conference-info+xml": {
+ "source": "iana"
+ },
+ "application/cpl+xml": {
+ "source": "iana"
+ },
+ "application/csrattrs": {
+ "source": "iana"
+ },
+ "application/csta+xml": {
+ "source": "iana"
+ },
+ "application/cstadata+xml": {
+ "source": "iana"
+ },
+ "application/cu-seeme": {
+ "source": "apache",
+ "extensions": ["cu"]
+ },
+ "application/cybercash": {
+ "source": "iana"
+ },
+ "application/dart": {
+ "compressible": true
+ },
+ "application/dash+xml": {
+ "source": "iana",
+ "extensions": ["mdp"]
+ },
+ "application/dashdelta": {
+ "source": "iana"
+ },
+ "application/davmount+xml": {
+ "source": "iana",
+ "extensions": ["davmount"]
+ },
+ "application/dca-rft": {
+ "source": "iana"
+ },
+ "application/dcd": {
+ "source": "iana"
+ },
+ "application/dec-dx": {
+ "source": "iana"
+ },
+ "application/dialog-info+xml": {
+ "source": "iana"
+ },
+ "application/dicom": {
+ "source": "iana"
+ },
+ "application/dii": {
+ "source": "iana"
+ },
+ "application/dit": {
+ "source": "iana"
+ },
+ "application/dns": {
+ "source": "iana"
+ },
+ "application/docbook+xml": {
+ "source": "apache",
+ "extensions": ["dbk"]
+ },
+ "application/dskpp+xml": {
+ "source": "iana"
+ },
+ "application/dssc+der": {
+ "source": "iana",
+ "extensions": ["dssc"]
+ },
+ "application/dssc+xml": {
+ "source": "iana",
+ "extensions": ["xdssc"]
+ },
+ "application/dvcs": {
+ "source": "iana"
+ },
+ "application/ecmascript": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["ecma"]
+ },
+ "application/edi-consent": {
+ "source": "iana"
+ },
+ "application/edi-x12": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/edifact": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/emma+xml": {
+ "source": "iana",
+ "extensions": ["emma"]
+ },
+ "application/emotionml+xml": {
+ "source": "iana"
+ },
+ "application/encaprtp": {
+ "source": "iana"
+ },
+ "application/epp+xml": {
+ "source": "iana"
+ },
+ "application/epub+zip": {
+ "source": "iana",
+ "extensions": ["epub"]
+ },
+ "application/eshop": {
+ "source": "iana"
+ },
+ "application/exi": {
+ "source": "iana",
+ "extensions": ["exi"]
+ },
+ "application/fastinfoset": {
+ "source": "iana"
+ },
+ "application/fastsoap": {
+ "source": "iana"
+ },
+ "application/fdt+xml": {
+ "source": "iana"
+ },
+ "application/fits": {
+ "source": "iana"
+ },
+ "application/font-sfnt": {
+ "source": "iana"
+ },
+ "application/font-tdpfr": {
+ "source": "iana",
+ "extensions": ["pfr"]
+ },
+ "application/font-woff": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["woff"]
+ },
+ "application/font-woff2": {
+ "compressible": false,
+ "extensions": ["woff2"]
+ },
+ "application/framework-attributes+xml": {
+ "source": "iana"
+ },
+ "application/gml+xml": {
+ "source": "apache",
+ "extensions": ["gml"]
+ },
+ "application/gpx+xml": {
+ "source": "apache",
+ "extensions": ["gpx"]
+ },
+ "application/gxf": {
+ "source": "apache",
+ "extensions": ["gxf"]
+ },
+ "application/gzip": {
+ "source": "iana",
+ "compressible": false
+ },
+ "application/h224": {
+ "source": "iana"
+ },
+ "application/held+xml": {
+ "source": "iana"
+ },
+ "application/http": {
+ "source": "iana"
+ },
+ "application/hyperstudio": {
+ "source": "iana",
+ "extensions": ["stk"]
+ },
+ "application/ibe-key-request+xml": {
+ "source": "iana"
+ },
+ "application/ibe-pkg-reply+xml": {
+ "source": "iana"
+ },
+ "application/ibe-pp-data": {
+ "source": "iana"
+ },
+ "application/iges": {
+ "source": "iana"
+ },
+ "application/im-iscomposing+xml": {
+ "source": "iana"
+ },
+ "application/index": {
+ "source": "iana"
+ },
+ "application/index.cmd": {
+ "source": "iana"
+ },
+ "application/index.obj": {
+ "source": "iana"
+ },
+ "application/index.response": {
+ "source": "iana"
+ },
+ "application/index.vnd": {
+ "source": "iana"
+ },
+ "application/inkml+xml": {
+ "source": "iana",
+ "extensions": ["ink","inkml"]
+ },
+ "application/iotp": {
+ "source": "iana"
+ },
+ "application/ipfix": {
+ "source": "iana",
+ "extensions": ["ipfix"]
+ },
+ "application/ipp": {
+ "source": "iana"
+ },
+ "application/isup": {
+ "source": "iana"
+ },
+ "application/its+xml": {
+ "source": "iana"
+ },
+ "application/java-archive": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["jar","war","ear"]
+ },
+ "application/java-serialized-object": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["ser"]
+ },
+ "application/java-vm": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["class"]
+ },
+ "application/javascript": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["js"]
+ },
+ "application/jose": {
+ "source": "iana"
+ },
+ "application/jose+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/jrd+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/json": {
+ "source": "iana",
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["json","map"]
+ },
+ "application/json-patch+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/json-seq": {
+ "source": "iana"
+ },
+ "application/json5": {
+ "extensions": ["json5"]
+ },
+ "application/jsonml+json": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["jsonml"]
+ },
+ "application/jwk+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/jwk-set+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/jwt": {
+ "source": "iana"
+ },
+ "application/kpml-request+xml": {
+ "source": "iana"
+ },
+ "application/kpml-response+xml": {
+ "source": "iana"
+ },
+ "application/ld+json": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["jsonld"]
+ },
+ "application/link-format": {
+ "source": "iana"
+ },
+ "application/load-control+xml": {
+ "source": "iana"
+ },
+ "application/lost+xml": {
+ "source": "iana",
+ "extensions": ["lostxml"]
+ },
+ "application/lostsync+xml": {
+ "source": "iana"
+ },
+ "application/lxf": {
+ "source": "iana"
+ },
+ "application/mac-binhex40": {
+ "source": "iana",
+ "extensions": ["hqx"]
+ },
+ "application/mac-compactpro": {
+ "source": "apache",
+ "extensions": ["cpt"]
+ },
+ "application/macwriteii": {
+ "source": "iana"
+ },
+ "application/mads+xml": {
+ "source": "iana",
+ "extensions": ["mads"]
+ },
+ "application/manifest+json": {
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["webmanifest"]
+ },
+ "application/marc": {
+ "source": "iana",
+ "extensions": ["mrc"]
+ },
+ "application/marcxml+xml": {
+ "source": "iana",
+ "extensions": ["mrcx"]
+ },
+ "application/mathematica": {
+ "source": "iana",
+ "extensions": ["ma","nb","mb"]
+ },
+ "application/mathml+xml": {
+ "source": "iana",
+ "extensions": ["mathml"]
+ },
+ "application/mathml-content+xml": {
+ "source": "iana"
+ },
+ "application/mathml-presentation+xml": {
+ "source": "iana"
+ },
+ "application/mbms-associated-procedure-description+xml": {
+ "source": "iana"
+ },
+ "application/mbms-deregister+xml": {
+ "source": "iana"
+ },
+ "application/mbms-envelope+xml": {
+ "source": "iana"
+ },
+ "application/mbms-msk+xml": {
+ "source": "iana"
+ },
+ "application/mbms-msk-response+xml": {
+ "source": "iana"
+ },
+ "application/mbms-protection-description+xml": {
+ "source": "iana"
+ },
+ "application/mbms-reception-report+xml": {
+ "source": "iana"
+ },
+ "application/mbms-register+xml": {
+ "source": "iana"
+ },
+ "application/mbms-register-response+xml": {
+ "source": "iana"
+ },
+ "application/mbms-schedule+xml": {
+ "source": "iana"
+ },
+ "application/mbms-user-service-description+xml": {
+ "source": "iana"
+ },
+ "application/mbox": {
+ "source": "iana",
+ "extensions": ["mbox"]
+ },
+ "application/media-policy-dataset+xml": {
+ "source": "iana"
+ },
+ "application/media_control+xml": {
+ "source": "iana"
+ },
+ "application/mediaservercontrol+xml": {
+ "source": "iana",
+ "extensions": ["mscml"]
+ },
+ "application/merge-patch+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/metalink+xml": {
+ "source": "apache",
+ "extensions": ["metalink"]
+ },
+ "application/metalink4+xml": {
+ "source": "iana",
+ "extensions": ["meta4"]
+ },
+ "application/mets+xml": {
+ "source": "iana",
+ "extensions": ["mets"]
+ },
+ "application/mf4": {
+ "source": "iana"
+ },
+ "application/mikey": {
+ "source": "iana"
+ },
+ "application/mods+xml": {
+ "source": "iana",
+ "extensions": ["mods"]
+ },
+ "application/moss-keys": {
+ "source": "iana"
+ },
+ "application/moss-signature": {
+ "source": "iana"
+ },
+ "application/mosskey-data": {
+ "source": "iana"
+ },
+ "application/mosskey-request": {
+ "source": "iana"
+ },
+ "application/mp21": {
+ "source": "iana",
+ "extensions": ["m21","mp21"]
+ },
+ "application/mp4": {
+ "source": "iana",
+ "extensions": ["mp4s","m4p"]
+ },
+ "application/mpeg4-generic": {
+ "source": "iana"
+ },
+ "application/mpeg4-iod": {
+ "source": "iana"
+ },
+ "application/mpeg4-iod-xmt": {
+ "source": "iana"
+ },
+ "application/mrb-consumer+xml": {
+ "source": "iana"
+ },
+ "application/mrb-publish+xml": {
+ "source": "iana"
+ },
+ "application/msc-ivr+xml": {
+ "source": "iana"
+ },
+ "application/msc-mixer+xml": {
+ "source": "iana"
+ },
+ "application/msword": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["doc","dot"]
+ },
+ "application/mxf": {
+ "source": "iana",
+ "extensions": ["mxf"]
+ },
+ "application/nasdata": {
+ "source": "iana"
+ },
+ "application/news-checkgroups": {
+ "source": "iana"
+ },
+ "application/news-groupinfo": {
+ "source": "iana"
+ },
+ "application/news-transmission": {
+ "source": "iana"
+ },
+ "application/nlsml+xml": {
+ "source": "iana"
+ },
+ "application/nss": {
+ "source": "iana"
+ },
+ "application/ocsp-request": {
+ "source": "iana"
+ },
+ "application/ocsp-response": {
+ "source": "iana"
+ },
+ "application/octet-stream": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]
+ },
+ "application/oda": {
+ "source": "iana",
+ "extensions": ["oda"]
+ },
+ "application/odx": {
+ "source": "iana"
+ },
+ "application/oebps-package+xml": {
+ "source": "iana",
+ "extensions": ["opf"]
+ },
+ "application/ogg": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["ogx"]
+ },
+ "application/omdoc+xml": {
+ "source": "apache",
+ "extensions": ["omdoc"]
+ },
+ "application/onenote": {
+ "source": "apache",
+ "extensions": ["onetoc","onetoc2","onetmp","onepkg"]
+ },
+ "application/oxps": {
+ "source": "iana",
+ "extensions": ["oxps"]
+ },
+ "application/p2p-overlay+xml": {
+ "source": "iana"
+ },
+ "application/parityfec": {
+ "source": "iana"
+ },
+ "application/patch-ops-error+xml": {
+ "source": "iana",
+ "extensions": ["xer"]
+ },
+ "application/pdf": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["pdf"]
+ },
+ "application/pdx": {
+ "source": "iana"
+ },
+ "application/pgp-encrypted": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["pgp"]
+ },
+ "application/pgp-keys": {
+ "source": "iana"
+ },
+ "application/pgp-signature": {
+ "source": "iana",
+ "extensions": ["asc","sig"]
+ },
+ "application/pics-rules": {
+ "source": "apache",
+ "extensions": ["prf"]
+ },
+ "application/pidf+xml": {
+ "source": "iana"
+ },
+ "application/pidf-diff+xml": {
+ "source": "iana"
+ },
+ "application/pkcs10": {
+ "source": "iana",
+ "extensions": ["p10"]
+ },
+ "application/pkcs12": {
+ "source": "iana"
+ },
+ "application/pkcs7-mime": {
+ "source": "iana",
+ "extensions": ["p7m","p7c"]
+ },
+ "application/pkcs7-signature": {
+ "source": "iana",
+ "extensions": ["p7s"]
+ },
+ "application/pkcs8": {
+ "source": "iana",
+ "extensions": ["p8"]
+ },
+ "application/pkix-attr-cert": {
+ "source": "iana",
+ "extensions": ["ac"]
+ },
+ "application/pkix-cert": {
+ "source": "iana",
+ "extensions": ["cer"]
+ },
+ "application/pkix-crl": {
+ "source": "iana",
+ "extensions": ["crl"]
+ },
+ "application/pkix-pkipath": {
+ "source": "iana",
+ "extensions": ["pkipath"]
+ },
+ "application/pkixcmp": {
+ "source": "iana",
+ "extensions": ["pki"]
+ },
+ "application/pls+xml": {
+ "source": "iana",
+ "extensions": ["pls"]
+ },
+ "application/poc-settings+xml": {
+ "source": "iana"
+ },
+ "application/postscript": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["ai","eps","ps"]
+ },
+ "application/provenance+xml": {
+ "source": "iana"
+ },
+ "application/prs.alvestrand.titrax-sheet": {
+ "source": "iana"
+ },
+ "application/prs.cww": {
+ "source": "iana",
+ "extensions": ["cww"]
+ },
+ "application/prs.hpub+zip": {
+ "source": "iana"
+ },
+ "application/prs.nprend": {
+ "source": "iana"
+ },
+ "application/prs.plucker": {
+ "source": "iana"
+ },
+ "application/prs.rdf-xml-crypt": {
+ "source": "iana"
+ },
+ "application/prs.xsf+xml": {
+ "source": "iana"
+ },
+ "application/pskc+xml": {
+ "source": "iana",
+ "extensions": ["pskcxml"]
+ },
+ "application/qsig": {
+ "source": "iana"
+ },
+ "application/raptorfec": {
+ "source": "iana"
+ },
+ "application/rdap+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/rdf+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rdf"]
+ },
+ "application/reginfo+xml": {
+ "source": "iana",
+ "extensions": ["rif"]
+ },
+ "application/relax-ng-compact-syntax": {
+ "source": "iana",
+ "extensions": ["rnc"]
+ },
+ "application/remote-printing": {
+ "source": "iana"
+ },
+ "application/reputon+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/resource-lists+xml": {
+ "source": "iana",
+ "extensions": ["rl"]
+ },
+ "application/resource-lists-diff+xml": {
+ "source": "iana",
+ "extensions": ["rld"]
+ },
+ "application/riscos": {
+ "source": "iana"
+ },
+ "application/rlmi+xml": {
+ "source": "iana"
+ },
+ "application/rls-services+xml": {
+ "source": "iana",
+ "extensions": ["rs"]
+ },
+ "application/rpki-ghostbusters": {
+ "source": "iana",
+ "extensions": ["gbr"]
+ },
+ "application/rpki-manifest": {
+ "source": "iana",
+ "extensions": ["mft"]
+ },
+ "application/rpki-roa": {
+ "source": "iana",
+ "extensions": ["roa"]
+ },
+ "application/rpki-updown": {
+ "source": "iana"
+ },
+ "application/rsd+xml": {
+ "source": "apache",
+ "extensions": ["rsd"]
+ },
+ "application/rss+xml": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["rss"]
+ },
+ "application/rtf": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rtf"]
+ },
+ "application/rtploopback": {
+ "source": "iana"
+ },
+ "application/rtx": {
+ "source": "iana"
+ },
+ "application/samlassertion+xml": {
+ "source": "iana"
+ },
+ "application/samlmetadata+xml": {
+ "source": "iana"
+ },
+ "application/sbml+xml": {
+ "source": "iana",
+ "extensions": ["sbml"]
+ },
+ "application/scaip+xml": {
+ "source": "iana"
+ },
+ "application/scim+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/scvp-cv-request": {
+ "source": "iana",
+ "extensions": ["scq"]
+ },
+ "application/scvp-cv-response": {
+ "source": "iana",
+ "extensions": ["scs"]
+ },
+ "application/scvp-vp-request": {
+ "source": "iana",
+ "extensions": ["spq"]
+ },
+ "application/scvp-vp-response": {
+ "source": "iana",
+ "extensions": ["spp"]
+ },
+ "application/sdp": {
+ "source": "iana",
+ "extensions": ["sdp"]
+ },
+ "application/sep+xml": {
+ "source": "iana"
+ },
+ "application/sep-exi": {
+ "source": "iana"
+ },
+ "application/session-info": {
+ "source": "iana"
+ },
+ "application/set-payment": {
+ "source": "iana"
+ },
+ "application/set-payment-initiation": {
+ "source": "iana",
+ "extensions": ["setpay"]
+ },
+ "application/set-registration": {
+ "source": "iana"
+ },
+ "application/set-registration-initiation": {
+ "source": "iana",
+ "extensions": ["setreg"]
+ },
+ "application/sgml": {
+ "source": "iana"
+ },
+ "application/sgml-open-catalog": {
+ "source": "iana"
+ },
+ "application/shf+xml": {
+ "source": "iana",
+ "extensions": ["shf"]
+ },
+ "application/sieve": {
+ "source": "iana"
+ },
+ "application/simple-filter+xml": {
+ "source": "iana"
+ },
+ "application/simple-message-summary": {
+ "source": "iana"
+ },
+ "application/simplesymbolcontainer": {
+ "source": "iana"
+ },
+ "application/slate": {
+ "source": "iana"
+ },
+ "application/smil": {
+ "source": "iana"
+ },
+ "application/smil+xml": {
+ "source": "iana",
+ "extensions": ["smi","smil"]
+ },
+ "application/smpte336m": {
+ "source": "iana"
+ },
+ "application/soap+fastinfoset": {
+ "source": "iana"
+ },
+ "application/soap+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/sparql-query": {
+ "source": "iana",
+ "extensions": ["rq"]
+ },
+ "application/sparql-results+xml": {
+ "source": "iana",
+ "extensions": ["srx"]
+ },
+ "application/spirits-event+xml": {
+ "source": "iana"
+ },
+ "application/sql": {
+ "source": "iana"
+ },
+ "application/srgs": {
+ "source": "iana",
+ "extensions": ["gram"]
+ },
+ "application/srgs+xml": {
+ "source": "iana",
+ "extensions": ["grxml"]
+ },
+ "application/sru+xml": {
+ "source": "iana",
+ "extensions": ["sru"]
+ },
+ "application/ssdl+xml": {
+ "source": "apache",
+ "extensions": ["ssdl"]
+ },
+ "application/ssml+xml": {
+ "source": "iana",
+ "extensions": ["ssml"]
+ },
+ "application/tamp-apex-update": {
+ "source": "iana"
+ },
+ "application/tamp-apex-update-confirm": {
+ "source": "iana"
+ },
+ "application/tamp-community-update": {
+ "source": "iana"
+ },
+ "application/tamp-community-update-confirm": {
+ "source": "iana"
+ },
+ "application/tamp-error": {
+ "source": "iana"
+ },
+ "application/tamp-sequence-adjust": {
+ "source": "iana"
+ },
+ "application/tamp-sequence-adjust-confirm": {
+ "source": "iana"
+ },
+ "application/tamp-status-query": {
+ "source": "iana"
+ },
+ "application/tamp-status-response": {
+ "source": "iana"
+ },
+ "application/tamp-update": {
+ "source": "iana"
+ },
+ "application/tamp-update-confirm": {
+ "source": "iana"
+ },
+ "application/tar": {
+ "compressible": true
+ },
+ "application/tei+xml": {
+ "source": "iana",
+ "extensions": ["tei","teicorpus"]
+ },
+ "application/thraud+xml": {
+ "source": "iana",
+ "extensions": ["tfi"]
+ },
+ "application/timestamp-query": {
+ "source": "iana"
+ },
+ "application/timestamp-reply": {
+ "source": "iana"
+ },
+ "application/timestamped-data": {
+ "source": "iana",
+ "extensions": ["tsd"]
+ },
+ "application/ttml+xml": {
+ "source": "iana"
+ },
+ "application/tve-trigger": {
+ "source": "iana"
+ },
+ "application/ulpfec": {
+ "source": "iana"
+ },
+ "application/urc-grpsheet+xml": {
+ "source": "iana"
+ },
+ "application/urc-ressheet+xml": {
+ "source": "iana"
+ },
+ "application/urc-targetdesc+xml": {
+ "source": "iana"
+ },
+ "application/urc-uisocketdesc+xml": {
+ "source": "iana"
+ },
+ "application/vcard+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vcard+xml": {
+ "source": "iana"
+ },
+ "application/vemmi": {
+ "source": "iana"
+ },
+ "application/vividence.scriptfile": {
+ "source": "apache"
+ },
+ "application/vnd.3gpp-prose+xml": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp-prose-pc3ch+xml": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.bsf+xml": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.mid-call+xml": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.pic-bw-large": {
+ "source": "iana",
+ "extensions": ["plb"]
+ },
+ "application/vnd.3gpp.pic-bw-small": {
+ "source": "iana",
+ "extensions": ["psb"]
+ },
+ "application/vnd.3gpp.pic-bw-var": {
+ "source": "iana",
+ "extensions": ["pvb"]
+ },
+ "application/vnd.3gpp.sms": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.srvcc-info+xml": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.state-and-event-info+xml": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp.ussd+xml": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp2.bcmcsinfo+xml": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp2.sms": {
+ "source": "iana"
+ },
+ "application/vnd.3gpp2.tcap": {
+ "source": "iana",
+ "extensions": ["tcap"]
+ },
+ "application/vnd.3m.post-it-notes": {
+ "source": "iana",
+ "extensions": ["pwn"]
+ },
+ "application/vnd.accpac.simply.aso": {
+ "source": "iana",
+ "extensions": ["aso"]
+ },
+ "application/vnd.accpac.simply.imp": {
+ "source": "iana",
+ "extensions": ["imp"]
+ },
+ "application/vnd.acucobol": {
+ "source": "iana",
+ "extensions": ["acu"]
+ },
+ "application/vnd.acucorp": {
+ "source": "iana",
+ "extensions": ["atc","acutc"]
+ },
+ "application/vnd.adobe.air-application-installer-package+zip": {
+ "source": "apache",
+ "extensions": ["air"]
+ },
+ "application/vnd.adobe.flash.movie": {
+ "source": "iana"
+ },
+ "application/vnd.adobe.formscentral.fcdt": {
+ "source": "iana",
+ "extensions": ["fcdt"]
+ },
+ "application/vnd.adobe.fxp": {
+ "source": "iana",
+ "extensions": ["fxp","fxpl"]
+ },
+ "application/vnd.adobe.partial-upload": {
+ "source": "iana"
+ },
+ "application/vnd.adobe.xdp+xml": {
+ "source": "iana",
+ "extensions": ["xdp"]
+ },
+ "application/vnd.adobe.xfdf": {
+ "source": "iana",
+ "extensions": ["xfdf"]
+ },
+ "application/vnd.aether.imp": {
+ "source": "iana"
+ },
+ "application/vnd.ah-barcode": {
+ "source": "iana"
+ },
+ "application/vnd.ahead.space": {
+ "source": "iana",
+ "extensions": ["ahead"]
+ },
+ "application/vnd.airzip.filesecure.azf": {
+ "source": "iana",
+ "extensions": ["azf"]
+ },
+ "application/vnd.airzip.filesecure.azs": {
+ "source": "iana",
+ "extensions": ["azs"]
+ },
+ "application/vnd.amazon.ebook": {
+ "source": "apache",
+ "extensions": ["azw"]
+ },
+ "application/vnd.americandynamics.acc": {
+ "source": "iana",
+ "extensions": ["acc"]
+ },
+ "application/vnd.amiga.ami": {
+ "source": "iana",
+ "extensions": ["ami"]
+ },
+ "application/vnd.amundsen.maze+xml": {
+ "source": "iana"
+ },
+ "application/vnd.android.package-archive": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["apk"]
+ },
+ "application/vnd.anki": {
+ "source": "iana"
+ },
+ "application/vnd.anser-web-certificate-issue-initiation": {
+ "source": "iana",
+ "extensions": ["cii"]
+ },
+ "application/vnd.anser-web-funds-transfer-initiation": {
+ "source": "apache",
+ "extensions": ["fti"]
+ },
+ "application/vnd.antix.game-component": {
+ "source": "iana",
+ "extensions": ["atx"]
+ },
+ "application/vnd.apache.thrift.binary": {
+ "source": "iana"
+ },
+ "application/vnd.apache.thrift.compact": {
+ "source": "iana"
+ },
+ "application/vnd.apache.thrift.json": {
+ "source": "iana"
+ },
+ "application/vnd.api+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.apple.installer+xml": {
+ "source": "iana",
+ "extensions": ["mpkg"]
+ },
+ "application/vnd.apple.mpegurl": {
+ "source": "iana",
+ "extensions": ["m3u8"]
+ },
+ "application/vnd.apple.pkpass": {
+ "compressible": false,
+ "extensions": ["pkpass"]
+ },
+ "application/vnd.arastra.swi": {
+ "source": "iana"
+ },
+ "application/vnd.aristanetworks.swi": {
+ "source": "iana",
+ "extensions": ["swi"]
+ },
+ "application/vnd.artsquare": {
+ "source": "iana"
+ },
+ "application/vnd.astraea-software.iota": {
+ "source": "iana",
+ "extensions": ["iota"]
+ },
+ "application/vnd.audiograph": {
+ "source": "iana",
+ "extensions": ["aep"]
+ },
+ "application/vnd.autopackage": {
+ "source": "iana"
+ },
+ "application/vnd.avistar+xml": {
+ "source": "iana"
+ },
+ "application/vnd.balsamiq.bmml+xml": {
+ "source": "iana"
+ },
+ "application/vnd.balsamiq.bmpr": {
+ "source": "iana"
+ },
+ "application/vnd.bekitzur-stech+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.biopax.rdf+xml": {
+ "source": "iana"
+ },
+ "application/vnd.blueice.multipass": {
+ "source": "iana",
+ "extensions": ["mpm"]
+ },
+ "application/vnd.bluetooth.ep.oob": {
+ "source": "iana"
+ },
+ "application/vnd.bluetooth.le.oob": {
+ "source": "iana"
+ },
+ "application/vnd.bmi": {
+ "source": "iana",
+ "extensions": ["bmi"]
+ },
+ "application/vnd.businessobjects": {
+ "source": "iana",
+ "extensions": ["rep"]
+ },
+ "application/vnd.cab-jscript": {
+ "source": "iana"
+ },
+ "application/vnd.canon-cpdl": {
+ "source": "iana"
+ },
+ "application/vnd.canon-lips": {
+ "source": "iana"
+ },
+ "application/vnd.cendio.thinlinc.clientconf": {
+ "source": "iana"
+ },
+ "application/vnd.century-systems.tcp_stream": {
+ "source": "iana"
+ },
+ "application/vnd.chemdraw+xml": {
+ "source": "iana",
+ "extensions": ["cdxml"]
+ },
+ "application/vnd.chipnuts.karaoke-mmd": {
+ "source": "iana",
+ "extensions": ["mmd"]
+ },
+ "application/vnd.cinderella": {
+ "source": "iana",
+ "extensions": ["cdy"]
+ },
+ "application/vnd.cirpack.isdn-ext": {
+ "source": "iana"
+ },
+ "application/vnd.citationstyles.style+xml": {
+ "source": "iana"
+ },
+ "application/vnd.claymore": {
+ "source": "iana",
+ "extensions": ["cla"]
+ },
+ "application/vnd.cloanto.rp9": {
+ "source": "iana",
+ "extensions": ["rp9"]
+ },
+ "application/vnd.clonk.c4group": {
+ "source": "iana",
+ "extensions": ["c4g","c4d","c4f","c4p","c4u"]
+ },
+ "application/vnd.cluetrust.cartomobile-config": {
+ "source": "iana",
+ "extensions": ["c11amc"]
+ },
+ "application/vnd.cluetrust.cartomobile-config-pkg": {
+ "source": "iana",
+ "extensions": ["c11amz"]
+ },
+ "application/vnd.coffeescript": {
+ "source": "iana"
+ },
+ "application/vnd.collection+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.collection.doc+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.collection.next+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.commerce-battelle": {
+ "source": "iana"
+ },
+ "application/vnd.commonspace": {
+ "source": "iana",
+ "extensions": ["csp"]
+ },
+ "application/vnd.contact.cmsg": {
+ "source": "iana",
+ "extensions": ["cdbcmsg"]
+ },
+ "application/vnd.cosmocaller": {
+ "source": "iana",
+ "extensions": ["cmc"]
+ },
+ "application/vnd.crick.clicker": {
+ "source": "iana",
+ "extensions": ["clkx"]
+ },
+ "application/vnd.crick.clicker.keyboard": {
+ "source": "iana",
+ "extensions": ["clkk"]
+ },
+ "application/vnd.crick.clicker.palette": {
+ "source": "iana",
+ "extensions": ["clkp"]
+ },
+ "application/vnd.crick.clicker.template": {
+ "source": "iana",
+ "extensions": ["clkt"]
+ },
+ "application/vnd.crick.clicker.wordbank": {
+ "source": "iana",
+ "extensions": ["clkw"]
+ },
+ "application/vnd.criticaltools.wbs+xml": {
+ "source": "iana",
+ "extensions": ["wbs"]
+ },
+ "application/vnd.ctc-posml": {
+ "source": "iana",
+ "extensions": ["pml"]
+ },
+ "application/vnd.ctct.ws+xml": {
+ "source": "iana"
+ },
+ "application/vnd.cups-pdf": {
+ "source": "iana"
+ },
+ "application/vnd.cups-postscript": {
+ "source": "iana"
+ },
+ "application/vnd.cups-ppd": {
+ "source": "iana",
+ "extensions": ["ppd"]
+ },
+ "application/vnd.cups-raster": {
+ "source": "iana"
+ },
+ "application/vnd.cups-raw": {
+ "source": "iana"
+ },
+ "application/vnd.curl": {
+ "source": "iana"
+ },
+ "application/vnd.curl.car": {
+ "source": "apache",
+ "extensions": ["car"]
+ },
+ "application/vnd.curl.pcurl": {
+ "source": "apache",
+ "extensions": ["pcurl"]
+ },
+ "application/vnd.cyan.dean.root+xml": {
+ "source": "iana"
+ },
+ "application/vnd.cybank": {
+ "source": "iana"
+ },
+ "application/vnd.dart": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["dart"]
+ },
+ "application/vnd.data-vision.rdz": {
+ "source": "iana",
+ "extensions": ["rdz"]
+ },
+ "application/vnd.debian.binary-package": {
+ "source": "iana"
+ },
+ "application/vnd.dece.data": {
+ "source": "iana",
+ "extensions": ["uvf","uvvf","uvd","uvvd"]
+ },
+ "application/vnd.dece.ttml+xml": {
+ "source": "iana",
+ "extensions": ["uvt","uvvt"]
+ },
+ "application/vnd.dece.unspecified": {
+ "source": "iana",
+ "extensions": ["uvx","uvvx"]
+ },
+ "application/vnd.dece.zip": {
+ "source": "iana",
+ "extensions": ["uvz","uvvz"]
+ },
+ "application/vnd.denovo.fcselayout-link": {
+ "source": "iana",
+ "extensions": ["fe_launch"]
+ },
+ "application/vnd.desmume-movie": {
+ "source": "iana"
+ },
+ "application/vnd.dir-bi.plate-dl-nosuffix": {
+ "source": "iana"
+ },
+ "application/vnd.dm.delegation+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dna": {
+ "source": "iana",
+ "extensions": ["dna"]
+ },
+ "application/vnd.document+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.dolby.mlp": {
+ "source": "apache",
+ "extensions": ["mlp"]
+ },
+ "application/vnd.dolby.mobile.1": {
+ "source": "iana"
+ },
+ "application/vnd.dolby.mobile.2": {
+ "source": "iana"
+ },
+ "application/vnd.doremir.scorecloud-binary-document": {
+ "source": "iana"
+ },
+ "application/vnd.dpgraph": {
+ "source": "iana",
+ "extensions": ["dpg"]
+ },
+ "application/vnd.dreamfactory": {
+ "source": "iana",
+ "extensions": ["dfac"]
+ },
+ "application/vnd.drive+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ds-keypoint": {
+ "source": "apache",
+ "extensions": ["kpxx"]
+ },
+ "application/vnd.dtg.local": {
+ "source": "iana"
+ },
+ "application/vnd.dtg.local.flash": {
+ "source": "iana"
+ },
+ "application/vnd.dtg.local.html": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ait": {
+ "source": "iana",
+ "extensions": ["ait"]
+ },
+ "application/vnd.dvb.dvbj": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.esgcontainer": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ipdcdftnotifaccess": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ipdcesgaccess": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ipdcesgaccess2": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ipdcesgpdd": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.ipdcroaming": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.iptv.alfec-base": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.iptv.alfec-enhancement": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.notif-aggregate-root+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.notif-container+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.notif-generic+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.notif-ia-msglist+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.notif-ia-registration-request+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.notif-ia-registration-response+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.notif-init+xml": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.pfr": {
+ "source": "iana"
+ },
+ "application/vnd.dvb.service": {
+ "source": "iana",
+ "extensions": ["svc"]
+ },
+ "application/vnd.dxr": {
+ "source": "iana"
+ },
+ "application/vnd.dynageo": {
+ "source": "iana",
+ "extensions": ["geo"]
+ },
+ "application/vnd.dzr": {
+ "source": "iana"
+ },
+ "application/vnd.easykaraoke.cdgdownload": {
+ "source": "iana"
+ },
+ "application/vnd.ecdis-update": {
+ "source": "iana"
+ },
+ "application/vnd.ecowin.chart": {
+ "source": "iana",
+ "extensions": ["mag"]
+ },
+ "application/vnd.ecowin.filerequest": {
+ "source": "iana"
+ },
+ "application/vnd.ecowin.fileupdate": {
+ "source": "iana"
+ },
+ "application/vnd.ecowin.series": {
+ "source": "iana"
+ },
+ "application/vnd.ecowin.seriesrequest": {
+ "source": "iana"
+ },
+ "application/vnd.ecowin.seriesupdate": {
+ "source": "iana"
+ },
+ "application/vnd.emclient.accessrequest+xml": {
+ "source": "iana"
+ },
+ "application/vnd.enliven": {
+ "source": "iana",
+ "extensions": ["nml"]
+ },
+ "application/vnd.enphase.envoy": {
+ "source": "iana"
+ },
+ "application/vnd.eprints.data+xml": {
+ "source": "iana"
+ },
+ "application/vnd.epson.esf": {
+ "source": "iana",
+ "extensions": ["esf"]
+ },
+ "application/vnd.epson.msf": {
+ "source": "iana",
+ "extensions": ["msf"]
+ },
+ "application/vnd.epson.quickanime": {
+ "source": "iana",
+ "extensions": ["qam"]
+ },
+ "application/vnd.epson.salt": {
+ "source": "iana",
+ "extensions": ["slt"]
+ },
+ "application/vnd.epson.ssf": {
+ "source": "iana",
+ "extensions": ["ssf"]
+ },
+ "application/vnd.ericsson.quickcall": {
+ "source": "iana"
+ },
+ "application/vnd.eszigno3+xml": {
+ "source": "iana",
+ "extensions": ["es3","et3"]
+ },
+ "application/vnd.etsi.aoc+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.asic-e+zip": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.asic-s+zip": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.cug+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvcommand+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvdiscovery+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvprofile+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvsad-bc+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvsad-cod+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvsad-npvr+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvservice+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvsync+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.iptvueprofile+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.mcid+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.mheg5": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.overload-control-policy-dataset+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.pstn+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.sci+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.simservs+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.timestamp-token": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.tsl+xml": {
+ "source": "iana"
+ },
+ "application/vnd.etsi.tsl.der": {
+ "source": "iana"
+ },
+ "application/vnd.eudora.data": {
+ "source": "iana"
+ },
+ "application/vnd.ezpix-album": {
+ "source": "iana",
+ "extensions": ["ez2"]
+ },
+ "application/vnd.ezpix-package": {
+ "source": "iana",
+ "extensions": ["ez3"]
+ },
+ "application/vnd.f-secure.mobile": {
+ "source": "iana"
+ },
+ "application/vnd.fastcopy-disk-image": {
+ "source": "iana"
+ },
+ "application/vnd.fdf": {
+ "source": "iana",
+ "extensions": ["fdf"]
+ },
+ "application/vnd.fdsn.mseed": {
+ "source": "iana",
+ "extensions": ["mseed"]
+ },
+ "application/vnd.fdsn.seed": {
+ "source": "iana",
+ "extensions": ["seed","dataless"]
+ },
+ "application/vnd.ffsns": {
+ "source": "iana"
+ },
+ "application/vnd.fints": {
+ "source": "iana"
+ },
+ "application/vnd.firemonkeys.cloudcell": {
+ "source": "iana"
+ },
+ "application/vnd.flographit": {
+ "source": "iana",
+ "extensions": ["gph"]
+ },
+ "application/vnd.fluxtime.clip": {
+ "source": "iana",
+ "extensions": ["ftc"]
+ },
+ "application/vnd.font-fontforge-sfd": {
+ "source": "iana"
+ },
+ "application/vnd.framemaker": {
+ "source": "iana",
+ "extensions": ["fm","frame","maker","book"]
+ },
+ "application/vnd.frogans.fnc": {
+ "source": "iana",
+ "extensions": ["fnc"]
+ },
+ "application/vnd.frogans.ltf": {
+ "source": "iana",
+ "extensions": ["ltf"]
+ },
+ "application/vnd.fsc.weblaunch": {
+ "source": "iana",
+ "extensions": ["fsc"]
+ },
+ "application/vnd.fujitsu.oasys": {
+ "source": "iana",
+ "extensions": ["oas"]
+ },
+ "application/vnd.fujitsu.oasys2": {
+ "source": "iana",
+ "extensions": ["oa2"]
+ },
+ "application/vnd.fujitsu.oasys3": {
+ "source": "iana",
+ "extensions": ["oa3"]
+ },
+ "application/vnd.fujitsu.oasysgp": {
+ "source": "iana",
+ "extensions": ["fg5"]
+ },
+ "application/vnd.fujitsu.oasysprs": {
+ "source": "iana",
+ "extensions": ["bh2"]
+ },
+ "application/vnd.fujixerox.art-ex": {
+ "source": "iana"
+ },
+ "application/vnd.fujixerox.art4": {
+ "source": "iana"
+ },
+ "application/vnd.fujixerox.ddd": {
+ "source": "iana",
+ "extensions": ["ddd"]
+ },
+ "application/vnd.fujixerox.docuworks": {
+ "source": "iana",
+ "extensions": ["xdw"]
+ },
+ "application/vnd.fujixerox.docuworks.binder": {
+ "source": "iana",
+ "extensions": ["xbd"]
+ },
+ "application/vnd.fujixerox.docuworks.container": {
+ "source": "iana"
+ },
+ "application/vnd.fujixerox.hbpl": {
+ "source": "iana"
+ },
+ "application/vnd.fut-misnet": {
+ "source": "iana"
+ },
+ "application/vnd.fuzzysheet": {
+ "source": "iana",
+ "extensions": ["fzs"]
+ },
+ "application/vnd.genomatix.tuxedo": {
+ "source": "iana",
+ "extensions": ["txd"]
+ },
+ "application/vnd.geo+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.geocube+xml": {
+ "source": "iana"
+ },
+ "application/vnd.geogebra.file": {
+ "source": "iana",
+ "extensions": ["ggb"]
+ },
+ "application/vnd.geogebra.tool": {
+ "source": "iana",
+ "extensions": ["ggt"]
+ },
+ "application/vnd.geometry-explorer": {
+ "source": "iana",
+ "extensions": ["gex","gre"]
+ },
+ "application/vnd.geonext": {
+ "source": "iana",
+ "extensions": ["gxt"]
+ },
+ "application/vnd.geoplan": {
+ "source": "iana",
+ "extensions": ["g2w"]
+ },
+ "application/vnd.geospace": {
+ "source": "iana",
+ "extensions": ["g3w"]
+ },
+ "application/vnd.gerber": {
+ "source": "iana"
+ },
+ "application/vnd.globalplatform.card-content-mgt": {
+ "source": "iana"
+ },
+ "application/vnd.globalplatform.card-content-mgt-response": {
+ "source": "iana"
+ },
+ "application/vnd.gmx": {
+ "source": "iana",
+ "extensions": ["gmx"]
+ },
+ "application/vnd.google-earth.kml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["kml"]
+ },
+ "application/vnd.google-earth.kmz": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["kmz"]
+ },
+ "application/vnd.gov.sk.e-form+xml": {
+ "source": "iana"
+ },
+ "application/vnd.gov.sk.e-form+zip": {
+ "source": "iana"
+ },
+ "application/vnd.gov.sk.xmldatacontainer+xml": {
+ "source": "iana"
+ },
+ "application/vnd.grafeq": {
+ "source": "iana",
+ "extensions": ["gqf","gqs"]
+ },
+ "application/vnd.gridmp": {
+ "source": "iana"
+ },
+ "application/vnd.groove-account": {
+ "source": "iana",
+ "extensions": ["gac"]
+ },
+ "application/vnd.groove-help": {
+ "source": "iana",
+ "extensions": ["ghf"]
+ },
+ "application/vnd.groove-identity-message": {
+ "source": "iana",
+ "extensions": ["gim"]
+ },
+ "application/vnd.groove-injector": {
+ "source": "iana",
+ "extensions": ["grv"]
+ },
+ "application/vnd.groove-tool-message": {
+ "source": "iana",
+ "extensions": ["gtm"]
+ },
+ "application/vnd.groove-tool-template": {
+ "source": "iana",
+ "extensions": ["tpl"]
+ },
+ "application/vnd.groove-vcard": {
+ "source": "iana",
+ "extensions": ["vcg"]
+ },
+ "application/vnd.hal+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.hal+xml": {
+ "source": "iana",
+ "extensions": ["hal"]
+ },
+ "application/vnd.handheld-entertainment+xml": {
+ "source": "iana",
+ "extensions": ["zmm"]
+ },
+ "application/vnd.hbci": {
+ "source": "iana",
+ "extensions": ["hbci"]
+ },
+ "application/vnd.hcl-bireports": {
+ "source": "iana"
+ },
+ "application/vnd.heroku+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.hhe.lesson-player": {
+ "source": "iana",
+ "extensions": ["les"]
+ },
+ "application/vnd.hp-hpgl": {
+ "source": "iana",
+ "extensions": ["hpgl"]
+ },
+ "application/vnd.hp-hpid": {
+ "source": "iana",
+ "extensions": ["hpid"]
+ },
+ "application/vnd.hp-hps": {
+ "source": "iana",
+ "extensions": ["hps"]
+ },
+ "application/vnd.hp-jlyt": {
+ "source": "iana",
+ "extensions": ["jlt"]
+ },
+ "application/vnd.hp-pcl": {
+ "source": "iana",
+ "extensions": ["pcl"]
+ },
+ "application/vnd.hp-pclxl": {
+ "source": "iana",
+ "extensions": ["pclxl"]
+ },
+ "application/vnd.httphone": {
+ "source": "iana"
+ },
+ "application/vnd.hydrostatix.sof-data": {
+ "source": "iana",
+ "extensions": ["sfd-hdstx"]
+ },
+ "application/vnd.hyperdrive+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.hzn-3d-crossword": {
+ "source": "iana"
+ },
+ "application/vnd.ibm.afplinedata": {
+ "source": "iana"
+ },
+ "application/vnd.ibm.electronic-media": {
+ "source": "iana"
+ },
+ "application/vnd.ibm.minipay": {
+ "source": "iana",
+ "extensions": ["mpy"]
+ },
+ "application/vnd.ibm.modcap": {
+ "source": "iana",
+ "extensions": ["afp","listafp","list3820"]
+ },
+ "application/vnd.ibm.rights-management": {
+ "source": "iana",
+ "extensions": ["irm"]
+ },
+ "application/vnd.ibm.secure-container": {
+ "source": "iana",
+ "extensions": ["sc"]
+ },
+ "application/vnd.iccprofile": {
+ "source": "iana",
+ "extensions": ["icc","icm"]
+ },
+ "application/vnd.ieee.1905": {
+ "source": "iana"
+ },
+ "application/vnd.igloader": {
+ "source": "iana",
+ "extensions": ["igl"]
+ },
+ "application/vnd.immervision-ivp": {
+ "source": "iana",
+ "extensions": ["ivp"]
+ },
+ "application/vnd.immervision-ivu": {
+ "source": "iana",
+ "extensions": ["ivu"]
+ },
+ "application/vnd.ims.imsccv1p1": {
+ "source": "iana"
+ },
+ "application/vnd.ims.imsccv1p2": {
+ "source": "iana"
+ },
+ "application/vnd.ims.imsccv1p3": {
+ "source": "iana"
+ },
+ "application/vnd.ims.lis.v2.result+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ims.lti.v2.toolconsumerprofile+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ims.lti.v2.toolproxy+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ims.lti.v2.toolproxy.id+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ims.lti.v2.toolsettings+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.ims.lti.v2.toolsettings.simple+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.informedcontrol.rms+xml": {
+ "source": "iana"
+ },
+ "application/vnd.informix-visionary": {
+ "source": "iana"
+ },
+ "application/vnd.infotech.project": {
+ "source": "iana"
+ },
+ "application/vnd.infotech.project+xml": {
+ "source": "iana"
+ },
+ "application/vnd.innopath.wamp.notification": {
+ "source": "iana"
+ },
+ "application/vnd.insors.igm": {
+ "source": "iana",
+ "extensions": ["igm"]
+ },
+ "application/vnd.intercon.formnet": {
+ "source": "iana",
+ "extensions": ["xpw","xpx"]
+ },
+ "application/vnd.intergeo": {
+ "source": "iana",
+ "extensions": ["i2g"]
+ },
+ "application/vnd.intertrust.digibox": {
+ "source": "iana"
+ },
+ "application/vnd.intertrust.nncp": {
+ "source": "iana"
+ },
+ "application/vnd.intu.qbo": {
+ "source": "iana",
+ "extensions": ["qbo"]
+ },
+ "application/vnd.intu.qfx": {
+ "source": "iana",
+ "extensions": ["qfx"]
+ },
+ "application/vnd.iptc.g2.catalogitem+xml": {
+ "source": "iana"
+ },
+ "application/vnd.iptc.g2.conceptitem+xml": {
+ "source": "iana"
+ },
+ "application/vnd.iptc.g2.knowledgeitem+xml": {
+ "source": "iana"
+ },
+ "application/vnd.iptc.g2.newsitem+xml": {
+ "source": "iana"
+ },
+ "application/vnd.iptc.g2.newsmessage+xml": {
+ "source": "iana"
+ },
+ "application/vnd.iptc.g2.packageitem+xml": {
+ "source": "iana"
+ },
+ "application/vnd.iptc.g2.planningitem+xml": {
+ "source": "iana"
+ },
+ "application/vnd.ipunplugged.rcprofile": {
+ "source": "iana",
+ "extensions": ["rcprofile"]
+ },
+ "application/vnd.irepository.package+xml": {
+ "source": "iana",
+ "extensions": ["irp"]
+ },
+ "application/vnd.is-xpr": {
+ "source": "iana",
+ "extensions": ["xpr"]
+ },
+ "application/vnd.isac.fcs": {
+ "source": "iana",
+ "extensions": ["fcs"]
+ },
+ "application/vnd.jam": {
+ "source": "iana",
+ "extensions": ["jam"]
+ },
+ "application/vnd.japannet-directory-service": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-jpnstore-wakeup": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-payment-wakeup": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-registration": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-registration-wakeup": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-setstore-wakeup": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-verification": {
+ "source": "iana"
+ },
+ "application/vnd.japannet-verification-wakeup": {
+ "source": "iana"
+ },
+ "application/vnd.jcp.javame.midlet-rms": {
+ "source": "iana",
+ "extensions": ["rms"]
+ },
+ "application/vnd.jisp": {
+ "source": "iana",
+ "extensions": ["jisp"]
+ },
+ "application/vnd.joost.joda-archive": {
+ "source": "iana",
+ "extensions": ["joda"]
+ },
+ "application/vnd.jsk.isdn-ngn": {
+ "source": "iana"
+ },
+ "application/vnd.kahootz": {
+ "source": "iana",
+ "extensions": ["ktz","ktr"]
+ },
+ "application/vnd.kde.karbon": {
+ "source": "iana",
+ "extensions": ["karbon"]
+ },
+ "application/vnd.kde.kchart": {
+ "source": "iana",
+ "extensions": ["chrt"]
+ },
+ "application/vnd.kde.kformula": {
+ "source": "iana",
+ "extensions": ["kfo"]
+ },
+ "application/vnd.kde.kivio": {
+ "source": "iana",
+ "extensions": ["flw"]
+ },
+ "application/vnd.kde.kontour": {
+ "source": "iana",
+ "extensions": ["kon"]
+ },
+ "application/vnd.kde.kpresenter": {
+ "source": "iana",
+ "extensions": ["kpr","kpt"]
+ },
+ "application/vnd.kde.kspread": {
+ "source": "iana",
+ "extensions": ["ksp"]
+ },
+ "application/vnd.kde.kword": {
+ "source": "iana",
+ "extensions": ["kwd","kwt"]
+ },
+ "application/vnd.kenameaapp": {
+ "source": "iana",
+ "extensions": ["htke"]
+ },
+ "application/vnd.kidspiration": {
+ "source": "iana",
+ "extensions": ["kia"]
+ },
+ "application/vnd.kinar": {
+ "source": "iana",
+ "extensions": ["kne","knp"]
+ },
+ "application/vnd.koan": {
+ "source": "iana",
+ "extensions": ["skp","skd","skt","skm"]
+ },
+ "application/vnd.kodak-descriptor": {
+ "source": "iana",
+ "extensions": ["sse"]
+ },
+ "application/vnd.las.las+xml": {
+ "source": "iana",
+ "extensions": ["lasxml"]
+ },
+ "application/vnd.liberty-request+xml": {
+ "source": "iana"
+ },
+ "application/vnd.llamagraphics.life-balance.desktop": {
+ "source": "iana",
+ "extensions": ["lbd"]
+ },
+ "application/vnd.llamagraphics.life-balance.exchange+xml": {
+ "source": "iana",
+ "extensions": ["lbe"]
+ },
+ "application/vnd.lotus-1-2-3": {
+ "source": "iana",
+ "extensions": ["123"]
+ },
+ "application/vnd.lotus-approach": {
+ "source": "iana",
+ "extensions": ["apr"]
+ },
+ "application/vnd.lotus-freelance": {
+ "source": "iana",
+ "extensions": ["pre"]
+ },
+ "application/vnd.lotus-notes": {
+ "source": "iana",
+ "extensions": ["nsf"]
+ },
+ "application/vnd.lotus-organizer": {
+ "source": "iana",
+ "extensions": ["org"]
+ },
+ "application/vnd.lotus-screencam": {
+ "source": "iana",
+ "extensions": ["scm"]
+ },
+ "application/vnd.lotus-wordpro": {
+ "source": "iana",
+ "extensions": ["lwp"]
+ },
+ "application/vnd.macports.portpkg": {
+ "source": "iana",
+ "extensions": ["portpkg"]
+ },
+ "application/vnd.marlin.drm.actiontoken+xml": {
+ "source": "iana"
+ },
+ "application/vnd.marlin.drm.conftoken+xml": {
+ "source": "iana"
+ },
+ "application/vnd.marlin.drm.license+xml": {
+ "source": "iana"
+ },
+ "application/vnd.marlin.drm.mdcf": {
+ "source": "iana"
+ },
+ "application/vnd.mason+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.maxmind.maxmind-db": {
+ "source": "iana"
+ },
+ "application/vnd.mcd": {
+ "source": "iana",
+ "extensions": ["mcd"]
+ },
+ "application/vnd.medcalcdata": {
+ "source": "iana",
+ "extensions": ["mc1"]
+ },
+ "application/vnd.mediastation.cdkey": {
+ "source": "iana",
+ "extensions": ["cdkey"]
+ },
+ "application/vnd.meridian-slingshot": {
+ "source": "iana"
+ },
+ "application/vnd.mfer": {
+ "source": "iana",
+ "extensions": ["mwf"]
+ },
+ "application/vnd.mfmp": {
+ "source": "iana",
+ "extensions": ["mfm"]
+ },
+ "application/vnd.micro+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.micrografx.flo": {
+ "source": "iana",
+ "extensions": ["flo"]
+ },
+ "application/vnd.micrografx.igx": {
+ "source": "iana",
+ "extensions": ["igx"]
+ },
+ "application/vnd.microsoft.portable-executable": {
+ "source": "iana"
+ },
+ "application/vnd.miele+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.mif": {
+ "source": "iana",
+ "extensions": ["mif"]
+ },
+ "application/vnd.minisoft-hp3000-save": {
+ "source": "iana"
+ },
+ "application/vnd.mitsubishi.misty-guard.trustweb": {
+ "source": "iana"
+ },
+ "application/vnd.mobius.daf": {
+ "source": "iana",
+ "extensions": ["daf"]
+ },
+ "application/vnd.mobius.dis": {
+ "source": "iana",
+ "extensions": ["dis"]
+ },
+ "application/vnd.mobius.mbk": {
+ "source": "iana",
+ "extensions": ["mbk"]
+ },
+ "application/vnd.mobius.mqy": {
+ "source": "iana",
+ "extensions": ["mqy"]
+ },
+ "application/vnd.mobius.msl": {
+ "source": "iana",
+ "extensions": ["msl"]
+ },
+ "application/vnd.mobius.plc": {
+ "source": "iana",
+ "extensions": ["plc"]
+ },
+ "application/vnd.mobius.txf": {
+ "source": "iana",
+ "extensions": ["txf"]
+ },
+ "application/vnd.mophun.application": {
+ "source": "iana",
+ "extensions": ["mpn"]
+ },
+ "application/vnd.mophun.certificate": {
+ "source": "iana",
+ "extensions": ["mpc"]
+ },
+ "application/vnd.motorola.flexsuite": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.adsi": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.fis": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.gotap": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.kmr": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.ttc": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.flexsuite.wem": {
+ "source": "iana"
+ },
+ "application/vnd.motorola.iprm": {
+ "source": "iana"
+ },
+ "application/vnd.mozilla.xul+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xul"]
+ },
+ "application/vnd.ms-3mfdocument": {
+ "source": "iana"
+ },
+ "application/vnd.ms-artgalry": {
+ "source": "iana",
+ "extensions": ["cil"]
+ },
+ "application/vnd.ms-asf": {
+ "source": "iana"
+ },
+ "application/vnd.ms-cab-compressed": {
+ "source": "iana",
+ "extensions": ["cab"]
+ },
+ "application/vnd.ms-color.iccprofile": {
+ "source": "apache"
+ },
+ "application/vnd.ms-excel": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["xls","xlm","xla","xlc","xlt","xlw"]
+ },
+ "application/vnd.ms-excel.addin.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["xlam"]
+ },
+ "application/vnd.ms-excel.sheet.binary.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["xlsb"]
+ },
+ "application/vnd.ms-excel.sheet.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["xlsm"]
+ },
+ "application/vnd.ms-excel.template.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["xltm"]
+ },
+ "application/vnd.ms-fontobject": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["eot"]
+ },
+ "application/vnd.ms-htmlhelp": {
+ "source": "iana",
+ "extensions": ["chm"]
+ },
+ "application/vnd.ms-ims": {
+ "source": "iana",
+ "extensions": ["ims"]
+ },
+ "application/vnd.ms-lrm": {
+ "source": "iana",
+ "extensions": ["lrm"]
+ },
+ "application/vnd.ms-office.activex+xml": {
+ "source": "iana"
+ },
+ "application/vnd.ms-officetheme": {
+ "source": "iana",
+ "extensions": ["thmx"]
+ },
+ "application/vnd.ms-opentype": {
+ "source": "apache",
+ "compressible": true
+ },
+ "application/vnd.ms-package.obfuscated-opentype": {
+ "source": "apache"
+ },
+ "application/vnd.ms-pki.seccat": {
+ "source": "apache",
+ "extensions": ["cat"]
+ },
+ "application/vnd.ms-pki.stl": {
+ "source": "apache",
+ "extensions": ["stl"]
+ },
+ "application/vnd.ms-playready.initiator+xml": {
+ "source": "iana"
+ },
+ "application/vnd.ms-powerpoint": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["ppt","pps","pot"]
+ },
+ "application/vnd.ms-powerpoint.addin.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["ppam"]
+ },
+ "application/vnd.ms-powerpoint.presentation.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["pptm"]
+ },
+ "application/vnd.ms-powerpoint.slide.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["sldm"]
+ },
+ "application/vnd.ms-powerpoint.slideshow.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["ppsm"]
+ },
+ "application/vnd.ms-powerpoint.template.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["potm"]
+ },
+ "application/vnd.ms-printing.printticket+xml": {
+ "source": "apache"
+ },
+ "application/vnd.ms-project": {
+ "source": "iana",
+ "extensions": ["mpp","mpt"]
+ },
+ "application/vnd.ms-tnef": {
+ "source": "iana"
+ },
+ "application/vnd.ms-windows.printerpairing": {
+ "source": "iana"
+ },
+ "application/vnd.ms-wmdrm.lic-chlg-req": {
+ "source": "iana"
+ },
+ "application/vnd.ms-wmdrm.lic-resp": {
+ "source": "iana"
+ },
+ "application/vnd.ms-wmdrm.meter-chlg-req": {
+ "source": "iana"
+ },
+ "application/vnd.ms-wmdrm.meter-resp": {
+ "source": "iana"
+ },
+ "application/vnd.ms-word.document.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["docm"]
+ },
+ "application/vnd.ms-word.template.macroenabled.12": {
+ "source": "iana",
+ "extensions": ["dotm"]
+ },
+ "application/vnd.ms-works": {
+ "source": "iana",
+ "extensions": ["wps","wks","wcm","wdb"]
+ },
+ "application/vnd.ms-wpl": {
+ "source": "iana",
+ "extensions": ["wpl"]
+ },
+ "application/vnd.ms-xpsdocument": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["xps"]
+ },
+ "application/vnd.msa-disk-image": {
+ "source": "iana"
+ },
+ "application/vnd.mseq": {
+ "source": "iana",
+ "extensions": ["mseq"]
+ },
+ "application/vnd.msign": {
+ "source": "iana"
+ },
+ "application/vnd.multiad.creator": {
+ "source": "iana"
+ },
+ "application/vnd.multiad.creator.cif": {
+ "source": "iana"
+ },
+ "application/vnd.music-niff": {
+ "source": "iana"
+ },
+ "application/vnd.musician": {
+ "source": "iana",
+ "extensions": ["mus"]
+ },
+ "application/vnd.muvee.style": {
+ "source": "iana",
+ "extensions": ["msty"]
+ },
+ "application/vnd.mynfc": {
+ "source": "iana",
+ "extensions": ["taglet"]
+ },
+ "application/vnd.ncd.control": {
+ "source": "iana"
+ },
+ "application/vnd.ncd.reference": {
+ "source": "iana"
+ },
+ "application/vnd.nervana": {
+ "source": "iana"
+ },
+ "application/vnd.netfpx": {
+ "source": "iana"
+ },
+ "application/vnd.neurolanguage.nlu": {
+ "source": "iana",
+ "extensions": ["nlu"]
+ },
+ "application/vnd.nintendo.nitro.rom": {
+ "source": "iana"
+ },
+ "application/vnd.nintendo.snes.rom": {
+ "source": "iana"
+ },
+ "application/vnd.nitf": {
+ "source": "iana",
+ "extensions": ["ntf","nitf"]
+ },
+ "application/vnd.noblenet-directory": {
+ "source": "iana",
+ "extensions": ["nnd"]
+ },
+ "application/vnd.noblenet-sealer": {
+ "source": "iana",
+ "extensions": ["nns"]
+ },
+ "application/vnd.noblenet-web": {
+ "source": "iana",
+ "extensions": ["nnw"]
+ },
+ "application/vnd.nokia.catalogs": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.conml+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.conml+xml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.iptv.config+xml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.isds-radio-presets": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.landmark+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.landmark+xml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.landmarkcollection+xml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.n-gage.ac+xml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.n-gage.data": {
+ "source": "iana",
+ "extensions": ["ngdat"]
+ },
+ "application/vnd.nokia.n-gage.symbian.install": {
+ "source": "iana",
+ "extensions": ["n-gage"]
+ },
+ "application/vnd.nokia.ncd": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.pcd+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.pcd+xml": {
+ "source": "iana"
+ },
+ "application/vnd.nokia.radio-preset": {
+ "source": "iana",
+ "extensions": ["rpst"]
+ },
+ "application/vnd.nokia.radio-presets": {
+ "source": "iana",
+ "extensions": ["rpss"]
+ },
+ "application/vnd.novadigm.edm": {
+ "source": "iana",
+ "extensions": ["edm"]
+ },
+ "application/vnd.novadigm.edx": {
+ "source": "iana",
+ "extensions": ["edx"]
+ },
+ "application/vnd.novadigm.ext": {
+ "source": "iana",
+ "extensions": ["ext"]
+ },
+ "application/vnd.ntt-local.content-share": {
+ "source": "iana"
+ },
+ "application/vnd.ntt-local.file-transfer": {
+ "source": "iana"
+ },
+ "application/vnd.ntt-local.ogw_remote-access": {
+ "source": "iana"
+ },
+ "application/vnd.ntt-local.sip-ta_remote": {
+ "source": "iana"
+ },
+ "application/vnd.ntt-local.sip-ta_tcp_stream": {
+ "source": "iana"
+ },
+ "application/vnd.oasis.opendocument.chart": {
+ "source": "iana",
+ "extensions": ["odc"]
+ },
+ "application/vnd.oasis.opendocument.chart-template": {
+ "source": "iana",
+ "extensions": ["otc"]
+ },
+ "application/vnd.oasis.opendocument.database": {
+ "source": "iana",
+ "extensions": ["odb"]
+ },
+ "application/vnd.oasis.opendocument.formula": {
+ "source": "iana",
+ "extensions": ["odf"]
+ },
+ "application/vnd.oasis.opendocument.formula-template": {
+ "source": "iana",
+ "extensions": ["odft"]
+ },
+ "application/vnd.oasis.opendocument.graphics": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["odg"]
+ },
+ "application/vnd.oasis.opendocument.graphics-template": {
+ "source": "iana",
+ "extensions": ["otg"]
+ },
+ "application/vnd.oasis.opendocument.image": {
+ "source": "iana",
+ "extensions": ["odi"]
+ },
+ "application/vnd.oasis.opendocument.image-template": {
+ "source": "iana",
+ "extensions": ["oti"]
+ },
+ "application/vnd.oasis.opendocument.presentation": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["odp"]
+ },
+ "application/vnd.oasis.opendocument.presentation-template": {
+ "source": "iana",
+ "extensions": ["otp"]
+ },
+ "application/vnd.oasis.opendocument.spreadsheet": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["ods"]
+ },
+ "application/vnd.oasis.opendocument.spreadsheet-template": {
+ "source": "iana",
+ "extensions": ["ots"]
+ },
+ "application/vnd.oasis.opendocument.text": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["odt"]
+ },
+ "application/vnd.oasis.opendocument.text-master": {
+ "source": "iana",
+ "extensions": ["odm"]
+ },
+ "application/vnd.oasis.opendocument.text-template": {
+ "source": "iana",
+ "extensions": ["ott"]
+ },
+ "application/vnd.oasis.opendocument.text-web": {
+ "source": "iana",
+ "extensions": ["oth"]
+ },
+ "application/vnd.obn": {
+ "source": "iana"
+ },
+ "application/vnd.oftn.l10n+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.oipf.contentaccessdownload+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.contentaccessstreaming+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.cspg-hexbinary": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.dae.svg+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.dae.xhtml+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.mippvcontrolmessage+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.pae.gem": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.spdiscovery+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.spdlist+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.ueprofile+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oipf.userprofile+xml": {
+ "source": "iana"
+ },
+ "application/vnd.olpc-sugar": {
+ "source": "iana",
+ "extensions": ["xo"]
+ },
+ "application/vnd.oma-scws-config": {
+ "source": "iana"
+ },
+ "application/vnd.oma-scws-http-request": {
+ "source": "iana"
+ },
+ "application/vnd.oma-scws-http-response": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.associated-procedure-parameter+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.drm-trigger+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.imd+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.ltkm": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.notification+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.provisioningtrigger": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.sgboot": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.sgdd+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.sgdu": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.simple-symbol-container": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.smartcard-trigger+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.sprov+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.bcast.stkm": {
+ "source": "iana"
+ },
+ "application/vnd.oma.cab-address-book+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.cab-feature-handler+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.cab-pcc+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.cab-subs-invite+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.cab-user-prefs+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.dcd": {
+ "source": "iana"
+ },
+ "application/vnd.oma.dcdc": {
+ "source": "iana"
+ },
+ "application/vnd.oma.dd2+xml": {
+ "source": "iana",
+ "extensions": ["dd2"]
+ },
+ "application/vnd.oma.drm.risd+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.group-usage-list+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.pal+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.poc.detailed-progress-report+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.poc.final-report+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.poc.groups+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.poc.invocation-descriptor+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.poc.optimized-progress-report+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.push": {
+ "source": "iana"
+ },
+ "application/vnd.oma.scidm.messages+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oma.xcap-directory+xml": {
+ "source": "iana"
+ },
+ "application/vnd.omads-email+xml": {
+ "source": "iana"
+ },
+ "application/vnd.omads-file+xml": {
+ "source": "iana"
+ },
+ "application/vnd.omads-folder+xml": {
+ "source": "iana"
+ },
+ "application/vnd.omaloc-supl-init": {
+ "source": "iana"
+ },
+ "application/vnd.openblox.game+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openblox.game-binary": {
+ "source": "iana"
+ },
+ "application/vnd.openeye.oeb": {
+ "source": "iana"
+ },
+ "application/vnd.openofficeorg.extension": {
+ "source": "apache",
+ "extensions": ["oxt"]
+ },
+ "application/vnd.openxmlformats-officedocument.custom-properties+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.drawing+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.extended-properties+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml-template": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["pptx"]
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slide": {
+ "source": "iana",
+ "extensions": ["sldx"]
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slideshow": {
+ "source": "iana",
+ "extensions": ["ppsx"]
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.template": {
+ "source": "apache",
+ "extensions": ["potx"]
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml-template": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["xlsx"]
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.template": {
+ "source": "apache",
+ "extensions": ["xltx"]
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.theme+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.themeoverride+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.vmldrawing": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml-template": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["docx"]
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.template": {
+ "source": "apache",
+ "extensions": ["dotx"]
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-package.core-properties+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": {
+ "source": "iana"
+ },
+ "application/vnd.openxmlformats-package.relationships+xml": {
+ "source": "iana"
+ },
+ "application/vnd.oracle.resource+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.orange.indata": {
+ "source": "iana"
+ },
+ "application/vnd.osa.netdeploy": {
+ "source": "iana"
+ },
+ "application/vnd.osgeo.mapguide.package": {
+ "source": "iana",
+ "extensions": ["mgp"]
+ },
+ "application/vnd.osgi.bundle": {
+ "source": "iana"
+ },
+ "application/vnd.osgi.dp": {
+ "source": "iana",
+ "extensions": ["dp"]
+ },
+ "application/vnd.osgi.subsystem": {
+ "source": "iana",
+ "extensions": ["esa"]
+ },
+ "application/vnd.otps.ct-kip+xml": {
+ "source": "iana"
+ },
+ "application/vnd.palm": {
+ "source": "iana",
+ "extensions": ["pdb","pqa","oprc"]
+ },
+ "application/vnd.panoply": {
+ "source": "iana"
+ },
+ "application/vnd.paos+xml": {
+ "source": "iana"
+ },
+ "application/vnd.paos.xml": {
+ "source": "apache"
+ },
+ "application/vnd.pawaafile": {
+ "source": "iana",
+ "extensions": ["paw"]
+ },
+ "application/vnd.pcos": {
+ "source": "iana"
+ },
+ "application/vnd.pg.format": {
+ "source": "iana",
+ "extensions": ["str"]
+ },
+ "application/vnd.pg.osasli": {
+ "source": "iana",
+ "extensions": ["ei6"]
+ },
+ "application/vnd.piaccess.application-licence": {
+ "source": "iana"
+ },
+ "application/vnd.picsel": {
+ "source": "iana",
+ "extensions": ["efif"]
+ },
+ "application/vnd.pmi.widget": {
+ "source": "iana",
+ "extensions": ["wg"]
+ },
+ "application/vnd.poc.group-advertisement+xml": {
+ "source": "iana"
+ },
+ "application/vnd.pocketlearn": {
+ "source": "iana",
+ "extensions": ["plf"]
+ },
+ "application/vnd.powerbuilder6": {
+ "source": "iana",
+ "extensions": ["pbd"]
+ },
+ "application/vnd.powerbuilder6-s": {
+ "source": "iana"
+ },
+ "application/vnd.powerbuilder7": {
+ "source": "iana"
+ },
+ "application/vnd.powerbuilder7-s": {
+ "source": "iana"
+ },
+ "application/vnd.powerbuilder75": {
+ "source": "iana"
+ },
+ "application/vnd.powerbuilder75-s": {
+ "source": "iana"
+ },
+ "application/vnd.preminet": {
+ "source": "iana"
+ },
+ "application/vnd.previewsystems.box": {
+ "source": "iana",
+ "extensions": ["box"]
+ },
+ "application/vnd.proteus.magazine": {
+ "source": "iana",
+ "extensions": ["mgz"]
+ },
+ "application/vnd.publishare-delta-tree": {
+ "source": "iana",
+ "extensions": ["qps"]
+ },
+ "application/vnd.pvi.ptid1": {
+ "source": "iana",
+ "extensions": ["ptid"]
+ },
+ "application/vnd.pwg-multiplexed": {
+ "source": "iana"
+ },
+ "application/vnd.pwg-xhtml-print+xml": {
+ "source": "iana"
+ },
+ "application/vnd.qualcomm.brew-app-res": {
+ "source": "iana"
+ },
+ "application/vnd.quark.quarkxpress": {
+ "source": "iana",
+ "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"]
+ },
+ "application/vnd.quobject-quoxdocument": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.moml+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-audit+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-audit-conf+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-audit-conn+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-audit-dialog+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-audit-stream+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-conf+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-dialog+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-dialog-base+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-dialog-fax-detect+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-dialog-group+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-dialog-speech+xml": {
+ "source": "iana"
+ },
+ "application/vnd.radisys.msml-dialog-transform+xml": {
+ "source": "iana"
+ },
+ "application/vnd.rainstor.data": {
+ "source": "iana"
+ },
+ "application/vnd.rapid": {
+ "source": "iana"
+ },
+ "application/vnd.realvnc.bed": {
+ "source": "iana",
+ "extensions": ["bed"]
+ },
+ "application/vnd.recordare.musicxml": {
+ "source": "iana",
+ "extensions": ["mxl"]
+ },
+ "application/vnd.recordare.musicxml+xml": {
+ "source": "iana",
+ "extensions": ["musicxml"]
+ },
+ "application/vnd.renlearn.rlprint": {
+ "source": "iana"
+ },
+ "application/vnd.rig.cryptonote": {
+ "source": "iana",
+ "extensions": ["cryptonote"]
+ },
+ "application/vnd.rim.cod": {
+ "source": "apache",
+ "extensions": ["cod"]
+ },
+ "application/vnd.rn-realmedia": {
+ "source": "apache",
+ "extensions": ["rm"]
+ },
+ "application/vnd.rn-realmedia-vbr": {
+ "source": "apache",
+ "extensions": ["rmvb"]
+ },
+ "application/vnd.route66.link66+xml": {
+ "source": "iana",
+ "extensions": ["link66"]
+ },
+ "application/vnd.rs-274x": {
+ "source": "iana"
+ },
+ "application/vnd.ruckus.download": {
+ "source": "iana"
+ },
+ "application/vnd.s3sms": {
+ "source": "iana"
+ },
+ "application/vnd.sailingtracker.track": {
+ "source": "iana",
+ "extensions": ["st"]
+ },
+ "application/vnd.sbm.cid": {
+ "source": "iana"
+ },
+ "application/vnd.sbm.mid2": {
+ "source": "iana"
+ },
+ "application/vnd.scribus": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.3df": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.csf": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.doc": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.eml": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.mht": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.net": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.ppt": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.tiff": {
+ "source": "iana"
+ },
+ "application/vnd.sealed.xls": {
+ "source": "iana"
+ },
+ "application/vnd.sealedmedia.softseal.html": {
+ "source": "iana"
+ },
+ "application/vnd.sealedmedia.softseal.pdf": {
+ "source": "iana"
+ },
+ "application/vnd.seemail": {
+ "source": "iana",
+ "extensions": ["see"]
+ },
+ "application/vnd.sema": {
+ "source": "iana",
+ "extensions": ["sema"]
+ },
+ "application/vnd.semd": {
+ "source": "iana",
+ "extensions": ["semd"]
+ },
+ "application/vnd.semf": {
+ "source": "iana",
+ "extensions": ["semf"]
+ },
+ "application/vnd.shana.informed.formdata": {
+ "source": "iana",
+ "extensions": ["ifm"]
+ },
+ "application/vnd.shana.informed.formtemplate": {
+ "source": "iana",
+ "extensions": ["itp"]
+ },
+ "application/vnd.shana.informed.interchange": {
+ "source": "iana",
+ "extensions": ["iif"]
+ },
+ "application/vnd.shana.informed.package": {
+ "source": "iana",
+ "extensions": ["ipk"]
+ },
+ "application/vnd.simtech-mindmapper": {
+ "source": "iana",
+ "extensions": ["twd","twds"]
+ },
+ "application/vnd.siren+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.smaf": {
+ "source": "iana",
+ "extensions": ["mmf"]
+ },
+ "application/vnd.smart.notebook": {
+ "source": "iana"
+ },
+ "application/vnd.smart.teacher": {
+ "source": "iana",
+ "extensions": ["teacher"]
+ },
+ "application/vnd.software602.filler.form+xml": {
+ "source": "iana"
+ },
+ "application/vnd.software602.filler.form-xml-zip": {
+ "source": "iana"
+ },
+ "application/vnd.solent.sdkm+xml": {
+ "source": "iana",
+ "extensions": ["sdkm","sdkd"]
+ },
+ "application/vnd.spotfire.dxp": {
+ "source": "iana",
+ "extensions": ["dxp"]
+ },
+ "application/vnd.spotfire.sfs": {
+ "source": "iana",
+ "extensions": ["sfs"]
+ },
+ "application/vnd.sss-cod": {
+ "source": "iana"
+ },
+ "application/vnd.sss-dtf": {
+ "source": "iana"
+ },
+ "application/vnd.sss-ntf": {
+ "source": "iana"
+ },
+ "application/vnd.stardivision.calc": {
+ "source": "apache",
+ "extensions": ["sdc"]
+ },
+ "application/vnd.stardivision.draw": {
+ "source": "apache",
+ "extensions": ["sda"]
+ },
+ "application/vnd.stardivision.impress": {
+ "source": "apache",
+ "extensions": ["sdd"]
+ },
+ "application/vnd.stardivision.math": {
+ "source": "apache",
+ "extensions": ["smf"]
+ },
+ "application/vnd.stardivision.writer": {
+ "source": "apache",
+ "extensions": ["sdw","vor"]
+ },
+ "application/vnd.stardivision.writer-global": {
+ "source": "apache",
+ "extensions": ["sgl"]
+ },
+ "application/vnd.stepmania.package": {
+ "source": "iana",
+ "extensions": ["smzip"]
+ },
+ "application/vnd.stepmania.stepchart": {
+ "source": "iana",
+ "extensions": ["sm"]
+ },
+ "application/vnd.street-stream": {
+ "source": "iana"
+ },
+ "application/vnd.sun.wadl+xml": {
+ "source": "iana"
+ },
+ "application/vnd.sun.xml.calc": {
+ "source": "apache",
+ "extensions": ["sxc"]
+ },
+ "application/vnd.sun.xml.calc.template": {
+ "source": "apache",
+ "extensions": ["stc"]
+ },
+ "application/vnd.sun.xml.draw": {
+ "source": "apache",
+ "extensions": ["sxd"]
+ },
+ "application/vnd.sun.xml.draw.template": {
+ "source": "apache",
+ "extensions": ["std"]
+ },
+ "application/vnd.sun.xml.impress": {
+ "source": "apache",
+ "extensions": ["sxi"]
+ },
+ "application/vnd.sun.xml.impress.template": {
+ "source": "apache",
+ "extensions": ["sti"]
+ },
+ "application/vnd.sun.xml.math": {
+ "source": "apache",
+ "extensions": ["sxm"]
+ },
+ "application/vnd.sun.xml.writer": {
+ "source": "apache",
+ "extensions": ["sxw"]
+ },
+ "application/vnd.sun.xml.writer.global": {
+ "source": "apache",
+ "extensions": ["sxg"]
+ },
+ "application/vnd.sun.xml.writer.template": {
+ "source": "apache",
+ "extensions": ["stw"]
+ },
+ "application/vnd.sus-calendar": {
+ "source": "iana",
+ "extensions": ["sus","susp"]
+ },
+ "application/vnd.svd": {
+ "source": "iana",
+ "extensions": ["svd"]
+ },
+ "application/vnd.swiftview-ics": {
+ "source": "iana"
+ },
+ "application/vnd.symbian.install": {
+ "source": "apache",
+ "extensions": ["sis","sisx"]
+ },
+ "application/vnd.syncml+xml": {
+ "source": "iana",
+ "extensions": ["xsm"]
+ },
+ "application/vnd.syncml.dm+wbxml": {
+ "source": "iana",
+ "extensions": ["bdm"]
+ },
+ "application/vnd.syncml.dm+xml": {
+ "source": "iana",
+ "extensions": ["xdm"]
+ },
+ "application/vnd.syncml.dm.notification": {
+ "source": "iana"
+ },
+ "application/vnd.syncml.dmddf+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.syncml.dmddf+xml": {
+ "source": "iana"
+ },
+ "application/vnd.syncml.dmtnds+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.syncml.dmtnds+xml": {
+ "source": "iana"
+ },
+ "application/vnd.syncml.ds.notification": {
+ "source": "iana"
+ },
+ "application/vnd.tao.intent-module-archive": {
+ "source": "iana",
+ "extensions": ["tao"]
+ },
+ "application/vnd.tcpdump.pcap": {
+ "source": "iana",
+ "extensions": ["pcap","cap","dmp"]
+ },
+ "application/vnd.tmd.mediaflex.api+xml": {
+ "source": "iana"
+ },
+ "application/vnd.tmobile-livetv": {
+ "source": "iana",
+ "extensions": ["tmo"]
+ },
+ "application/vnd.trid.tpt": {
+ "source": "iana",
+ "extensions": ["tpt"]
+ },
+ "application/vnd.triscape.mxs": {
+ "source": "iana",
+ "extensions": ["mxs"]
+ },
+ "application/vnd.trueapp": {
+ "source": "iana",
+ "extensions": ["tra"]
+ },
+ "application/vnd.truedoc": {
+ "source": "iana"
+ },
+ "application/vnd.ubisoft.webplayer": {
+ "source": "iana"
+ },
+ "application/vnd.ufdl": {
+ "source": "iana",
+ "extensions": ["ufd","ufdl"]
+ },
+ "application/vnd.uiq.theme": {
+ "source": "iana",
+ "extensions": ["utz"]
+ },
+ "application/vnd.umajin": {
+ "source": "iana",
+ "extensions": ["umj"]
+ },
+ "application/vnd.unity": {
+ "source": "iana",
+ "extensions": ["unityweb"]
+ },
+ "application/vnd.uoml+xml": {
+ "source": "iana",
+ "extensions": ["uoml"]
+ },
+ "application/vnd.uplanet.alert": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.alert-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.bearer-choice": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.bearer-choice-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.cacheop": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.cacheop-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.channel": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.channel-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.list": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.list-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.listcmd": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.listcmd-wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.uplanet.signal": {
+ "source": "iana"
+ },
+ "application/vnd.uri-map": {
+ "source": "iana"
+ },
+ "application/vnd.valve.source.material": {
+ "source": "iana"
+ },
+ "application/vnd.vcx": {
+ "source": "iana",
+ "extensions": ["vcx"]
+ },
+ "application/vnd.vd-study": {
+ "source": "iana"
+ },
+ "application/vnd.vectorworks": {
+ "source": "iana"
+ },
+ "application/vnd.verimatrix.vcas": {
+ "source": "iana"
+ },
+ "application/vnd.vidsoft.vidconference": {
+ "source": "iana"
+ },
+ "application/vnd.visio": {
+ "source": "iana",
+ "extensions": ["vsd","vst","vss","vsw"]
+ },
+ "application/vnd.visionary": {
+ "source": "iana",
+ "extensions": ["vis"]
+ },
+ "application/vnd.vividence.scriptfile": {
+ "source": "iana"
+ },
+ "application/vnd.vsf": {
+ "source": "iana",
+ "extensions": ["vsf"]
+ },
+ "application/vnd.wap.sic": {
+ "source": "iana"
+ },
+ "application/vnd.wap.slc": {
+ "source": "iana"
+ },
+ "application/vnd.wap.wbxml": {
+ "source": "iana",
+ "extensions": ["wbxml"]
+ },
+ "application/vnd.wap.wmlc": {
+ "source": "iana",
+ "extensions": ["wmlc"]
+ },
+ "application/vnd.wap.wmlscriptc": {
+ "source": "iana",
+ "extensions": ["wmlsc"]
+ },
+ "application/vnd.webturbo": {
+ "source": "iana",
+ "extensions": ["wtb"]
+ },
+ "application/vnd.wfa.p2p": {
+ "source": "iana"
+ },
+ "application/vnd.wfa.wsc": {
+ "source": "iana"
+ },
+ "application/vnd.windows.devicepairing": {
+ "source": "iana"
+ },
+ "application/vnd.wmc": {
+ "source": "iana"
+ },
+ "application/vnd.wmf.bootstrap": {
+ "source": "iana"
+ },
+ "application/vnd.wolfram.mathematica": {
+ "source": "iana"
+ },
+ "application/vnd.wolfram.mathematica.package": {
+ "source": "iana"
+ },
+ "application/vnd.wolfram.player": {
+ "source": "iana",
+ "extensions": ["nbp"]
+ },
+ "application/vnd.wordperfect": {
+ "source": "iana",
+ "extensions": ["wpd"]
+ },
+ "application/vnd.wqd": {
+ "source": "iana",
+ "extensions": ["wqd"]
+ },
+ "application/vnd.wrq-hp3000-labelled": {
+ "source": "iana"
+ },
+ "application/vnd.wt.stf": {
+ "source": "iana",
+ "extensions": ["stf"]
+ },
+ "application/vnd.wv.csp+wbxml": {
+ "source": "iana"
+ },
+ "application/vnd.wv.csp+xml": {
+ "source": "iana"
+ },
+ "application/vnd.wv.ssp+xml": {
+ "source": "iana"
+ },
+ "application/vnd.xacml+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/vnd.xara": {
+ "source": "iana",
+ "extensions": ["xar"]
+ },
+ "application/vnd.xfdl": {
+ "source": "iana",
+ "extensions": ["xfdl"]
+ },
+ "application/vnd.xfdl.webform": {
+ "source": "iana"
+ },
+ "application/vnd.xmi+xml": {
+ "source": "iana"
+ },
+ "application/vnd.xmpie.cpkg": {
+ "source": "iana"
+ },
+ "application/vnd.xmpie.dpkg": {
+ "source": "iana"
+ },
+ "application/vnd.xmpie.plan": {
+ "source": "iana"
+ },
+ "application/vnd.xmpie.ppkg": {
+ "source": "iana"
+ },
+ "application/vnd.xmpie.xlim": {
+ "source": "iana"
+ },
+ "application/vnd.yamaha.hv-dic": {
+ "source": "iana",
+ "extensions": ["hvd"]
+ },
+ "application/vnd.yamaha.hv-script": {
+ "source": "iana",
+ "extensions": ["hvs"]
+ },
+ "application/vnd.yamaha.hv-voice": {
+ "source": "iana",
+ "extensions": ["hvp"]
+ },
+ "application/vnd.yamaha.openscoreformat": {
+ "source": "iana",
+ "extensions": ["osf"]
+ },
+ "application/vnd.yamaha.openscoreformat.osfpvg+xml": {
+ "source": "iana",
+ "extensions": ["osfpvg"]
+ },
+ "application/vnd.yamaha.remote-setup": {
+ "source": "iana"
+ },
+ "application/vnd.yamaha.smaf-audio": {
+ "source": "iana",
+ "extensions": ["saf"]
+ },
+ "application/vnd.yamaha.smaf-phrase": {
+ "source": "iana",
+ "extensions": ["spf"]
+ },
+ "application/vnd.yamaha.through-ngn": {
+ "source": "iana"
+ },
+ "application/vnd.yamaha.tunnel-udpencap": {
+ "source": "iana"
+ },
+ "application/vnd.yaoweme": {
+ "source": "iana"
+ },
+ "application/vnd.yellowriver-custom-menu": {
+ "source": "iana",
+ "extensions": ["cmp"]
+ },
+ "application/vnd.zul": {
+ "source": "iana",
+ "extensions": ["zir","zirz"]
+ },
+ "application/vnd.zzazz.deck+xml": {
+ "source": "iana",
+ "extensions": ["zaz"]
+ },
+ "application/voicexml+xml": {
+ "source": "iana",
+ "extensions": ["vxml"]
+ },
+ "application/vq-rtcpxr": {
+ "source": "iana"
+ },
+ "application/watcherinfo+xml": {
+ "source": "iana"
+ },
+ "application/whoispp-query": {
+ "source": "iana"
+ },
+ "application/whoispp-response": {
+ "source": "iana"
+ },
+ "application/widget": {
+ "source": "iana",
+ "extensions": ["wgt"]
+ },
+ "application/winhlp": {
+ "source": "apache",
+ "extensions": ["hlp"]
+ },
+ "application/wita": {
+ "source": "iana"
+ },
+ "application/wordperfect5.1": {
+ "source": "iana"
+ },
+ "application/wsdl+xml": {
+ "source": "iana",
+ "extensions": ["wsdl"]
+ },
+ "application/wspolicy+xml": {
+ "source": "iana",
+ "extensions": ["wspolicy"]
+ },
+ "application/x-7z-compressed": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["7z"]
+ },
+ "application/x-abiword": {
+ "source": "apache",
+ "extensions": ["abw"]
+ },
+ "application/x-ace-compressed": {
+ "source": "apache",
+ "extensions": ["ace"]
+ },
+ "application/x-amf": {
+ "source": "apache"
+ },
+ "application/x-apple-diskimage": {
+ "source": "apache",
+ "extensions": ["dmg"]
+ },
+ "application/x-authorware-bin": {
+ "source": "apache",
+ "extensions": ["aab","x32","u32","vox"]
+ },
+ "application/x-authorware-map": {
+ "source": "apache",
+ "extensions": ["aam"]
+ },
+ "application/x-authorware-seg": {
+ "source": "apache",
+ "extensions": ["aas"]
+ },
+ "application/x-bcpio": {
+ "source": "apache",
+ "extensions": ["bcpio"]
+ },
+ "application/x-bdoc": {
+ "compressible": false,
+ "extensions": ["bdoc"]
+ },
+ "application/x-bittorrent": {
+ "source": "apache",
+ "extensions": ["torrent"]
+ },
+ "application/x-blorb": {
+ "source": "apache",
+ "extensions": ["blb","blorb"]
+ },
+ "application/x-bzip": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["bz"]
+ },
+ "application/x-bzip2": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["bz2","boz"]
+ },
+ "application/x-cbr": {
+ "source": "apache",
+ "extensions": ["cbr","cba","cbt","cbz","cb7"]
+ },
+ "application/x-cdlink": {
+ "source": "apache",
+ "extensions": ["vcd"]
+ },
+ "application/x-cfs-compressed": {
+ "source": "apache",
+ "extensions": ["cfs"]
+ },
+ "application/x-chat": {
+ "source": "apache",
+ "extensions": ["chat"]
+ },
+ "application/x-chess-pgn": {
+ "source": "apache",
+ "extensions": ["pgn"]
+ },
+ "application/x-chrome-extension": {
+ "extensions": ["crx"]
+ },
+ "application/x-cocoa": {
+ "source": "nginx",
+ "extensions": ["cco"]
+ },
+ "application/x-compress": {
+ "source": "apache"
+ },
+ "application/x-conference": {
+ "source": "apache",
+ "extensions": ["nsc"]
+ },
+ "application/x-cpio": {
+ "source": "apache",
+ "extensions": ["cpio"]
+ },
+ "application/x-csh": {
+ "source": "apache",
+ "extensions": ["csh"]
+ },
+ "application/x-deb": {
+ "compressible": false
+ },
+ "application/x-debian-package": {
+ "source": "apache",
+ "extensions": ["deb","udeb"]
+ },
+ "application/x-dgc-compressed": {
+ "source": "apache",
+ "extensions": ["dgc"]
+ },
+ "application/x-director": {
+ "source": "apache",
+ "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]
+ },
+ "application/x-doom": {
+ "source": "apache",
+ "extensions": ["wad"]
+ },
+ "application/x-dtbncx+xml": {
+ "source": "apache",
+ "extensions": ["ncx"]
+ },
+ "application/x-dtbook+xml": {
+ "source": "apache",
+ "extensions": ["dtb"]
+ },
+ "application/x-dtbresource+xml": {
+ "source": "apache",
+ "extensions": ["res"]
+ },
+ "application/x-dvi": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["dvi"]
+ },
+ "application/x-envoy": {
+ "source": "apache",
+ "extensions": ["evy"]
+ },
+ "application/x-eva": {
+ "source": "apache",
+ "extensions": ["eva"]
+ },
+ "application/x-font-bdf": {
+ "source": "apache",
+ "extensions": ["bdf"]
+ },
+ "application/x-font-dos": {
+ "source": "apache"
+ },
+ "application/x-font-framemaker": {
+ "source": "apache"
+ },
+ "application/x-font-ghostscript": {
+ "source": "apache",
+ "extensions": ["gsf"]
+ },
+ "application/x-font-libgrx": {
+ "source": "apache"
+ },
+ "application/x-font-linux-psf": {
+ "source": "apache",
+ "extensions": ["psf"]
+ },
+ "application/x-font-otf": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["otf"]
+ },
+ "application/x-font-pcf": {
+ "source": "apache",
+ "extensions": ["pcf"]
+ },
+ "application/x-font-snf": {
+ "source": "apache",
+ "extensions": ["snf"]
+ },
+ "application/x-font-speedo": {
+ "source": "apache"
+ },
+ "application/x-font-sunos-news": {
+ "source": "apache"
+ },
+ "application/x-font-ttf": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["ttf","ttc"]
+ },
+ "application/x-font-type1": {
+ "source": "apache",
+ "extensions": ["pfa","pfb","pfm","afm"]
+ },
+ "application/x-font-vfont": {
+ "source": "apache"
+ },
+ "application/x-freearc": {
+ "source": "apache",
+ "extensions": ["arc"]
+ },
+ "application/x-futuresplash": {
+ "source": "apache",
+ "extensions": ["spl"]
+ },
+ "application/x-gca-compressed": {
+ "source": "apache",
+ "extensions": ["gca"]
+ },
+ "application/x-glulx": {
+ "source": "apache",
+ "extensions": ["ulx"]
+ },
+ "application/x-gnumeric": {
+ "source": "apache",
+ "extensions": ["gnumeric"]
+ },
+ "application/x-gramps-xml": {
+ "source": "apache",
+ "extensions": ["gramps"]
+ },
+ "application/x-gtar": {
+ "source": "apache",
+ "extensions": ["gtar"]
+ },
+ "application/x-gzip": {
+ "source": "apache"
+ },
+ "application/x-hdf": {
+ "source": "apache",
+ "extensions": ["hdf"]
+ },
+ "application/x-httpd-php": {
+ "compressible": true,
+ "extensions": ["php"]
+ },
+ "application/x-install-instructions": {
+ "source": "apache",
+ "extensions": ["install"]
+ },
+ "application/x-iso9660-image": {
+ "source": "apache",
+ "extensions": ["iso"]
+ },
+ "application/x-java-archive-diff": {
+ "source": "nginx",
+ "extensions": ["jardiff"]
+ },
+ "application/x-java-jnlp-file": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["jnlp"]
+ },
+ "application/x-javascript": {
+ "compressible": true
+ },
+ "application/x-latex": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["latex"]
+ },
+ "application/x-lua-bytecode": {
+ "extensions": ["luac"]
+ },
+ "application/x-lzh-compressed": {
+ "source": "apache",
+ "extensions": ["lzh","lha"]
+ },
+ "application/x-makeself": {
+ "source": "nginx",
+ "extensions": ["run"]
+ },
+ "application/x-mie": {
+ "source": "apache",
+ "extensions": ["mie"]
+ },
+ "application/x-mobipocket-ebook": {
+ "source": "apache",
+ "extensions": ["prc","mobi"]
+ },
+ "application/x-mpegurl": {
+ "compressible": false
+ },
+ "application/x-ms-application": {
+ "source": "apache",
+ "extensions": ["application"]
+ },
+ "application/x-ms-shortcut": {
+ "source": "apache",
+ "extensions": ["lnk"]
+ },
+ "application/x-ms-wmd": {
+ "source": "apache",
+ "extensions": ["wmd"]
+ },
+ "application/x-ms-wmz": {
+ "source": "apache",
+ "extensions": ["wmz"]
+ },
+ "application/x-ms-xbap": {
+ "source": "apache",
+ "extensions": ["xbap"]
+ },
+ "application/x-msaccess": {
+ "source": "apache",
+ "extensions": ["mdb"]
+ },
+ "application/x-msbinder": {
+ "source": "apache",
+ "extensions": ["obd"]
+ },
+ "application/x-mscardfile": {
+ "source": "apache",
+ "extensions": ["crd"]
+ },
+ "application/x-msclip": {
+ "source": "apache",
+ "extensions": ["clp"]
+ },
+ "application/x-msdos-program": {
+ "extensions": ["exe"]
+ },
+ "application/x-msdownload": {
+ "source": "apache",
+ "extensions": ["exe","dll","com","bat","msi"]
+ },
+ "application/x-msmediaview": {
+ "source": "apache",
+ "extensions": ["mvb","m13","m14"]
+ },
+ "application/x-msmetafile": {
+ "source": "apache",
+ "extensions": ["wmf","wmz","emf","emz"]
+ },
+ "application/x-msmoney": {
+ "source": "apache",
+ "extensions": ["mny"]
+ },
+ "application/x-mspublisher": {
+ "source": "apache",
+ "extensions": ["pub"]
+ },
+ "application/x-msschedule": {
+ "source": "apache",
+ "extensions": ["scd"]
+ },
+ "application/x-msterminal": {
+ "source": "apache",
+ "extensions": ["trm"]
+ },
+ "application/x-mswrite": {
+ "source": "apache",
+ "extensions": ["wri"]
+ },
+ "application/x-netcdf": {
+ "source": "apache",
+ "extensions": ["nc","cdf"]
+ },
+ "application/x-ns-proxy-autoconfig": {
+ "compressible": true,
+ "extensions": ["pac"]
+ },
+ "application/x-nzb": {
+ "source": "apache",
+ "extensions": ["nzb"]
+ },
+ "application/x-perl": {
+ "source": "nginx",
+ "extensions": ["pl","pm"]
+ },
+ "application/x-pilot": {
+ "source": "nginx",
+ "extensions": ["prc","pdb"]
+ },
+ "application/x-pkcs12": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["p12","pfx"]
+ },
+ "application/x-pkcs7-certificates": {
+ "source": "apache",
+ "extensions": ["p7b","spc"]
+ },
+ "application/x-pkcs7-certreqresp": {
+ "source": "apache",
+ "extensions": ["p7r"]
+ },
+ "application/x-rar-compressed": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["rar"]
+ },
+ "application/x-redhat-package-manager": {
+ "source": "nginx",
+ "extensions": ["rpm"]
+ },
+ "application/x-research-info-systems": {
+ "source": "apache",
+ "extensions": ["ris"]
+ },
+ "application/x-sea": {
+ "source": "nginx",
+ "extensions": ["sea"]
+ },
+ "application/x-sh": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["sh"]
+ },
+ "application/x-shar": {
+ "source": "apache",
+ "extensions": ["shar"]
+ },
+ "application/x-shockwave-flash": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["swf"]
+ },
+ "application/x-silverlight-app": {
+ "source": "apache",
+ "extensions": ["xap"]
+ },
+ "application/x-sql": {
+ "source": "apache",
+ "extensions": ["sql"]
+ },
+ "application/x-stuffit": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["sit"]
+ },
+ "application/x-stuffitx": {
+ "source": "apache",
+ "extensions": ["sitx"]
+ },
+ "application/x-subrip": {
+ "source": "apache",
+ "extensions": ["srt"]
+ },
+ "application/x-sv4cpio": {
+ "source": "apache",
+ "extensions": ["sv4cpio"]
+ },
+ "application/x-sv4crc": {
+ "source": "apache",
+ "extensions": ["sv4crc"]
+ },
+ "application/x-t3vm-image": {
+ "source": "apache",
+ "extensions": ["t3"]
+ },
+ "application/x-tads": {
+ "source": "apache",
+ "extensions": ["gam"]
+ },
+ "application/x-tar": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["tar"]
+ },
+ "application/x-tcl": {
+ "source": "apache",
+ "extensions": ["tcl","tk"]
+ },
+ "application/x-tex": {
+ "source": "apache",
+ "extensions": ["tex"]
+ },
+ "application/x-tex-tfm": {
+ "source": "apache",
+ "extensions": ["tfm"]
+ },
+ "application/x-texinfo": {
+ "source": "apache",
+ "extensions": ["texinfo","texi"]
+ },
+ "application/x-tgif": {
+ "source": "apache",
+ "extensions": ["obj"]
+ },
+ "application/x-ustar": {
+ "source": "apache",
+ "extensions": ["ustar"]
+ },
+ "application/x-wais-source": {
+ "source": "apache",
+ "extensions": ["src"]
+ },
+ "application/x-web-app-manifest+json": {
+ "compressible": true,
+ "extensions": ["webapp"]
+ },
+ "application/x-www-form-urlencoded": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/x-x509-ca-cert": {
+ "source": "apache",
+ "extensions": ["der","crt","pem"]
+ },
+ "application/x-xfig": {
+ "source": "apache",
+ "extensions": ["fig"]
+ },
+ "application/x-xliff+xml": {
+ "source": "apache",
+ "extensions": ["xlf"]
+ },
+ "application/x-xpinstall": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["xpi"]
+ },
+ "application/x-xz": {
+ "source": "apache",
+ "extensions": ["xz"]
+ },
+ "application/x-zmachine": {
+ "source": "apache",
+ "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"]
+ },
+ "application/x400-bp": {
+ "source": "iana"
+ },
+ "application/xacml+xml": {
+ "source": "iana"
+ },
+ "application/xaml+xml": {
+ "source": "apache",
+ "extensions": ["xaml"]
+ },
+ "application/xcap-att+xml": {
+ "source": "iana"
+ },
+ "application/xcap-caps+xml": {
+ "source": "iana"
+ },
+ "application/xcap-diff+xml": {
+ "source": "iana",
+ "extensions": ["xdf"]
+ },
+ "application/xcap-el+xml": {
+ "source": "iana"
+ },
+ "application/xcap-error+xml": {
+ "source": "iana"
+ },
+ "application/xcap-ns+xml": {
+ "source": "iana"
+ },
+ "application/xcon-conference-info+xml": {
+ "source": "iana"
+ },
+ "application/xcon-conference-info-diff+xml": {
+ "source": "iana"
+ },
+ "application/xenc+xml": {
+ "source": "iana",
+ "extensions": ["xenc"]
+ },
+ "application/xhtml+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xhtml","xht"]
+ },
+ "application/xhtml-voice+xml": {
+ "source": "apache"
+ },
+ "application/xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xml","xsl","xsd"]
+ },
+ "application/xml-dtd": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["dtd"]
+ },
+ "application/xml-external-parsed-entity": {
+ "source": "iana"
+ },
+ "application/xml-patch+xml": {
+ "source": "iana"
+ },
+ "application/xmpp+xml": {
+ "source": "iana"
+ },
+ "application/xop+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xop"]
+ },
+ "application/xproc+xml": {
+ "source": "apache",
+ "extensions": ["xpl"]
+ },
+ "application/xslt+xml": {
+ "source": "iana",
+ "extensions": ["xslt"]
+ },
+ "application/xspf+xml": {
+ "source": "apache",
+ "extensions": ["xspf"]
+ },
+ "application/xv+xml": {
+ "source": "iana",
+ "extensions": ["mxml","xhvml","xvml","xvm"]
+ },
+ "application/yang": {
+ "source": "iana",
+ "extensions": ["yang"]
+ },
+ "application/yin+xml": {
+ "source": "iana",
+ "extensions": ["yin"]
+ },
+ "application/zip": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["zip"]
+ },
+ "application/zlib": {
+ "source": "iana"
+ },
+ "audio/1d-interleaved-parityfec": {
+ "source": "iana"
+ },
+ "audio/32kadpcm": {
+ "source": "iana"
+ },
+ "audio/3gpp": {
+ "source": "iana"
+ },
+ "audio/3gpp2": {
+ "source": "iana"
+ },
+ "audio/ac3": {
+ "source": "iana"
+ },
+ "audio/adpcm": {
+ "source": "apache",
+ "extensions": ["adp"]
+ },
+ "audio/amr": {
+ "source": "iana"
+ },
+ "audio/amr-wb": {
+ "source": "iana"
+ },
+ "audio/amr-wb+": {
+ "source": "iana"
+ },
+ "audio/aptx": {
+ "source": "iana"
+ },
+ "audio/asc": {
+ "source": "iana"
+ },
+ "audio/atrac-advanced-lossless": {
+ "source": "iana"
+ },
+ "audio/atrac-x": {
+ "source": "iana"
+ },
+ "audio/atrac3": {
+ "source": "iana"
+ },
+ "audio/basic": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["au","snd"]
+ },
+ "audio/bv16": {
+ "source": "iana"
+ },
+ "audio/bv32": {
+ "source": "iana"
+ },
+ "audio/clearmode": {
+ "source": "iana"
+ },
+ "audio/cn": {
+ "source": "iana"
+ },
+ "audio/dat12": {
+ "source": "iana"
+ },
+ "audio/dls": {
+ "source": "iana"
+ },
+ "audio/dsr-es201108": {
+ "source": "iana"
+ },
+ "audio/dsr-es202050": {
+ "source": "iana"
+ },
+ "audio/dsr-es202211": {
+ "source": "iana"
+ },
+ "audio/dsr-es202212": {
+ "source": "iana"
+ },
+ "audio/dv": {
+ "source": "iana"
+ },
+ "audio/dvi4": {
+ "source": "iana"
+ },
+ "audio/eac3": {
+ "source": "iana"
+ },
+ "audio/encaprtp": {
+ "source": "iana"
+ },
+ "audio/evrc": {
+ "source": "iana"
+ },
+ "audio/evrc-qcp": {
+ "source": "iana"
+ },
+ "audio/evrc0": {
+ "source": "iana"
+ },
+ "audio/evrc1": {
+ "source": "iana"
+ },
+ "audio/evrcb": {
+ "source": "iana"
+ },
+ "audio/evrcb0": {
+ "source": "iana"
+ },
+ "audio/evrcb1": {
+ "source": "iana"
+ },
+ "audio/evrcnw": {
+ "source": "iana"
+ },
+ "audio/evrcnw0": {
+ "source": "iana"
+ },
+ "audio/evrcnw1": {
+ "source": "iana"
+ },
+ "audio/evrcwb": {
+ "source": "iana"
+ },
+ "audio/evrcwb0": {
+ "source": "iana"
+ },
+ "audio/evrcwb1": {
+ "source": "iana"
+ },
+ "audio/fwdred": {
+ "source": "iana"
+ },
+ "audio/g711-0": {
+ "source": "iana"
+ },
+ "audio/g719": {
+ "source": "iana"
+ },
+ "audio/g722": {
+ "source": "iana"
+ },
+ "audio/g7221": {
+ "source": "iana"
+ },
+ "audio/g723": {
+ "source": "iana"
+ },
+ "audio/g726-16": {
+ "source": "iana"
+ },
+ "audio/g726-24": {
+ "source": "iana"
+ },
+ "audio/g726-32": {
+ "source": "iana"
+ },
+ "audio/g726-40": {
+ "source": "iana"
+ },
+ "audio/g728": {
+ "source": "iana"
+ },
+ "audio/g729": {
+ "source": "iana"
+ },
+ "audio/g7291": {
+ "source": "iana"
+ },
+ "audio/g729d": {
+ "source": "iana"
+ },
+ "audio/g729e": {
+ "source": "iana"
+ },
+ "audio/gsm": {
+ "source": "iana"
+ },
+ "audio/gsm-efr": {
+ "source": "iana"
+ },
+ "audio/gsm-hr-08": {
+ "source": "iana"
+ },
+ "audio/ilbc": {
+ "source": "iana"
+ },
+ "audio/ip-mr_v2.5": {
+ "source": "iana"
+ },
+ "audio/isac": {
+ "source": "apache"
+ },
+ "audio/l16": {
+ "source": "iana"
+ },
+ "audio/l20": {
+ "source": "iana"
+ },
+ "audio/l24": {
+ "source": "iana",
+ "compressible": false
+ },
+ "audio/l8": {
+ "source": "iana"
+ },
+ "audio/lpc": {
+ "source": "iana"
+ },
+ "audio/midi": {
+ "source": "apache",
+ "extensions": ["mid","midi","kar","rmi"]
+ },
+ "audio/mobile-xmf": {
+ "source": "iana"
+ },
+ "audio/mp4": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["mp4a","m4a"]
+ },
+ "audio/mp4a-latm": {
+ "source": "iana"
+ },
+ "audio/mpa": {
+ "source": "iana"
+ },
+ "audio/mpa-robust": {
+ "source": "iana"
+ },
+ "audio/mpeg": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"]
+ },
+ "audio/mpeg4-generic": {
+ "source": "iana"
+ },
+ "audio/musepack": {
+ "source": "apache"
+ },
+ "audio/ogg": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["oga","ogg","spx"]
+ },
+ "audio/opus": {
+ "source": "iana"
+ },
+ "audio/parityfec": {
+ "source": "iana"
+ },
+ "audio/pcma": {
+ "source": "iana"
+ },
+ "audio/pcma-wb": {
+ "source": "iana"
+ },
+ "audio/pcmu": {
+ "source": "iana"
+ },
+ "audio/pcmu-wb": {
+ "source": "iana"
+ },
+ "audio/prs.sid": {
+ "source": "iana"
+ },
+ "audio/qcelp": {
+ "source": "iana"
+ },
+ "audio/raptorfec": {
+ "source": "iana"
+ },
+ "audio/red": {
+ "source": "iana"
+ },
+ "audio/rtp-enc-aescm128": {
+ "source": "iana"
+ },
+ "audio/rtp-midi": {
+ "source": "iana"
+ },
+ "audio/rtploopback": {
+ "source": "iana"
+ },
+ "audio/rtx": {
+ "source": "iana"
+ },
+ "audio/s3m": {
+ "source": "apache",
+ "extensions": ["s3m"]
+ },
+ "audio/silk": {
+ "source": "apache",
+ "extensions": ["sil"]
+ },
+ "audio/smv": {
+ "source": "iana"
+ },
+ "audio/smv-qcp": {
+ "source": "iana"
+ },
+ "audio/smv0": {
+ "source": "iana"
+ },
+ "audio/sp-midi": {
+ "source": "iana"
+ },
+ "audio/speex": {
+ "source": "iana"
+ },
+ "audio/t140c": {
+ "source": "iana"
+ },
+ "audio/t38": {
+ "source": "iana"
+ },
+ "audio/telephone-event": {
+ "source": "iana"
+ },
+ "audio/tone": {
+ "source": "iana"
+ },
+ "audio/uemclip": {
+ "source": "iana"
+ },
+ "audio/ulpfec": {
+ "source": "iana"
+ },
+ "audio/vdvi": {
+ "source": "iana"
+ },
+ "audio/vmr-wb": {
+ "source": "iana"
+ },
+ "audio/vnd.3gpp.iufp": {
+ "source": "iana"
+ },
+ "audio/vnd.4sb": {
+ "source": "iana"
+ },
+ "audio/vnd.audiokoz": {
+ "source": "iana"
+ },
+ "audio/vnd.celp": {
+ "source": "iana"
+ },
+ "audio/vnd.cisco.nse": {
+ "source": "iana"
+ },
+ "audio/vnd.cmles.radio-events": {
+ "source": "iana"
+ },
+ "audio/vnd.cns.anp1": {
+ "source": "iana"
+ },
+ "audio/vnd.cns.inf1": {
+ "source": "iana"
+ },
+ "audio/vnd.dece.audio": {
+ "source": "iana",
+ "extensions": ["uva","uvva"]
+ },
+ "audio/vnd.digital-winds": {
+ "source": "iana",
+ "extensions": ["eol"]
+ },
+ "audio/vnd.dlna.adts": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.heaac.1": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.heaac.2": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.mlp": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.mps": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.pl2": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.pl2x": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.pl2z": {
+ "source": "iana"
+ },
+ "audio/vnd.dolby.pulse.1": {
+ "source": "iana"
+ },
+ "audio/vnd.dra": {
+ "source": "iana",
+ "extensions": ["dra"]
+ },
+ "audio/vnd.dts": {
+ "source": "iana",
+ "extensions": ["dts"]
+ },
+ "audio/vnd.dts.hd": {
+ "source": "iana",
+ "extensions": ["dtshd"]
+ },
+ "audio/vnd.dvb.file": {
+ "source": "iana"
+ },
+ "audio/vnd.everad.plj": {
+ "source": "iana"
+ },
+ "audio/vnd.hns.audio": {
+ "source": "iana"
+ },
+ "audio/vnd.lucent.voice": {
+ "source": "iana",
+ "extensions": ["lvp"]
+ },
+ "audio/vnd.ms-playready.media.pya": {
+ "source": "iana",
+ "extensions": ["pya"]
+ },
+ "audio/vnd.nokia.mobile-xmf": {
+ "source": "iana"
+ },
+ "audio/vnd.nortel.vbk": {
+ "source": "iana"
+ },
+ "audio/vnd.nuera.ecelp4800": {
+ "source": "iana",
+ "extensions": ["ecelp4800"]
+ },
+ "audio/vnd.nuera.ecelp7470": {
+ "source": "iana",
+ "extensions": ["ecelp7470"]
+ },
+ "audio/vnd.nuera.ecelp9600": {
+ "source": "iana",
+ "extensions": ["ecelp9600"]
+ },
+ "audio/vnd.octel.sbc": {
+ "source": "iana"
+ },
+ "audio/vnd.qcelp": {
+ "source": "iana"
+ },
+ "audio/vnd.rhetorex.32kadpcm": {
+ "source": "iana"
+ },
+ "audio/vnd.rip": {
+ "source": "iana",
+ "extensions": ["rip"]
+ },
+ "audio/vnd.rn-realaudio": {
+ "compressible": false
+ },
+ "audio/vnd.sealedmedia.softseal.mpeg": {
+ "source": "iana"
+ },
+ "audio/vnd.vmx.cvsd": {
+ "source": "iana"
+ },
+ "audio/vnd.wave": {
+ "compressible": false
+ },
+ "audio/vorbis": {
+ "source": "iana",
+ "compressible": false
+ },
+ "audio/vorbis-config": {
+ "source": "iana"
+ },
+ "audio/wav": {
+ "compressible": false,
+ "extensions": ["wav"]
+ },
+ "audio/wave": {
+ "compressible": false,
+ "extensions": ["wav"]
+ },
+ "audio/webm": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["weba"]
+ },
+ "audio/x-aac": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["aac"]
+ },
+ "audio/x-aiff": {
+ "source": "apache",
+ "extensions": ["aif","aiff","aifc"]
+ },
+ "audio/x-caf": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["caf"]
+ },
+ "audio/x-flac": {
+ "source": "apache",
+ "extensions": ["flac"]
+ },
+ "audio/x-m4a": {
+ "source": "nginx",
+ "extensions": ["m4a"]
+ },
+ "audio/x-matroska": {
+ "source": "apache",
+ "extensions": ["mka"]
+ },
+ "audio/x-mpegurl": {
+ "source": "apache",
+ "extensions": ["m3u"]
+ },
+ "audio/x-ms-wax": {
+ "source": "apache",
+ "extensions": ["wax"]
+ },
+ "audio/x-ms-wma": {
+ "source": "apache",
+ "extensions": ["wma"]
+ },
+ "audio/x-pn-realaudio": {
+ "source": "apache",
+ "extensions": ["ram","ra"]
+ },
+ "audio/x-pn-realaudio-plugin": {
+ "source": "apache",
+ "extensions": ["rmp"]
+ },
+ "audio/x-realaudio": {
+ "source": "nginx",
+ "extensions": ["ra"]
+ },
+ "audio/x-tta": {
+ "source": "apache"
+ },
+ "audio/x-wav": {
+ "source": "apache",
+ "extensions": ["wav"]
+ },
+ "audio/xm": {
+ "source": "apache",
+ "extensions": ["xm"]
+ },
+ "chemical/x-cdx": {
+ "source": "apache",
+ "extensions": ["cdx"]
+ },
+ "chemical/x-cif": {
+ "source": "apache",
+ "extensions": ["cif"]
+ },
+ "chemical/x-cmdf": {
+ "source": "apache",
+ "extensions": ["cmdf"]
+ },
+ "chemical/x-cml": {
+ "source": "apache",
+ "extensions": ["cml"]
+ },
+ "chemical/x-csml": {
+ "source": "apache",
+ "extensions": ["csml"]
+ },
+ "chemical/x-pdb": {
+ "source": "apache"
+ },
+ "chemical/x-xyz": {
+ "source": "apache",
+ "extensions": ["xyz"]
+ },
+ "font/opentype": {
+ "compressible": true,
+ "extensions": ["otf"]
+ },
+ "image/bmp": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["bmp"]
+ },
+ "image/cgm": {
+ "source": "iana",
+ "extensions": ["cgm"]
+ },
+ "image/fits": {
+ "source": "iana"
+ },
+ "image/g3fax": {
+ "source": "iana",
+ "extensions": ["g3"]
+ },
+ "image/gif": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["gif"]
+ },
+ "image/ief": {
+ "source": "iana",
+ "extensions": ["ief"]
+ },
+ "image/jp2": {
+ "source": "iana"
+ },
+ "image/jpeg": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["jpeg","jpg","jpe"]
+ },
+ "image/jpm": {
+ "source": "iana"
+ },
+ "image/jpx": {
+ "source": "iana"
+ },
+ "image/ktx": {
+ "source": "iana",
+ "extensions": ["ktx"]
+ },
+ "image/naplps": {
+ "source": "iana"
+ },
+ "image/pjpeg": {
+ "compressible": false
+ },
+ "image/png": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["png"]
+ },
+ "image/prs.btif": {
+ "source": "iana",
+ "extensions": ["btif"]
+ },
+ "image/prs.pti": {
+ "source": "iana"
+ },
+ "image/pwg-raster": {
+ "source": "iana"
+ },
+ "image/sgi": {
+ "source": "apache",
+ "extensions": ["sgi"]
+ },
+ "image/svg+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["svg","svgz"]
+ },
+ "image/t38": {
+ "source": "iana"
+ },
+ "image/tiff": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["tiff","tif"]
+ },
+ "image/tiff-fx": {
+ "source": "iana"
+ },
+ "image/vnd.adobe.photoshop": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["psd"]
+ },
+ "image/vnd.airzip.accelerator.azv": {
+ "source": "iana"
+ },
+ "image/vnd.cns.inf2": {
+ "source": "iana"
+ },
+ "image/vnd.dece.graphic": {
+ "source": "iana",
+ "extensions": ["uvi","uvvi","uvg","uvvg"]
+ },
+ "image/vnd.djvu": {
+ "source": "iana",
+ "extensions": ["djvu","djv"]
+ },
+ "image/vnd.dvb.subtitle": {
+ "source": "iana",
+ "extensions": ["sub"]
+ },
+ "image/vnd.dwg": {
+ "source": "iana",
+ "extensions": ["dwg"]
+ },
+ "image/vnd.dxf": {
+ "source": "iana",
+ "extensions": ["dxf"]
+ },
+ "image/vnd.fastbidsheet": {
+ "source": "iana",
+ "extensions": ["fbs"]
+ },
+ "image/vnd.fpx": {
+ "source": "iana",
+ "extensions": ["fpx"]
+ },
+ "image/vnd.fst": {
+ "source": "iana",
+ "extensions": ["fst"]
+ },
+ "image/vnd.fujixerox.edmics-mmr": {
+ "source": "iana",
+ "extensions": ["mmr"]
+ },
+ "image/vnd.fujixerox.edmics-rlc": {
+ "source": "iana",
+ "extensions": ["rlc"]
+ },
+ "image/vnd.globalgraphics.pgb": {
+ "source": "iana"
+ },
+ "image/vnd.microsoft.icon": {
+ "source": "iana"
+ },
+ "image/vnd.mix": {
+ "source": "iana"
+ },
+ "image/vnd.mozilla.apng": {
+ "source": "iana"
+ },
+ "image/vnd.ms-modi": {
+ "source": "iana",
+ "extensions": ["mdi"]
+ },
+ "image/vnd.ms-photo": {
+ "source": "apache",
+ "extensions": ["wdp"]
+ },
+ "image/vnd.net-fpx": {
+ "source": "iana",
+ "extensions": ["npx"]
+ },
+ "image/vnd.radiance": {
+ "source": "iana"
+ },
+ "image/vnd.sealed.png": {
+ "source": "iana"
+ },
+ "image/vnd.sealedmedia.softseal.gif": {
+ "source": "iana"
+ },
+ "image/vnd.sealedmedia.softseal.jpg": {
+ "source": "iana"
+ },
+ "image/vnd.svf": {
+ "source": "iana"
+ },
+ "image/vnd.tencent.tap": {
+ "source": "iana"
+ },
+ "image/vnd.valve.source.texture": {
+ "source": "iana"
+ },
+ "image/vnd.wap.wbmp": {
+ "source": "iana",
+ "extensions": ["wbmp"]
+ },
+ "image/vnd.xiff": {
+ "source": "iana",
+ "extensions": ["xif"]
+ },
+ "image/vnd.zbrush.pcx": {
+ "source": "iana"
+ },
+ "image/webp": {
+ "source": "apache",
+ "extensions": ["webp"]
+ },
+ "image/x-3ds": {
+ "source": "apache",
+ "extensions": ["3ds"]
+ },
+ "image/x-cmu-raster": {
+ "source": "apache",
+ "extensions": ["ras"]
+ },
+ "image/x-cmx": {
+ "source": "apache",
+ "extensions": ["cmx"]
+ },
+ "image/x-freehand": {
+ "source": "apache",
+ "extensions": ["fh","fhc","fh4","fh5","fh7"]
+ },
+ "image/x-icon": {
+ "source": "apache",
+ "compressible": true,
+ "extensions": ["ico"]
+ },
+ "image/x-jng": {
+ "source": "nginx",
+ "extensions": ["jng"]
+ },
+ "image/x-mrsid-image": {
+ "source": "apache",
+ "extensions": ["sid"]
+ },
+ "image/x-ms-bmp": {
+ "source": "nginx",
+ "compressible": true,
+ "extensions": ["bmp"]
+ },
+ "image/x-pcx": {
+ "source": "apache",
+ "extensions": ["pcx"]
+ },
+ "image/x-pict": {
+ "source": "apache",
+ "extensions": ["pic","pct"]
+ },
+ "image/x-portable-anymap": {
+ "source": "apache",
+ "extensions": ["pnm"]
+ },
+ "image/x-portable-bitmap": {
+ "source": "apache",
+ "extensions": ["pbm"]
+ },
+ "image/x-portable-graymap": {
+ "source": "apache",
+ "extensions": ["pgm"]
+ },
+ "image/x-portable-pixmap": {
+ "source": "apache",
+ "extensions": ["ppm"]
+ },
+ "image/x-rgb": {
+ "source": "apache",
+ "extensions": ["rgb"]
+ },
+ "image/x-tga": {
+ "source": "apache",
+ "extensions": ["tga"]
+ },
+ "image/x-xbitmap": {
+ "source": "apache",
+ "extensions": ["xbm"]
+ },
+ "image/x-xcf": {
+ "compressible": false
+ },
+ "image/x-xpixmap": {
+ "source": "apache",
+ "extensions": ["xpm"]
+ },
+ "image/x-xwindowdump": {
+ "source": "apache",
+ "extensions": ["xwd"]
+ },
+ "message/cpim": {
+ "source": "iana"
+ },
+ "message/delivery-status": {
+ "source": "iana"
+ },
+ "message/disposition-notification": {
+ "source": "iana"
+ },
+ "message/external-body": {
+ "source": "iana"
+ },
+ "message/feedback-report": {
+ "source": "iana"
+ },
+ "message/global": {
+ "source": "iana"
+ },
+ "message/global-delivery-status": {
+ "source": "iana"
+ },
+ "message/global-disposition-notification": {
+ "source": "iana"
+ },
+ "message/global-headers": {
+ "source": "iana"
+ },
+ "message/http": {
+ "source": "iana",
+ "compressible": false
+ },
+ "message/imdn+xml": {
+ "source": "iana",
+ "compressible": true
+ },
+ "message/news": {
+ "source": "iana"
+ },
+ "message/partial": {
+ "source": "iana",
+ "compressible": false
+ },
+ "message/rfc822": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["eml","mime"]
+ },
+ "message/s-http": {
+ "source": "iana"
+ },
+ "message/sip": {
+ "source": "iana"
+ },
+ "message/sipfrag": {
+ "source": "iana"
+ },
+ "message/tracking-status": {
+ "source": "iana"
+ },
+ "message/vnd.si.simp": {
+ "source": "iana"
+ },
+ "message/vnd.wfa.wsc": {
+ "source": "iana"
+ },
+ "model/iges": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["igs","iges"]
+ },
+ "model/mesh": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["msh","mesh","silo"]
+ },
+ "model/vnd.collada+xml": {
+ "source": "iana",
+ "extensions": ["dae"]
+ },
+ "model/vnd.dwf": {
+ "source": "iana",
+ "extensions": ["dwf"]
+ },
+ "model/vnd.flatland.3dml": {
+ "source": "iana"
+ },
+ "model/vnd.gdl": {
+ "source": "iana",
+ "extensions": ["gdl"]
+ },
+ "model/vnd.gs-gdl": {
+ "source": "apache"
+ },
+ "model/vnd.gs.gdl": {
+ "source": "iana"
+ },
+ "model/vnd.gtw": {
+ "source": "iana",
+ "extensions": ["gtw"]
+ },
+ "model/vnd.moml+xml": {
+ "source": "iana"
+ },
+ "model/vnd.mts": {
+ "source": "iana",
+ "extensions": ["mts"]
+ },
+ "model/vnd.opengex": {
+ "source": "iana"
+ },
+ "model/vnd.parasolid.transmit.binary": {
+ "source": "iana"
+ },
+ "model/vnd.parasolid.transmit.text": {
+ "source": "iana"
+ },
+ "model/vnd.valve.source.compiled-map": {
+ "source": "iana"
+ },
+ "model/vnd.vtu": {
+ "source": "iana",
+ "extensions": ["vtu"]
+ },
+ "model/vrml": {
+ "source": "iana",
+ "compressible": false,
+ "extensions": ["wrl","vrml"]
+ },
+ "model/x3d+binary": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["x3db","x3dbz"]
+ },
+ "model/x3d+fastinfoset": {
+ "source": "iana"
+ },
+ "model/x3d+vrml": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["x3dv","x3dvz"]
+ },
+ "model/x3d+xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["x3d","x3dz"]
+ },
+ "model/x3d-vrml": {
+ "source": "iana"
+ },
+ "multipart/alternative": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/appledouble": {
+ "source": "iana"
+ },
+ "multipart/byteranges": {
+ "source": "iana"
+ },
+ "multipart/digest": {
+ "source": "iana"
+ },
+ "multipart/encrypted": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/form-data": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/header-set": {
+ "source": "iana"
+ },
+ "multipart/mixed": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/parallel": {
+ "source": "iana"
+ },
+ "multipart/related": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/report": {
+ "source": "iana"
+ },
+ "multipart/signed": {
+ "source": "iana",
+ "compressible": false
+ },
+ "multipart/voice-message": {
+ "source": "iana"
+ },
+ "multipart/x-mixed-replace": {
+ "source": "iana"
+ },
+ "text/1d-interleaved-parityfec": {
+ "source": "iana"
+ },
+ "text/cache-manifest": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["appcache","manifest"]
+ },
+ "text/calendar": {
+ "source": "iana",
+ "extensions": ["ics","ifb"]
+ },
+ "text/calender": {
+ "compressible": true
+ },
+ "text/cmd": {
+ "compressible": true
+ },
+ "text/coffeescript": {
+ "extensions": ["coffee","litcoffee"]
+ },
+ "text/css": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["css"]
+ },
+ "text/csv": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["csv"]
+ },
+ "text/csv-schema": {
+ "source": "iana"
+ },
+ "text/directory": {
+ "source": "iana"
+ },
+ "text/dns": {
+ "source": "iana"
+ },
+ "text/ecmascript": {
+ "source": "iana"
+ },
+ "text/encaprtp": {
+ "source": "iana"
+ },
+ "text/enriched": {
+ "source": "iana"
+ },
+ "text/fwdred": {
+ "source": "iana"
+ },
+ "text/grammar-ref-list": {
+ "source": "iana"
+ },
+ "text/hjson": {
+ "extensions": ["hjson"]
+ },
+ "text/html": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["html","htm","shtml"]
+ },
+ "text/jade": {
+ "extensions": ["jade"]
+ },
+ "text/javascript": {
+ "source": "iana",
+ "compressible": true
+ },
+ "text/jcr-cnd": {
+ "source": "iana"
+ },
+ "text/jsx": {
+ "compressible": true,
+ "extensions": ["jsx"]
+ },
+ "text/less": {
+ "extensions": ["less"]
+ },
+ "text/markdown": {
+ "source": "iana"
+ },
+ "text/mathml": {
+ "source": "nginx",
+ "extensions": ["mml"]
+ },
+ "text/mizar": {
+ "source": "iana"
+ },
+ "text/n3": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["n3"]
+ },
+ "text/parameters": {
+ "source": "iana"
+ },
+ "text/parityfec": {
+ "source": "iana"
+ },
+ "text/plain": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["txt","text","conf","def","list","log","in","ini"]
+ },
+ "text/provenance-notation": {
+ "source": "iana"
+ },
+ "text/prs.fallenstein.rst": {
+ "source": "iana"
+ },
+ "text/prs.lines.tag": {
+ "source": "iana",
+ "extensions": ["dsc"]
+ },
+ "text/raptorfec": {
+ "source": "iana"
+ },
+ "text/red": {
+ "source": "iana"
+ },
+ "text/rfc822-headers": {
+ "source": "iana"
+ },
+ "text/richtext": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rtx"]
+ },
+ "text/rtf": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["rtf"]
+ },
+ "text/rtp-enc-aescm128": {
+ "source": "iana"
+ },
+ "text/rtploopback": {
+ "source": "iana"
+ },
+ "text/rtx": {
+ "source": "iana"
+ },
+ "text/sgml": {
+ "source": "iana",
+ "extensions": ["sgml","sgm"]
+ },
+ "text/stylus": {
+ "extensions": ["stylus","styl"]
+ },
+ "text/t140": {
+ "source": "iana"
+ },
+ "text/tab-separated-values": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["tsv"]
+ },
+ "text/troff": {
+ "source": "iana",
+ "extensions": ["t","tr","roff","man","me","ms"]
+ },
+ "text/turtle": {
+ "source": "iana",
+ "extensions": ["ttl"]
+ },
+ "text/ulpfec": {
+ "source": "iana"
+ },
+ "text/uri-list": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["uri","uris","urls"]
+ },
+ "text/vcard": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["vcard"]
+ },
+ "text/vnd.a": {
+ "source": "iana"
+ },
+ "text/vnd.abc": {
+ "source": "iana"
+ },
+ "text/vnd.curl": {
+ "source": "iana",
+ "extensions": ["curl"]
+ },
+ "text/vnd.curl.dcurl": {
+ "source": "apache",
+ "extensions": ["dcurl"]
+ },
+ "text/vnd.curl.mcurl": {
+ "source": "apache",
+ "extensions": ["mcurl"]
+ },
+ "text/vnd.curl.scurl": {
+ "source": "apache",
+ "extensions": ["scurl"]
+ },
+ "text/vnd.debian.copyright": {
+ "source": "iana"
+ },
+ "text/vnd.dmclientscript": {
+ "source": "iana"
+ },
+ "text/vnd.dvb.subtitle": {
+ "source": "iana",
+ "extensions": ["sub"]
+ },
+ "text/vnd.esmertec.theme-descriptor": {
+ "source": "iana"
+ },
+ "text/vnd.fly": {
+ "source": "iana",
+ "extensions": ["fly"]
+ },
+ "text/vnd.fmi.flexstor": {
+ "source": "iana",
+ "extensions": ["flx"]
+ },
+ "text/vnd.graphviz": {
+ "source": "iana",
+ "extensions": ["gv"]
+ },
+ "text/vnd.in3d.3dml": {
+ "source": "iana",
+ "extensions": ["3dml"]
+ },
+ "text/vnd.in3d.spot": {
+ "source": "iana",
+ "extensions": ["spot"]
+ },
+ "text/vnd.iptc.newsml": {
+ "source": "iana"
+ },
+ "text/vnd.iptc.nitf": {
+ "source": "iana"
+ },
+ "text/vnd.latex-z": {
+ "source": "iana"
+ },
+ "text/vnd.motorola.reflex": {
+ "source": "iana"
+ },
+ "text/vnd.ms-mediapackage": {
+ "source": "iana"
+ },
+ "text/vnd.net2phone.commcenter.command": {
+ "source": "iana"
+ },
+ "text/vnd.radisys.msml-basic-layout": {
+ "source": "iana"
+ },
+ "text/vnd.si.uricatalogue": {
+ "source": "iana"
+ },
+ "text/vnd.sun.j2me.app-descriptor": {
+ "source": "iana",
+ "extensions": ["jad"]
+ },
+ "text/vnd.trolltech.linguist": {
+ "source": "iana"
+ },
+ "text/vnd.wap.si": {
+ "source": "iana"
+ },
+ "text/vnd.wap.sl": {
+ "source": "iana"
+ },
+ "text/vnd.wap.wml": {
+ "source": "iana",
+ "extensions": ["wml"]
+ },
+ "text/vnd.wap.wmlscript": {
+ "source": "iana",
+ "extensions": ["wmls"]
+ },
+ "text/vtt": {
+ "charset": "UTF-8",
+ "compressible": true,
+ "extensions": ["vtt"]
+ },
+ "text/x-asm": {
+ "source": "apache",
+ "extensions": ["s","asm"]
+ },
+ "text/x-c": {
+ "source": "apache",
+ "extensions": ["c","cc","cxx","cpp","h","hh","dic"]
+ },
+ "text/x-component": {
+ "source": "nginx",
+ "extensions": ["htc"]
+ },
+ "text/x-fortran": {
+ "source": "apache",
+ "extensions": ["f","for","f77","f90"]
+ },
+ "text/x-gwt-rpc": {
+ "compressible": true
+ },
+ "text/x-handlebars-template": {
+ "extensions": ["hbs"]
+ },
+ "text/x-java-source": {
+ "source": "apache",
+ "extensions": ["java"]
+ },
+ "text/x-jquery-tmpl": {
+ "compressible": true
+ },
+ "text/x-lua": {
+ "extensions": ["lua"]
+ },
+ "text/x-markdown": {
+ "compressible": true,
+ "extensions": ["markdown","md","mkd"]
+ },
+ "text/x-nfo": {
+ "source": "apache",
+ "extensions": ["nfo"]
+ },
+ "text/x-opml": {
+ "source": "apache",
+ "extensions": ["opml"]
+ },
+ "text/x-pascal": {
+ "source": "apache",
+ "extensions": ["p","pas"]
+ },
+ "text/x-processing": {
+ "compressible": true,
+ "extensions": ["pde"]
+ },
+ "text/x-sass": {
+ "extensions": ["sass"]
+ },
+ "text/x-scss": {
+ "extensions": ["scss"]
+ },
+ "text/x-setext": {
+ "source": "apache",
+ "extensions": ["etx"]
+ },
+ "text/x-sfv": {
+ "source": "apache",
+ "extensions": ["sfv"]
+ },
+ "text/x-uuencode": {
+ "source": "apache",
+ "extensions": ["uu"]
+ },
+ "text/x-vcalendar": {
+ "source": "apache",
+ "extensions": ["vcs"]
+ },
+ "text/x-vcard": {
+ "source": "apache",
+ "extensions": ["vcf"]
+ },
+ "text/xml": {
+ "source": "iana",
+ "compressible": true,
+ "extensions": ["xml"]
+ },
+ "text/xml-external-parsed-entity": {
+ "source": "iana"
+ },
+ "text/yaml": {
+ "extensions": ["yaml","yml"]
+ },
+ "video/1d-interleaved-parityfec": {
+ "source": "apache"
+ },
+ "video/3gpp": {
+ "source": "apache",
+ "extensions": ["3gp","3gpp"]
+ },
+ "video/3gpp-tt": {
+ "source": "apache"
+ },
+ "video/3gpp2": {
+ "source": "apache",
+ "extensions": ["3g2"]
+ },
+ "video/bmpeg": {
+ "source": "apache"
+ },
+ "video/bt656": {
+ "source": "apache"
+ },
+ "video/celb": {
+ "source": "apache"
+ },
+ "video/dv": {
+ "source": "apache"
+ },
+ "video/h261": {
+ "source": "apache",
+ "extensions": ["h261"]
+ },
+ "video/h263": {
+ "source": "apache",
+ "extensions": ["h263"]
+ },
+ "video/h263-1998": {
+ "source": "apache"
+ },
+ "video/h263-2000": {
+ "source": "apache"
+ },
+ "video/h264": {
+ "source": "apache",
+ "extensions": ["h264"]
+ },
+ "video/h264-rcdo": {
+ "source": "apache"
+ },
+ "video/h264-svc": {
+ "source": "apache"
+ },
+ "video/jpeg": {
+ "source": "apache",
+ "extensions": ["jpgv"]
+ },
+ "video/jpeg2000": {
+ "source": "apache"
+ },
+ "video/jpm": {
+ "source": "apache",
+ "extensions": ["jpm","jpgm"]
+ },
+ "video/mj2": {
+ "source": "apache",
+ "extensions": ["mj2","mjp2"]
+ },
+ "video/mp1s": {
+ "source": "apache"
+ },
+ "video/mp2p": {
+ "source": "apache"
+ },
+ "video/mp2t": {
+ "source": "apache",
+ "extensions": ["ts"]
+ },
+ "video/mp4": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["mp4","mp4v","mpg4"]
+ },
+ "video/mp4v-es": {
+ "source": "apache"
+ },
+ "video/mpeg": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["mpeg","mpg","mpe","m1v","m2v"]
+ },
+ "video/mpeg4-generic": {
+ "source": "apache"
+ },
+ "video/mpv": {
+ "source": "apache"
+ },
+ "video/nv": {
+ "source": "apache"
+ },
+ "video/ogg": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["ogv"]
+ },
+ "video/parityfec": {
+ "source": "apache"
+ },
+ "video/pointer": {
+ "source": "apache"
+ },
+ "video/quicktime": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["qt","mov"]
+ },
+ "video/raw": {
+ "source": "apache"
+ },
+ "video/rtp-enc-aescm128": {
+ "source": "apache"
+ },
+ "video/rtx": {
+ "source": "apache"
+ },
+ "video/smpte292m": {
+ "source": "apache"
+ },
+ "video/ulpfec": {
+ "source": "apache"
+ },
+ "video/vc1": {
+ "source": "apache"
+ },
+ "video/vnd.cctv": {
+ "source": "apache"
+ },
+ "video/vnd.dece.hd": {
+ "source": "apache",
+ "extensions": ["uvh","uvvh"]
+ },
+ "video/vnd.dece.mobile": {
+ "source": "apache",
+ "extensions": ["uvm","uvvm"]
+ },
+ "video/vnd.dece.mp4": {
+ "source": "apache"
+ },
+ "video/vnd.dece.pd": {
+ "source": "apache",
+ "extensions": ["uvp","uvvp"]
+ },
+ "video/vnd.dece.sd": {
+ "source": "apache",
+ "extensions": ["uvs","uvvs"]
+ },
+ "video/vnd.dece.video": {
+ "source": "apache",
+ "extensions": ["uvv","uvvv"]
+ },
+ "video/vnd.directv.mpeg": {
+ "source": "apache"
+ },
+ "video/vnd.directv.mpeg-tts": {
+ "source": "apache"
+ },
+ "video/vnd.dlna.mpeg-tts": {
+ "source": "apache"
+ },
+ "video/vnd.dvb.file": {
+ "source": "apache",
+ "extensions": ["dvb"]
+ },
+ "video/vnd.fvt": {
+ "source": "apache",
+ "extensions": ["fvt"]
+ },
+ "video/vnd.hns.video": {
+ "source": "apache"
+ },
+ "video/vnd.iptvforum.1dparityfec-1010": {
+ "source": "apache"
+ },
+ "video/vnd.iptvforum.1dparityfec-2005": {
+ "source": "apache"
+ },
+ "video/vnd.iptvforum.2dparityfec-1010": {
+ "source": "apache"
+ },
+ "video/vnd.iptvforum.2dparityfec-2005": {
+ "source": "apache"
+ },
+ "video/vnd.iptvforum.ttsavc": {
+ "source": "apache"
+ },
+ "video/vnd.iptvforum.ttsmpeg2": {
+ "source": "apache"
+ },
+ "video/vnd.motorola.video": {
+ "source": "apache"
+ },
+ "video/vnd.motorola.videop": {
+ "source": "apache"
+ },
+ "video/vnd.mpegurl": {
+ "source": "apache",
+ "extensions": ["mxu","m4u"]
+ },
+ "video/vnd.ms-playready.media.pyv": {
+ "source": "apache",
+ "extensions": ["pyv"]
+ },
+ "video/vnd.nokia.interleaved-multimedia": {
+ "source": "apache"
+ },
+ "video/vnd.nokia.videovoip": {
+ "source": "apache"
+ },
+ "video/vnd.objectvideo": {
+ "source": "apache"
+ },
+ "video/vnd.sealed.mpeg1": {
+ "source": "apache"
+ },
+ "video/vnd.sealed.mpeg4": {
+ "source": "apache"
+ },
+ "video/vnd.sealed.swf": {
+ "source": "apache"
+ },
+ "video/vnd.sealedmedia.softseal.mov": {
+ "source": "apache"
+ },
+ "video/vnd.uvvu.mp4": {
+ "source": "apache",
+ "extensions": ["uvu","uvvu"]
+ },
+ "video/vnd.vivo": {
+ "source": "apache",
+ "extensions": ["viv"]
+ },
+ "video/webm": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["webm"]
+ },
+ "video/x-f4v": {
+ "source": "apache",
+ "extensions": ["f4v"]
+ },
+ "video/x-fli": {
+ "source": "apache",
+ "extensions": ["fli"]
+ },
+ "video/x-flv": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["flv"]
+ },
+ "video/x-m4v": {
+ "source": "apache",
+ "extensions": ["m4v"]
+ },
+ "video/x-matroska": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["mkv","mk3d","mks"]
+ },
+ "video/x-mng": {
+ "source": "apache",
+ "extensions": ["mng"]
+ },
+ "video/x-ms-asf": {
+ "source": "apache",
+ "extensions": ["asf","asx"]
+ },
+ "video/x-ms-vob": {
+ "source": "apache",
+ "extensions": ["vob"]
+ },
+ "video/x-ms-wm": {
+ "source": "apache",
+ "extensions": ["wm"]
+ },
+ "video/x-ms-wmv": {
+ "source": "apache",
+ "compressible": false,
+ "extensions": ["wmv"]
+ },
+ "video/x-ms-wmx": {
+ "source": "apache",
+ "extensions": ["wmx"]
+ },
+ "video/x-ms-wvx": {
+ "source": "apache",
+ "extensions": ["wvx"]
+ },
+ "video/x-msvideo": {
+ "source": "apache",
+ "extensions": ["avi"]
+ },
+ "video/x-sgi-movie": {
+ "source": "apache",
+ "extensions": ["movie"]
+ },
+ "video/x-smv": {
+ "source": "apache",
+ "extensions": ["smv"]
+ },
+ "x-conference/x-cooltalk": {
+ "source": "apache",
+ "extensions": ["ice"]
+ },
+ "x-shader/x-fragment": {
+ "compressible": true
+ },
+ "x-shader/x-vertex": {
+ "compressible": true
+ }
+}
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/index.js b/node_modules/request/node_modules/mime-types/node_modules/mime-db/index.js
new file mode 100644
index 000000000..551031f69
--- /dev/null
+++ b/node_modules/request/node_modules/mime-types/node_modules/mime-db/index.js
@@ -0,0 +1,11 @@
+/*!
+ * mime-db
+ * Copyright(c) 2014 Jonathan Ong
+ * MIT Licensed
+ */
+
+/**
+ * Module exports.
+ */
+
+module.exports = require('./db.json')
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json b/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
new file mode 100644
index 000000000..573cfa53e
--- /dev/null
+++ b/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
@@ -0,0 +1,74 @@
+{
+ "name": "mime-db",
+ "description": "Media Type Database",
+ "version": "1.19.0",
+ "contributors": [
+ {
+ "name": "Douglas Christopher Wilson",
+ "email": "doug@somethingdoug.com"
+ },
+ {
+ "name": "Jonathan Ong",
+ "email": "me@jongleberry.com",
+ "url": "http://jongleberry.com"
+ },
+ {
+ "name": "Robert Kieffer",
+ "email": "robert@broofa.com",
+ "url": "http://github.com/broofa"
+ }
+ ],
+ "license": "MIT",
+ "keywords": [
+ "mime",
+ "db",
+ "type",
+ "types",
+ "database",
+ "charset",
+ "charsets"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jshttp/mime-db.git"
+ },
+ "devDependencies": {
+ "bluebird": "2.10.0",
+ "co": "4.6.0",
+ "cogent": "1.0.1",
+ "csv-parse": "1.0.0",
+ "gnode": "0.1.1",
+ "istanbul": "0.3.20",
+ "mocha": "1.21.5",
+ "raw-body": "2.1.3",
+ "stream-to-array": "2"
+ },
+ "files": [
+ "HISTORY.md",
+ "LICENSE",
+ "README.md",
+ "db.json",
+ "index.js"
+ ],
+ "engines": {
+ "node": ">= 0.6"
+ },
+ "scripts": {
+ "build": "node scripts/build",
+ "fetch": "gnode scripts/fetch-apache && gnode scripts/fetch-iana && gnode scripts/fetch-nginx",
+ "test": "mocha --reporter spec --bail --check-leaks test/",
+ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
+ "update": "npm run fetch && npm run build"
+ },
+ "readme": "# mime-db\n\n[![NPM Version][npm-version-image]][npm-url]\n[![NPM Downloads][npm-downloads-image]][npm-url]\n[![Node.js Version][node-image]][node-url]\n[![Build Status][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n\nThis is a database of all mime types.\nIt consists of a single, public JSON file and does not include any logic,\nallowing it to remain as un-opinionated as possible with an API.\nIt aggregates data from the following sources:\n\n- http://www.iana.org/assignments/media-types/media-types.xhtml\n- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types\n- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types\n\n## Installation\n\n```bash\nnpm install mime-db\n```\n\n### Database Download\n\nIf you're crazy enough to use this in the browser, you can just grab the\nJSON file using [RawGit](https://rawgit.com/). It is recommended to replace\n`master` with [a release tag](https://github.com/jshttp/mime-db/tags) as the\nJSON format may change in the future.\n\n```\nhttps://cdn.rawgit.com/jshttp/mime-db/master/db.json\n```\n\n## Usage\n\n```js\nvar db = require('mime-db');\n\n// grab data on .js files\nvar data = db['application/javascript'];\n```\n\n## Data Structure\n\nThe JSON file is a map lookup for lowercased mime types.\nEach mime type has the following properties:\n\n- `.source` - where the mime type is defined.\n If not set, it's probably a custom media type.\n - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)\n - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml)\n - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types)\n- `.extensions[]` - known extensions associated with this mime type.\n- `.compressible` - whether a file of this type is can be gzipped.\n- `.charset` - the default charset associated with this type, if any.\n\nIf unknown, every property could be `undefined`.\n\n## Contributing\n\nTo edit the database, only make PRs against `src/custom.json` or\n`src/custom-suffix.json`.\n\nTo update the build, run `npm run build`.\n\n## Adding Custom Media Types\n\nThe best way to get new media types included in this library is to register\nthem with the IANA. The community registration procedure is outlined in\n[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types\nregistered with the IANA are automatically pulled into this library.\n\n[npm-version-image]: https://img.shields.io/npm/v/mime-db.svg\n[npm-downloads-image]: https://img.shields.io/npm/dm/mime-db.svg\n[npm-url]: https://npmjs.org/package/mime-db\n[travis-image]: https://img.shields.io/travis/jshttp/mime-db/master.svg\n[travis-url]: https://travis-ci.org/jshttp/mime-db\n[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-db/master.svg\n[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master\n[node-image]: https://img.shields.io/node/v/mime-db.svg\n[node-url]: http://nodejs.org/download/\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/jshttp/mime-db/issues"
+ },
+ "homepage": "https://github.com/jshttp/mime-db#readme",
+ "_id": "mime-db@1.19.0",
+ "_shasum": "496a18198a7ce8244534e25bb102b74fb420fd56",
+ "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.19.0.tgz",
+ "_from": "mime-db@>=1.19.0 <1.20.0"
+}
diff --git a/node_modules/request/node_modules/mime-types/package.json b/node_modules/request/node_modules/mime-types/package.json
new file mode 100644
index 000000000..3292c714c
--- /dev/null
+++ b/node_modules/request/node_modules/mime-types/package.json
@@ -0,0 +1,60 @@
+{
+ "name": "mime-types",
+ "description": "The ultimate javascript content-type utility.",
+ "version": "2.1.7",
+ "contributors": [
+ {
+ "name": "Douglas Christopher Wilson",
+ "email": "doug@somethingdoug.com"
+ },
+ {
+ "name": "Jeremiah Senkpiel",
+ "email": "fishrock123@rocketmail.com",
+ "url": "https://searchbeam.jit.su"
+ },
+ {
+ "name": "Jonathan Ong",
+ "email": "me@jongleberry.com",
+ "url": "http://jongleberry.com"
+ }
+ ],
+ "license": "MIT",
+ "keywords": [
+ "mime",
+ "types"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jshttp/mime-types.git"
+ },
+ "dependencies": {
+ "mime-db": "~1.19.0"
+ },
+ "devDependencies": {
+ "istanbul": "0.3.20",
+ "mocha": "~1.21.5"
+ },
+ "files": [
+ "HISTORY.md",
+ "LICENSE",
+ "index.js"
+ ],
+ "engines": {
+ "node": ">= 0.6"
+ },
+ "scripts": {
+ "test": "mocha --reporter spec test/test.js",
+ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js",
+ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js"
+ },
+ "readme": "# mime-types\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Node.js Version][node-version-image]][node-version-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nThe ultimate javascript content-type utility.\n\nSimilar to [node-mime](https://github.com/broofa/node-mime), except:\n\n- __No fallbacks.__ Instead of naively returning the first available type, `mime-types` simply returns `false`,\n so do `var type = mime.lookup('unrecognized') || 'application/octet-stream'`.\n- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.\n- Additional mime types are added such as jade and stylus via [mime-db](https://github.com/jshttp/mime-db)\n- No `.define()` functionality\n\nOtherwise, the API is compatible.\n\n## Install\n\n```sh\n$ npm install mime-types\n```\n\n## Adding Types\n\nAll mime types are based on [mime-db](https://github.com/jshttp/mime-db),\nso open a PR there if you'd like to add mime types.\n\n## API\n\n```js\nvar mime = require('mime-types')\n```\n\nAll functions return `false` if input is invalid or not found.\n\n### mime.lookup(path)\n\nLookup the content-type associated with a file.\n\n```js\nmime.lookup('json') // 'application/json'\nmime.lookup('.md') // 'text/x-markdown'\nmime.lookup('file.html') // 'text/html'\nmime.lookup('folder/file.js') // 'application/javascript'\nmime.lookup('folder/.htaccess') // false\n\nmime.lookup('cats') // false\n```\n\n### mime.contentType(type)\n\nCreate a full content-type header given a content-type or extension.\n\n```js\nmime.contentType('markdown') // 'text/x-markdown; charset=utf-8'\nmime.contentType('file.json') // 'application/json; charset=utf-8'\n\n// from a full path\nmime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'\n```\n\n### mime.extension(type)\n\nGet the default extension for a content-type.\n\n```js\nmime.extension('application/octet-stream') // 'bin'\n```\n\n### mime.charset(type)\n\nLookup the implied default charset of a content-type.\n\n```js\nmime.charset('text/x-markdown') // 'UTF-8'\n```\n\n### var type = mime.types[extension]\n\nA map of content-types by extension.\n\n### [extensions...] = mime.extensions[type]\n\nA map of extensions by content-type.\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/mime-types.svg\n[npm-url]: https://npmjs.org/package/mime-types\n[node-version-image]: https://img.shields.io/node/v/mime-types.svg\n[node-version-url]: http://nodejs.org/download/\n[travis-image]: https://img.shields.io/travis/jshttp/mime-types/master.svg\n[travis-url]: https://travis-ci.org/jshttp/mime-types\n[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types/master.svg\n[coveralls-url]: https://coveralls.io/r/jshttp/mime-types\n[downloads-image]: https://img.shields.io/npm/dm/mime-types.svg\n[downloads-url]: https://npmjs.org/package/mime-types\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/jshttp/mime-types/issues"
+ },
+ "homepage": "https://github.com/jshttp/mime-types#readme",
+ "_id": "mime-types@2.1.7",
+ "_shasum": "ff603970e3c731ef6f7f4df3c9a0f463a13c2755",
+ "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.7.tgz",
+ "_from": "mime-types@>=2.1.7 <2.2.0"
+}
diff --git a/node_modules/request/node_modules/node-uuid/.npmignore b/node_modules/request/node_modules/node-uuid/.npmignore
new file mode 100644
index 000000000..fd4f2b066
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/.npmignore
@@ -0,0 +1,2 @@
+node_modules
+.DS_Store
diff --git a/node_modules/request/node_modules/node-uuid/LICENSE.md b/node_modules/request/node_modules/node-uuid/LICENSE.md
new file mode 100644
index 000000000..652609b37
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/LICENSE.md
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2010-2012 Robert Kieffer
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/request/node_modules/node-uuid/README.md b/node_modules/request/node_modules/node-uuid/README.md
new file mode 100644
index 000000000..b7d04c940
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/README.md
@@ -0,0 +1,243 @@
+# node-uuid
+
+Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.
+
+Features:
+
+* Generate RFC4122 version 1 or version 4 UUIDs
+* Runs in node.js and all browsers.
+* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').
+* Cryptographically strong random # generation on supporting platforms
+* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! )
+* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)
+* Comes with a Command Line Interface for generating uuids on the command line
+
+## Getting Started
+
+Install it in your browser:
+
+```html
+<script src="uuid.js"></script>
+```
+
+Or in node.js:
+
+```
+npm install node-uuid
+```
+
+```javascript
+var uuid = require('node-uuid');
+```
+
+Then create some ids ...
+
+```javascript
+// Generate a v1 (time-based) id
+uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'
+
+// Generate a v4 (random) id
+uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'
+```
+
+## API
+
+### uuid.v1([`options` [, `buffer` [, `offset`]]])
+
+Generate and return a RFC4122 v1 (timestamp-based) UUID.
+
+* `options` - (Object) Optional uuid state to apply. Properties may include:
+
+ * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.
+ * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.
+ * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.
+ * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.
+
+* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
+* `offset` - (Number) Starting index in `buffer` at which to begin writing.
+
+Returns `buffer`, if specified, otherwise the string form of the UUID
+
+Notes:
+
+1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)
+
+Example: Generate string UUID with fully-specified options
+
+```javascript
+uuid.v1({
+ node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
+ clockseq: 0x1234,
+ msecs: new Date('2011-11-01').getTime(),
+ nsecs: 5678
+}); // -> "710b962e-041c-11e1-9234-0123456789ab"
+```
+
+Example: In-place generation of two binary IDs
+
+```javascript
+// Generate two ids in an array
+var arr = new Array(32); // -> []
+uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]
+uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]
+
+// Optionally use uuid.unparse() to get stringify the ids
+uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'
+uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'
+```
+
+### uuid.v4([`options` [, `buffer` [, `offset`]]])
+
+Generate and return a RFC4122 v4 UUID.
+
+* `options` - (Object) Optional uuid state to apply. Properties may include:
+
+ * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values
+ * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.
+
+* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
+* `offset` - (Number) Starting index in `buffer` at which to begin writing.
+
+Returns `buffer`, if specified, otherwise the string form of the UUID
+
+Example: Generate string UUID with fully-specified options
+
+```javascript
+uuid.v4({
+ random: [
+ 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,
+ 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36
+ ]
+});
+// -> "109156be-c4fb-41ea-b1b4-efe1671c5836"
+```
+
+Example: Generate two IDs in a single buffer
+
+```javascript
+var buffer = new Array(32); // (or 'new Buffer' in node.js)
+uuid.v4(null, buffer, 0);
+uuid.v4(null, buffer, 16);
+```
+
+### uuid.parse(id[, buffer[, offset]])
+### uuid.unparse(buffer[, offset])
+
+Parse and unparse UUIDs
+
+ * `id` - (String) UUID(-like) string
+ * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used
+ * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0
+
+Example parsing and unparsing a UUID string
+
+```javascript
+var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> <Buffer 79 7f f0 43 11 eb 11 e1 80 d6 51 09 98 75 5d 10>
+var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'
+```
+
+### uuid.noConflict()
+
+(Browsers only) Set `uuid` property back to it's previous value.
+
+Returns the node-uuid object.
+
+Example:
+
+```javascript
+var myUuid = uuid.noConflict();
+myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'
+```
+
+## Deprecated APIs
+
+Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.
+
+### uuid([format [, buffer [, offset]]])
+
+uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).
+
+### uuid.BufferClass
+
+The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.
+
+## Command Line Interface
+
+To use the executable, it's probably best to install this library globally.
+
+`npm install -g node-uuid`
+
+Usage:
+
+```
+USAGE: uuid [version] [options]
+
+
+options:
+
+--help Display this message and exit
+```
+
+`version` must be an RFC4122 version that is supported by this library, which is currently version 1 and version 4 (denoted by "v1" and "v4", respectively). `version` defaults to version 4 when not supplied.
+
+### Examples
+
+```
+> uuid
+3a91f950-dec8-4688-ba14-5b7bbfc7a563
+```
+
+```
+> uuid v1
+9d0b43e0-7696-11e3-964b-250efa37a98e
+```
+
+```
+> uuid v4
+6790ac7c-24ac-4f98-8464-42f6d98a53ae
+```
+
+## Testing
+
+In node.js
+
+```
+npm test
+```
+
+In Browser
+
+```
+open test/test.html
+```
+
+### Benchmarking
+
+Requires node.js
+
+```
+npm install uuid uuid-js
+node benchmark/benchmark.js
+```
+
+For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)
+
+For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).
+
+## Release notes
+
+### 1.4.0
+
+* Improved module context detection
+* Removed public RNG functions
+
+### 1.3.2
+
+* Improve tests and handling of v1() options (Issue #24)
+* Expose RNG option to allow for perf testing with different generators
+
+### 1.3.0
+
+* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!
+* Support for node.js crypto API
+* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code
diff --git a/node_modules/request/node_modules/node-uuid/benchmark/README.md b/node_modules/request/node_modules/node-uuid/benchmark/README.md
new file mode 100644
index 000000000..aaeb2ea01
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/benchmark/README.md
@@ -0,0 +1,53 @@
+# node-uuid Benchmarks
+
+### Results
+
+To see the results of our benchmarks visit https://github.com/broofa/node-uuid/wiki/Benchmark
+
+### Run them yourself
+
+node-uuid comes with some benchmarks to measure performance of generating UUIDs. These can be run using node.js. node-uuid is being benchmarked against some other uuid modules, that are available through npm namely `uuid` and `uuid-js`.
+
+To prepare and run the benchmark issue;
+
+```
+npm install uuid uuid-js
+node benchmark/benchmark.js
+```
+
+You'll see an output like this one:
+
+```
+# v4
+nodeuuid.v4(): 854700 uuids/second
+nodeuuid.v4('binary'): 788643 uuids/second
+nodeuuid.v4('binary', buffer): 1336898 uuids/second
+uuid(): 479386 uuids/second
+uuid('binary'): 582072 uuids/second
+uuidjs.create(4): 312304 uuids/second
+
+# v1
+nodeuuid.v1(): 938086 uuids/second
+nodeuuid.v1('binary'): 683060 uuids/second
+nodeuuid.v1('binary', buffer): 1644736 uuids/second
+uuidjs.create(1): 190621 uuids/second
+```
+
+* The `uuid()` entries are for Nikhil Marathe's [uuid module](https://bitbucket.org/nikhilm/uuidjs) which is a wrapper around the native libuuid library.
+* The `uuidjs()` entries are for Patrick Negri's [uuid-js module](https://github.com/pnegri/uuid-js) which is a pure javascript implementation based on [UUID.js](https://github.com/LiosK/UUID.js) by LiosK.
+
+If you want to get more reliable results you can run the benchmark multiple times and write the output into a log file:
+
+```
+for i in {0..9}; do node benchmark/benchmark.js >> benchmark/bench_0.4.12.log; done;
+```
+
+If you're interested in how performance varies between different node versions, you can issue the above command multiple times.
+
+You can then use the shell script `bench.sh` provided in this directory to calculate the averages over all benchmark runs and draw a nice plot:
+
+```
+(cd benchmark/ && ./bench.sh)
+```
+
+This assumes you have [gnuplot](http://www.gnuplot.info/) and [ImageMagick](http://www.imagemagick.org/) installed. You'll find a nice `bench.png` graph in the `benchmark/` directory then.
diff --git a/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu b/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu
new file mode 100644
index 000000000..a342fbbe0
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu
@@ -0,0 +1,174 @@
+#!/opt/local/bin/gnuplot -persist
+#
+#
+# G N U P L O T
+# Version 4.4 patchlevel 3
+# last modified March 2011
+# System: Darwin 10.8.0
+#
+# Copyright (C) 1986-1993, 1998, 2004, 2007-2010
+# Thomas Williams, Colin Kelley and many others
+#
+# gnuplot home: http://www.gnuplot.info
+# faq, bugs, etc: type "help seeking-assistance"
+# immediate help: type "help"
+# plot window: hit 'h'
+set terminal postscript eps noenhanced defaultplex \
+ leveldefault color colortext \
+ solid linewidth 1.2 butt noclip \
+ palfuncparam 2000,0.003 \
+ "Helvetica" 14
+set output 'bench.eps'
+unset clip points
+set clip one
+unset clip two
+set bar 1.000000 front
+set border 31 front linetype -1 linewidth 1.000
+set xdata
+set ydata
+set zdata
+set x2data
+set y2data
+set timefmt x "%d/%m/%y,%H:%M"
+set timefmt y "%d/%m/%y,%H:%M"
+set timefmt z "%d/%m/%y,%H:%M"
+set timefmt x2 "%d/%m/%y,%H:%M"
+set timefmt y2 "%d/%m/%y,%H:%M"
+set timefmt cb "%d/%m/%y,%H:%M"
+set boxwidth
+set style fill empty border
+set style rectangle back fc lt -3 fillstyle solid 1.00 border lt -1
+set style circle radius graph 0.02, first 0, 0
+set dummy x,y
+set format x "% g"
+set format y "% g"
+set format x2 "% g"
+set format y2 "% g"
+set format z "% g"
+set format cb "% g"
+set angles radians
+unset grid
+set key title ""
+set key outside left top horizontal Right noreverse enhanced autotitles columnhead nobox
+set key noinvert samplen 4 spacing 1 width 0 height 0
+set key maxcolumns 2 maxrows 0
+unset label
+unset arrow
+set style increment default
+unset style line
+set style line 1 linetype 1 linewidth 2.000 pointtype 1 pointsize default pointinterval 0
+unset style arrow
+set style histogram clustered gap 2 title offset character 0, 0, 0
+unset logscale
+set offsets graph 0.05, 0.15, 0, 0
+set pointsize 1.5
+set pointintervalbox 1
+set encoding default
+unset polar
+unset parametric
+unset decimalsign
+set view 60, 30, 1, 1
+set samples 100, 100
+set isosamples 10, 10
+set surface
+unset contour
+set clabel '%8.3g'
+set mapping cartesian
+set datafile separator whitespace
+unset hidden3d
+set cntrparam order 4
+set cntrparam linear
+set cntrparam levels auto 5
+set cntrparam points 5
+set size ratio 0 1,1
+set origin 0,0
+set style data points
+set style function lines
+set xzeroaxis linetype -2 linewidth 1.000
+set yzeroaxis linetype -2 linewidth 1.000
+set zzeroaxis linetype -2 linewidth 1.000
+set x2zeroaxis linetype -2 linewidth 1.000
+set y2zeroaxis linetype -2 linewidth 1.000
+set ticslevel 0.5
+set mxtics default
+set mytics default
+set mztics default
+set mx2tics default
+set my2tics default
+set mcbtics default
+set xtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0
+set xtics norangelimit
+set xtics ()
+set ytics border in scale 1,0.5 mirror norotate offset character 0, 0, 0
+set ytics autofreq norangelimit
+set ztics border in scale 1,0.5 nomirror norotate offset character 0, 0, 0
+set ztics autofreq norangelimit
+set nox2tics
+set noy2tics
+set cbtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0
+set cbtics autofreq norangelimit
+set title ""
+set title offset character 0, 0, 0 font "" norotate
+set timestamp bottom
+set timestamp ""
+set timestamp offset character 0, 0, 0 font "" norotate
+set rrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] )
+set autoscale rfixmin
+set autoscale rfixmax
+set trange [ * : * ] noreverse nowriteback # (currently [-5.00000:5.00000] )
+set autoscale tfixmin
+set autoscale tfixmax
+set urange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] )
+set autoscale ufixmin
+set autoscale ufixmax
+set vrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] )
+set autoscale vfixmin
+set autoscale vfixmax
+set xlabel ""
+set xlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate
+set x2label ""
+set x2label offset character 0, 0, 0 font "" textcolor lt -1 norotate
+set xrange [ * : * ] noreverse nowriteback # (currently [-0.150000:3.15000] )
+set autoscale xfixmin
+set autoscale xfixmax
+set x2range [ * : * ] noreverse nowriteback # (currently [0.00000:3.00000] )
+set autoscale x2fixmin
+set autoscale x2fixmax
+set ylabel ""
+set ylabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270
+set y2label ""
+set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270
+set yrange [ 0.00000 : 1.90000e+06 ] noreverse nowriteback # (currently [:] )
+set autoscale yfixmin
+set autoscale yfixmax
+set y2range [ * : * ] noreverse nowriteback # (currently [0.00000:1.90000e+06] )
+set autoscale y2fixmin
+set autoscale y2fixmax
+set zlabel ""
+set zlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate
+set zrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] )
+set autoscale zfixmin
+set autoscale zfixmax
+set cblabel ""
+set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270
+set cbrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] )
+set autoscale cbfixmin
+set autoscale cbfixmax
+set zero 1e-08
+set lmargin -1
+set bmargin -1
+set rmargin -1
+set tmargin -1
+set pm3d explicit at s
+set pm3d scansautomatic
+set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean
+set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB
+set palette rgbformulae 7, 5, 15
+set colorbox default
+set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front bdefault
+set loadpath
+set fontpath
+set fit noerrorvariables
+GNUTERM = "aqua"
+plot 'bench_results.txt' using 2:xticlabel(1) w lp lw 2, '' using 3:xticlabel(1) w lp lw 2, '' using 4:xticlabel(1) w lp lw 2, '' using 5:xticlabel(1) w lp lw 2, '' using 6:xticlabel(1) w lp lw 2, '' using 7:xticlabel(1) w lp lw 2, '' using 8:xticlabel(1) w lp lw 2, '' using 9:xticlabel(1) w lp lw 2
+# EOF
diff --git a/node_modules/request/node_modules/node-uuid/benchmark/bench.sh b/node_modules/request/node_modules/node-uuid/benchmark/bench.sh
new file mode 100755
index 000000000..d870a0cb0
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/benchmark/bench.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# for a given node version run:
+# for i in {0..9}; do node benchmark.js >> bench_0.6.2.log; done;
+
+PATTERNS=('nodeuuid.v1()' "nodeuuid.v1('binary'," 'nodeuuid.v4()' "nodeuuid.v4('binary'," "uuid()" "uuid('binary')" 'uuidjs.create(1)' 'uuidjs.create(4)' '140byte')
+FILES=(node_uuid_v1_string node_uuid_v1_buf node_uuid_v4_string node_uuid_v4_buf libuuid_v4_string libuuid_v4_binary uuidjs_v1_string uuidjs_v4_string 140byte_es)
+INDICES=(2 3 2 3 2 2 2 2 2)
+VERSIONS=$( ls bench_*.log | sed -e 's/^bench_\([0-9\.]*\)\.log/\1/' | tr "\\n" " " )
+TMPJOIN="tmp_join"
+OUTPUT="bench_results.txt"
+
+for I in ${!FILES[*]}; do
+ F=${FILES[$I]}
+ P=${PATTERNS[$I]}
+ INDEX=${INDICES[$I]}
+ echo "version $F" > $F
+ for V in $VERSIONS; do
+ (VAL=$( grep "$P" bench_$V.log | LC_ALL=en_US awk '{ sum += $'$INDEX' } END { print sum/NR }' ); echo $V $VAL) >> $F
+ done
+ if [ $I == 0 ]; then
+ cat $F > $TMPJOIN
+ else
+ join $TMPJOIN $F > $OUTPUT
+ cp $OUTPUT $TMPJOIN
+ fi
+ rm $F
+done
+
+rm $TMPJOIN
+
+gnuplot bench.gnu
+convert -density 200 -resize 800x560 -flatten bench.eps bench.png
+rm bench.eps
diff --git a/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c b/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c
new file mode 100644
index 000000000..dbfc75f6d
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c
@@ -0,0 +1,34 @@
+/*
+Test performance of native C UUID generation
+
+To Compile: cc -luuid benchmark-native.c -o benchmark-native
+*/
+
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/time.h>
+#include <uuid/uuid.h>
+
+int main() {
+ uuid_t myid;
+ char buf[36+1];
+ int i;
+ struct timeval t;
+ double start, finish;
+
+ gettimeofday(&t, NULL);
+ start = t.tv_sec + t.tv_usec/1e6;
+
+ int n = 2e5;
+ for (i = 0; i < n; i++) {
+ uuid_generate(myid);
+ uuid_unparse(myid, buf);
+ }
+
+ gettimeofday(&t, NULL);
+ finish = t.tv_sec + t.tv_usec/1e6;
+ double dur = finish - start;
+
+ printf("%d uuids/sec", (int)(n/dur));
+ return 0;
+}
diff --git a/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js b/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js
new file mode 100644
index 000000000..40e6efbe7
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js
@@ -0,0 +1,84 @@
+try {
+ var nodeuuid = require('../uuid');
+} catch (e) {
+ console.error('node-uuid require failed - skipping tests');
+}
+
+try {
+ var uuid = require('uuid');
+} catch (e) {
+ console.error('uuid require failed - skipping tests');
+}
+
+try {
+ var uuidjs = require('uuid-js');
+} catch (e) {
+ console.error('uuid-js require failed - skipping tests');
+}
+
+var N = 5e5;
+
+function rate(msg, t) {
+ console.log(msg + ': ' +
+ (N / (Date.now() - t) * 1e3 | 0) +
+ ' uuids/second');
+}
+
+console.log('# v4');
+
+// node-uuid - string form
+if (nodeuuid) {
+ for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4();
+ rate('nodeuuid.v4() - using node.js crypto RNG', t);
+
+ for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4({rng: nodeuuid.mathRNG});
+ rate('nodeuuid.v4() - using Math.random() RNG', t);
+
+ for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary');
+ rate('nodeuuid.v4(\'binary\')', t);
+
+ var buffer = new nodeuuid.BufferClass(16);
+ for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary', buffer);
+ rate('nodeuuid.v4(\'binary\', buffer)', t);
+}
+
+// libuuid - string form
+if (uuid) {
+ for (var i = 0, t = Date.now(); i < N; i++) uuid();
+ rate('uuid()', t);
+
+ for (var i = 0, t = Date.now(); i < N; i++) uuid('binary');
+ rate('uuid(\'binary\')', t);
+}
+
+// uuid-js - string form
+if (uuidjs) {
+ for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(4);
+ rate('uuidjs.create(4)', t);
+}
+
+// 140byte.es
+for (var i = 0, t = Date.now(); i < N; i++) 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(s,r){r=Math.random()*16|0;return (s=='x'?r:r&0x3|0x8).toString(16)});
+rate('140byte.es_v4', t);
+
+console.log('');
+console.log('# v1');
+
+// node-uuid - v1 string form
+if (nodeuuid) {
+ for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1();
+ rate('nodeuuid.v1()', t);
+
+ for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary');
+ rate('nodeuuid.v1(\'binary\')', t);
+
+ var buffer = new nodeuuid.BufferClass(16);
+ for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary', buffer);
+ rate('nodeuuid.v1(\'binary\', buffer)', t);
+}
+
+// uuid-js - v1 string form
+if (uuidjs) {
+ for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(1);
+ rate('uuidjs.create(1)', t);
+}
diff --git a/node_modules/request/node_modules/node-uuid/bin/uuid b/node_modules/request/node_modules/node-uuid/bin/uuid
new file mode 100755
index 000000000..f732e9918
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/bin/uuid
@@ -0,0 +1,26 @@
+#!/usr/bin/env node
+
+var path = require('path');
+var uuid = require(path.join(__dirname, '..'));
+
+var arg = process.argv[2];
+
+if ('--help' === arg) {
+ console.log('\n USAGE: uuid [version] [options]\n\n');
+ console.log(' options:\n');
+ console.log(' --help Display this message and exit\n');
+ process.exit(0);
+}
+
+if (null == arg) {
+ console.log(uuid());
+ process.exit(0);
+}
+
+if ('v1' !== arg && 'v4' !== arg) {
+ console.error('Version must be RFC4122 version 1 or version 4, denoted as "v1" or "v4"');
+ process.exit(1);
+}
+
+console.log(uuid[arg]());
+process.exit(0);
diff --git a/node_modules/request/node_modules/node-uuid/bower.json b/node_modules/request/node_modules/node-uuid/bower.json
new file mode 100644
index 000000000..1656dc819
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/bower.json
@@ -0,0 +1,23 @@
+{
+ "name": "node-uuid",
+ "version": "1.4.3",
+ "homepage": "https://github.com/broofa/node-uuid",
+ "authors": [
+ "Robert Kieffer <robert@broofa.com>"
+ ],
+ "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.",
+ "main": "uuid.js",
+ "keywords": [
+ "uuid",
+ "gid",
+ "rfc4122"
+ ],
+ "license": "MIT",
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "test",
+ "tests"
+ ]
+}
diff --git a/node_modules/request/node_modules/node-uuid/component.json b/node_modules/request/node_modules/node-uuid/component.json
new file mode 100644
index 000000000..149f84b22
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/component.json
@@ -0,0 +1,18 @@
+{
+ "name": "node-uuid",
+ "repo": "broofa/node-uuid",
+ "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.",
+ "version": "1.4.3",
+ "author": "Robert Kieffer <robert@broofa.com>",
+ "contributors": [
+ {"name": "Christoph Tavan <dev@tavan.de>", "github": "https://github.com/ctavan"}
+ ],
+ "keywords": ["uuid", "guid", "rfc4122"],
+ "dependencies": {},
+ "development": {},
+ "main": "uuid.js",
+ "scripts": [
+ "uuid.js"
+ ],
+ "license": "MIT"
+}
diff --git a/node_modules/request/node_modules/node-uuid/package.json b/node_modules/request/node_modules/node-uuid/package.json
new file mode 100644
index 000000000..076eaa154
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "node-uuid",
+ "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.",
+ "url": "http://github.com/broofa/node-uuid",
+ "keywords": [
+ "uuid",
+ "guid",
+ "rfc4122"
+ ],
+ "author": {
+ "name": "Robert Kieffer",
+ "email": "robert@broofa.com"
+ },
+ "contributors": [
+ {
+ "name": "Christoph Tavan",
+ "email": "dev@tavan.de"
+ }
+ ],
+ "bin": {
+ "uuid": "./bin/uuid"
+ },
+ "scripts": {
+ "test": "node test/test.js"
+ },
+ "lib": ".",
+ "main": "./uuid.js",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/broofa/node-uuid.git"
+ },
+ "version": "1.4.3",
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://raw.github.com/broofa/node-uuid/master/LICENSE.md"
+ }
+ ],
+ "readme": "# node-uuid\n\nSimple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.\n\nFeatures:\n\n* Generate RFC4122 version 1 or version 4 UUIDs\n* Runs in node.js and all browsers.\n* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').\n* Cryptographically strong random # generation on supporting platforms\n* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! )\n* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)\n* Comes with a Command Line Interface for generating uuids on the command line\n\n## Getting Started\n\nInstall it in your browser:\n\n```html\n<script src=\"uuid.js\"></script>\n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.\n * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.\n * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.\n * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n clockseq: 0x1234,\n msecs: new Date('2011-11-01').getTime(),\n nsecs: 5678\n}); // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n random: [\n 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n * `id` - (String) UUID(-like) string\n * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> <Buffer 79 7f f0 43 11 eb 11 e1 80 d6 51 09 98 75 5d 10>\nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).\n\n### uuid.BufferClass\n\nThe class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.\n\n## Command Line Interface\n\nTo use the executable, it's probably best to install this library globally.\n\n`npm install -g node-uuid`\n\nUsage:\n\n```\nUSAGE: uuid [version] [options]\n\n\noptions:\n\n--help Display this message and exit\n```\n\n`version` must be an RFC4122 version that is supported by this library, which is currently version 1 and version 4 (denoted by \"v1\" and \"v4\", respectively). `version` defaults to version 4 when not supplied.\n\n### Examples\n\n```\n> uuid\n3a91f950-dec8-4688-ba14-5b7bbfc7a563\n```\n\n```\n> uuid v1\n9d0b43e0-7696-11e3-964b-250efa37a98e\n```\n\n```\n> uuid v4\n6790ac7c-24ac-4f98-8464-42f6d98a53ae\n```\n\n## Testing\n\nIn node.js\n\n```\nnpm test\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\n### 1.4.0\n\n* Improved module context detection\n* Removed public RNG functions\n\n### 1.3.2\n\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\n### 1.3.0\n\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/broofa/node-uuid/issues"
+ },
+ "homepage": "https://github.com/broofa/node-uuid#readme",
+ "_id": "node-uuid@1.4.3",
+ "_shasum": "319bb7a56e7cb63f00b5c0cd7851cd4b4ddf1df9",
+ "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz",
+ "_from": "node-uuid@>=1.4.3 <1.5.0"
+}
diff --git a/node_modules/request/node_modules/node-uuid/test/compare_v1.js b/node_modules/request/node_modules/node-uuid/test/compare_v1.js
new file mode 100644
index 000000000..05af82215
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/test/compare_v1.js
@@ -0,0 +1,63 @@
+var assert = require('assert'),
+ nodeuuid = require('../uuid'),
+ uuidjs = require('uuid-js'),
+ libuuid = require('uuid').generate,
+ util = require('util'),
+ exec = require('child_process').exec,
+ os = require('os');
+
+// On Mac Os X / macports there's only the ossp-uuid package that provides uuid
+// On Linux there's uuid-runtime which provides uuidgen
+var uuidCmd = os.type() === 'Darwin' ? 'uuid -1' : 'uuidgen -t';
+
+function compare(ids) {
+ console.log(ids);
+ for (var i = 0; i < ids.length; i++) {
+ var id = ids[i].split('-');
+ id = [id[2], id[1], id[0]].join('');
+ ids[i] = id;
+ }
+ var sorted = ([].concat(ids)).sort();
+
+ if (sorted.toString() !== ids.toString()) {
+ console.log('Warning: sorted !== ids');
+ } else {
+ console.log('everything in order!');
+ }
+}
+
+// Test time order of v1 uuids
+var ids = [];
+while (ids.length < 10e3) ids.push(nodeuuid.v1());
+
+var max = 10;
+console.log('node-uuid:');
+ids = [];
+for (var i = 0; i < max; i++) ids.push(nodeuuid.v1());
+compare(ids);
+
+console.log('');
+console.log('uuidjs:');
+ids = [];
+for (var i = 0; i < max; i++) ids.push(uuidjs.create(1).toString());
+compare(ids);
+
+console.log('');
+console.log('libuuid:');
+ids = [];
+var count = 0;
+var last = function() {
+ compare(ids);
+}
+var cb = function(err, stdout, stderr) {
+ ids.push(stdout.substring(0, stdout.length-1));
+ count++;
+ if (count < max) {
+ return next();
+ }
+ last();
+};
+var next = function() {
+ exec(uuidCmd, cb);
+};
+next();
diff --git a/node_modules/request/node_modules/node-uuid/test/test.html b/node_modules/request/node_modules/node-uuid/test/test.html
new file mode 100644
index 000000000..d80326ec5
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/test/test.html
@@ -0,0 +1,17 @@
+<html>
+ <head>
+ <style>
+ div {
+ font-family: monospace;
+ font-size: 8pt;
+ }
+ div.log {color: #444;}
+ div.warn {color: #550;}
+ div.error {color: #800; font-weight: bold;}
+ </style>
+ <script src="../uuid.js"></script>
+ </head>
+ <body>
+ <script src="./test.js"></script>
+ </body>
+</html>
diff --git a/node_modules/request/node_modules/node-uuid/test/test.js b/node_modules/request/node_modules/node-uuid/test/test.js
new file mode 100644
index 000000000..246922561
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/test/test.js
@@ -0,0 +1,228 @@
+if (!this.uuid) {
+ // node.js
+ uuid = require('../uuid');
+}
+
+//
+// x-platform log/assert shims
+//
+
+function _log(msg, type) {
+ type = type || 'log';
+
+ if (typeof(document) != 'undefined') {
+ document.write('<div class="' + type + '">' + msg.replace(/\n/g, '<br />') + '</div>');
+ }
+ if (typeof(console) != 'undefined') {
+ var color = {
+ log: '\033[39m',
+ warn: '\033[33m',
+ error: '\033[31m'
+ };
+ console[type](color[type] + msg + color.log);
+ }
+}
+
+function log(msg) {_log(msg, 'log');}
+function warn(msg) {_log(msg, 'warn');}
+function error(msg) {_log(msg, 'error');}
+
+function assert(res, msg) {
+ if (!res) {
+ error('FAIL: ' + msg);
+ } else {
+ log('Pass: ' + msg);
+ }
+}
+
+//
+// Unit tests
+//
+
+// Verify ordering of v1 ids created with explicit times
+var TIME = 1321644961388; // 2011-11-18 11:36:01.388-08:00
+
+function compare(name, ids) {
+ ids = ids.map(function(id) {
+ return id.split('-').reverse().join('-');
+ }).sort();
+ var sorted = ([].concat(ids)).sort();
+
+ assert(sorted.toString() == ids.toString(), name + ' have expected order');
+}
+
+// Verify ordering of v1 ids created using default behavior
+compare('uuids with current time', [
+ uuid.v1(),
+ uuid.v1(),
+ uuid.v1(),
+ uuid.v1(),
+ uuid.v1()
+]);
+
+// Verify ordering of v1 ids created with explicit times
+compare('uuids with time option', [
+ uuid.v1({msecs: TIME - 10*3600*1000}),
+ uuid.v1({msecs: TIME - 1}),
+ uuid.v1({msecs: TIME}),
+ uuid.v1({msecs: TIME + 1}),
+ uuid.v1({msecs: TIME + 28*24*3600*1000})
+]);
+
+assert(
+ uuid.v1({msecs: TIME}) != uuid.v1({msecs: TIME}),
+ 'IDs created at same msec are different'
+);
+
+// Verify throw if too many ids created
+var thrown = false;
+try {
+ uuid.v1({msecs: TIME, nsecs: 10000});
+} catch (e) {
+ thrown = true;
+}
+assert(thrown, 'Exception thrown when > 10K ids created in 1 ms');
+
+// Verify clock regression bumps clockseq
+var uidt = uuid.v1({msecs: TIME});
+var uidtb = uuid.v1({msecs: TIME - 1});
+assert(
+ parseInt(uidtb.split('-')[3], 16) - parseInt(uidt.split('-')[3], 16) === 1,
+ 'Clock regression by msec increments the clockseq'
+);
+
+// Verify clock regression bumps clockseq
+var uidtn = uuid.v1({msecs: TIME, nsecs: 10});
+var uidtnb = uuid.v1({msecs: TIME, nsecs: 9});
+assert(
+ parseInt(uidtnb.split('-')[3], 16) - parseInt(uidtn.split('-')[3], 16) === 1,
+ 'Clock regression by nsec increments the clockseq'
+);
+
+// Verify explicit options produce expected id
+var id = uuid.v1({
+ msecs: 1321651533573,
+ nsecs: 5432,
+ clockseq: 0x385c,
+ node: [ 0x61, 0xcd, 0x3c, 0xbb, 0x32, 0x10 ]
+});
+assert(id == 'd9428888-122b-11e1-b85c-61cd3cbb3210', 'Explicit options produce expected id');
+
+// Verify adjacent ids across a msec boundary are 1 time unit apart
+var u0 = uuid.v1({msecs: TIME, nsecs: 9999});
+var u1 = uuid.v1({msecs: TIME + 1, nsecs: 0});
+
+var before = u0.split('-')[0], after = u1.split('-')[0];
+var dt = parseInt(after, 16) - parseInt(before, 16);
+assert(dt === 1, 'Ids spanning 1ms boundary are 100ns apart');
+
+//
+// Test parse/unparse
+//
+
+id = '00112233445566778899aabbccddeeff';
+assert(uuid.unparse(uuid.parse(id.substr(0,10))) ==
+ '00112233-4400-0000-0000-000000000000', 'Short parse');
+assert(uuid.unparse(uuid.parse('(this is the uuid -> ' + id + id)) ==
+ '00112233-4455-6677-8899-aabbccddeeff', 'Dirty parse');
+
+//
+// Perf tests
+//
+
+var generators = {
+ v1: uuid.v1,
+ v4: uuid.v4
+};
+
+var UUID_FORMAT = {
+ v1: /[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i,
+ v4: /[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i
+};
+
+var N = 1e4;
+
+// Get %'age an actual value differs from the ideal value
+function divergence(actual, ideal) {
+ return Math.round(100*100*(actual - ideal)/ideal)/100;
+}
+
+function rate(msg, t) {
+ log(msg + ': ' + (N / (Date.now() - t) * 1e3 | 0) + ' uuids\/second');
+}
+
+for (var version in generators) {
+ var counts = {}, max = 0;
+ var generator = generators[version];
+ var format = UUID_FORMAT[version];
+
+ log('\nSanity check ' + N + ' ' + version + ' uuids');
+ for (var i = 0, ok = 0; i < N; i++) {
+ id = generator();
+ if (!format.test(id)) {
+ throw Error(id + ' is not a valid UUID string');
+ }
+
+ if (id != uuid.unparse(uuid.parse(id))) {
+ assert(fail, id + ' is not a valid id');
+ }
+
+ // Count digits for our randomness check
+ if (version == 'v4') {
+ var digits = id.replace(/-/g, '').split('');
+ for (var j = digits.length-1; j >= 0; j--) {
+ var c = digits[j];
+ max = Math.max(max, counts[c] = (counts[c] || 0) + 1);
+ }
+ }
+ }
+
+ // Check randomness for v4 UUIDs
+ if (version == 'v4') {
+ // Limit that we get worried about randomness. (Purely empirical choice, this!)
+ var limit = 2*100*Math.sqrt(1/N);
+
+ log('\nChecking v4 randomness. Distribution of Hex Digits (% deviation from ideal)');
+
+ for (var i = 0; i < 16; i++) {
+ var c = i.toString(16);
+ var bar = '', n = counts[c], p = Math.round(n/max*100|0);
+
+ // 1-3,5-8, and D-F: 1:16 odds over 30 digits
+ var ideal = N*30/16;
+ if (i == 4) {
+ // 4: 1:1 odds on 1 digit, plus 1:16 odds on 30 digits
+ ideal = N*(1 + 30/16);
+ } else if (i >= 8 && i <= 11) {
+ // 8-B: 1:4 odds on 1 digit, plus 1:16 odds on 30 digits
+ ideal = N*(1/4 + 30/16);
+ } else {
+ // Otherwise: 1:16 odds on 30 digits
+ ideal = N*30/16;
+ }
+ var d = divergence(n, ideal);
+
+ // Draw bar using UTF squares (just for grins)
+ var s = n/max*50 | 0;
+ while (s--) bar += '=';
+
+ assert(Math.abs(d) < limit, c + ' |' + bar + '| ' + counts[c] + ' (' + d + '% < ' + limit + '%)');
+ }
+ }
+}
+
+// Perf tests
+for (var version in generators) {
+ log('\nPerformance testing ' + version + ' UUIDs');
+ var generator = generators[version];
+ var buf = new uuid.BufferClass(16);
+
+ for (var i = 0, t = Date.now(); i < N; i++) generator();
+ rate('uuid.' + version + '()', t);
+
+ for (var i = 0, t = Date.now(); i < N; i++) generator('binary');
+ rate('uuid.' + version + '(\'binary\')', t);
+
+ for (var i = 0, t = Date.now(); i < N; i++) generator('binary', buf);
+ rate('uuid.' + version + '(\'binary\', buffer)', t);
+}
diff --git a/node_modules/request/node_modules/node-uuid/uuid.js b/node_modules/request/node_modules/node-uuid/uuid.js
new file mode 100644
index 000000000..0a6176979
--- /dev/null
+++ b/node_modules/request/node_modules/node-uuid/uuid.js
@@ -0,0 +1,247 @@
+// uuid.js
+//
+// Copyright (c) 2010-2012 Robert Kieffer
+// MIT License - http://opensource.org/licenses/mit-license.php
+
+(function() {
+ var _global = this;
+
+ // Unique ID creation requires a high quality random # generator. We feature
+ // detect to determine the best RNG source, normalizing to a function that
+ // returns 128-bits of randomness, since that's what's usually required
+ var _rng;
+
+ // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html
+ //
+ // Moderately fast, high quality
+ if (typeof(_global.require) == 'function') {
+ try {
+ var _rb = _global.require('crypto').randomBytes;
+ _rng = _rb && function() {return _rb(16);};
+ } catch(e) {}
+ }
+
+ if (!_rng && _global.crypto && crypto.getRandomValues) {
+ // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto
+ //
+ // Moderately fast, high quality
+ var _rnds8 = new Uint8Array(16);
+ _rng = function whatwgRNG() {
+ crypto.getRandomValues(_rnds8);
+ return _rnds8;
+ };
+ }
+
+ if (!_rng) {
+ // Math.random()-based (RNG)
+ //
+ // If all else fails, use Math.random(). It's fast, but is of unspecified
+ // quality.
+ var _rnds = new Array(16);
+ _rng = function() {
+ for (var i = 0, r; i < 16; i++) {
+ if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
+ _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
+ }
+
+ return _rnds;
+ };
+ }
+
+ // Buffer class to use
+ var BufferClass = typeof(_global.Buffer) == 'function' ? _global.Buffer : Array;
+
+ // Maps for number <-> hex string conversion
+ var _byteToHex = [];
+ var _hexToByte = {};
+ for (var i = 0; i < 256; i++) {
+ _byteToHex[i] = (i + 0x100).toString(16).substr(1);
+ _hexToByte[_byteToHex[i]] = i;
+ }
+
+ // **`parse()` - Parse a UUID into it's component bytes**
+ function parse(s, buf, offset) {
+ var i = (buf && offset) || 0, ii = 0;
+
+ buf = buf || [];
+ s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {
+ if (ii < 16) { // Don't overflow!
+ buf[i + ii++] = _hexToByte[oct];
+ }
+ });
+
+ // Zero out remaining bytes if string was short
+ while (ii < 16) {
+ buf[i + ii++] = 0;
+ }
+
+ return buf;
+ }
+
+ // **`unparse()` - Convert UUID byte array (ala parse()) into a string**
+ function unparse(buf, offset) {
+ var i = offset || 0, bth = _byteToHex;
+ return bth[buf[i++]] + bth[buf[i++]] +
+ bth[buf[i++]] + bth[buf[i++]] + '-' +
+ bth[buf[i++]] + bth[buf[i++]] + '-' +
+ bth[buf[i++]] + bth[buf[i++]] + '-' +
+ bth[buf[i++]] + bth[buf[i++]] + '-' +
+ bth[buf[i++]] + bth[buf[i++]] +
+ bth[buf[i++]] + bth[buf[i++]] +
+ bth[buf[i++]] + bth[buf[i++]];
+ }
+
+ // **`v1()` - Generate time-based UUID**
+ //
+ // Inspired by https://github.com/LiosK/UUID.js
+ // and http://docs.python.org/library/uuid.html
+
+ // random #'s we need to init node and clockseq
+ var _seedBytes = _rng();
+
+ // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
+ var _nodeId = [
+ _seedBytes[0] | 0x01,
+ _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]
+ ];
+
+ // Per 4.2.2, randomize (14 bit) clockseq
+ var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;
+
+ // Previous uuid creation time
+ var _lastMSecs = 0, _lastNSecs = 0;
+
+ // See https://github.com/broofa/node-uuid for API details
+ function v1(options, buf, offset) {
+ var i = buf && offset || 0;
+ var b = buf || [];
+
+ options = options || {};
+
+ var clockseq = options.clockseq != null ? options.clockseq : _clockseq;
+
+ // UUID timestamps are 100 nano-second units since the Gregorian epoch,
+ // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
+ // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
+ // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
+ var msecs = options.msecs != null ? options.msecs : new Date().getTime();
+
+ // Per 4.2.1.2, use count of uuid's generated during the current clock
+ // cycle to simulate higher resolution clock
+ var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1;
+
+ // Time since last uuid creation (in msecs)
+ var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
+
+ // Per 4.2.1.2, Bump clockseq on clock regression
+ if (dt < 0 && options.clockseq == null) {
+ clockseq = clockseq + 1 & 0x3fff;
+ }
+
+ // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
+ // time interval
+ if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) {
+ nsecs = 0;
+ }
+
+ // Per 4.2.1.2 Throw error if too many uuids are requested
+ if (nsecs >= 10000) {
+ throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
+ }
+
+ _lastMSecs = msecs;
+ _lastNSecs = nsecs;
+ _clockseq = clockseq;
+
+ // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
+ msecs += 12219292800000;
+
+ // `time_low`
+ var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
+ b[i++] = tl >>> 24 & 0xff;
+ b[i++] = tl >>> 16 & 0xff;
+ b[i++] = tl >>> 8 & 0xff;
+ b[i++] = tl & 0xff;
+
+ // `time_mid`
+ var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
+ b[i++] = tmh >>> 8 & 0xff;
+ b[i++] = tmh & 0xff;
+
+ // `time_high_and_version`
+ b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
+ b[i++] = tmh >>> 16 & 0xff;
+
+ // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
+ b[i++] = clockseq >>> 8 | 0x80;
+
+ // `clock_seq_low`
+ b[i++] = clockseq & 0xff;
+
+ // `node`
+ var node = options.node || _nodeId;
+ for (var n = 0; n < 6; n++) {
+ b[i + n] = node[n];
+ }
+
+ return buf ? buf : unparse(b);
+ }
+
+ // **`v4()` - Generate random UUID**
+
+ // See https://github.com/broofa/node-uuid for API details
+ function v4(options, buf, offset) {
+ // Deprecated - 'format' argument, as supported in v1.2
+ var i = buf && offset || 0;
+
+ if (typeof(options) == 'string') {
+ buf = options == 'binary' ? new BufferClass(16) : null;
+ options = null;
+ }
+ options = options || {};
+
+ var rnds = options.random || (options.rng || _rng)();
+
+ // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
+ rnds[6] = (rnds[6] & 0x0f) | 0x40;
+ rnds[8] = (rnds[8] & 0x3f) | 0x80;
+
+ // Copy bytes to buffer, if provided
+ if (buf) {
+ for (var ii = 0; ii < 16; ii++) {
+ buf[i + ii] = rnds[ii];
+ }
+ }
+
+ return buf || unparse(rnds);
+ }
+
+ // Export public API
+ var uuid = v4;
+ uuid.v1 = v1;
+ uuid.v4 = v4;
+ uuid.parse = parse;
+ uuid.unparse = unparse;
+ uuid.BufferClass = BufferClass;
+
+ if (typeof(module) != 'undefined' && module.exports) {
+ // Publish as node.js module
+ module.exports = uuid;
+ } else if (typeof define === 'function' && define.amd) {
+ // Publish as AMD module
+ define(function() {return uuid;});
+
+
+ } else {
+ // Publish as global (in browsers)
+ var _previousRoot = _global.uuid;
+
+ // **`noConflict()` - (browser only) to reset global 'uuid' var**
+ uuid.noConflict = function() {
+ _global.uuid = _previousRoot;
+ return uuid;
+ };
+
+ _global.uuid = uuid;
+ }
+}).call(this);
diff --git a/node_modules/request/node_modules/oauth-sign/LICENSE b/node_modules/request/node_modules/oauth-sign/LICENSE
new file mode 100644
index 000000000..a4a9aee0c
--- /dev/null
+++ b/node_modules/request/node_modules/oauth-sign/LICENSE
@@ -0,0 +1,55 @@
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS \ No newline at end of file
diff --git a/node_modules/request/node_modules/oauth-sign/README.md b/node_modules/request/node_modules/oauth-sign/README.md
new file mode 100644
index 000000000..34c4a85d2
--- /dev/null
+++ b/node_modules/request/node_modules/oauth-sign/README.md
@@ -0,0 +1,4 @@
+oauth-sign
+==========
+
+OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.
diff --git a/node_modules/request/node_modules/oauth-sign/index.js b/node_modules/request/node_modules/oauth-sign/index.js
new file mode 100644
index 000000000..a587541dc
--- /dev/null
+++ b/node_modules/request/node_modules/oauth-sign/index.js
@@ -0,0 +1,134 @@
+var crypto = require('crypto')
+ , qs = require('querystring')
+ ;
+
+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')
+ .replace(/\*/g,'%2A')
+ .replace(/\(/g,'%28')
+ .replace(/\)/g,'%29')
+ .replace(/'/g,'%27')
+ ;
+}
+
+// Maps object to bi-dimensional array
+// Converts { foo: 'A', bar: [ 'b', 'B' ]} to
+// [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ]
+function map (obj) {
+ var key, val, arr = []
+ for (key in obj) {
+ val = obj[key]
+ if (Array.isArray(val))
+ for (var i = 0; i < val.length; i++)
+ arr.push([key, val[i]])
+ else if (typeof val === "object")
+ for (var prop in val)
+ arr.push([key + '[' + prop + ']', val[prop]]);
+ else
+ arr.push([key, val])
+ }
+ return arr
+}
+
+// Compare function for sort
+function compare (a, b) {
+ return a > b ? 1 : a < b ? -1 : 0
+}
+
+function generateBase (httpMethod, base_uri, params) {
+ // adapted from https://dev.twitter.com/docs/auth/oauth and
+ // https://dev.twitter.com/docs/auth/creating-signature
+
+ // Parameter normalization
+ // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2
+ var normalized = map(params)
+ // 1. First, the name and value of each parameter are encoded
+ .map(function (p) {
+ return [ rfc3986(p[0]), rfc3986(p[1] || '') ]
+ })
+ // 2. The parameters are sorted by name, using ascending byte value
+ // ordering. If two or more parameters share the same name, they
+ // are sorted by their value.
+ .sort(function (a, b) {
+ return compare(a[0], b[0]) || compare(a[1], b[1])
+ })
+ // 3. The name of each parameter is concatenated to its corresponding
+ // value using an "=" character (ASCII code 61) as a separator, even
+ // if the value is empty.
+ .map(function (p) { return p.join('=') })
+ // 4. The sorted name/value pairs are concatenated together into a
+ // single string by using an "&" character (ASCII code 38) as
+ // separator.
+ .join('&')
+
+ var base = [
+ rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'),
+ rfc3986(base_uri),
+ 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 || ''
+ ].map(rfc3986).join('&')
+
+ 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 plaintext (consumer_secret, token_secret) {
+ var key = [
+ consumer_secret || '',
+ token_secret || ''
+ ].map(rfc3986).join('&')
+
+ return key
+}
+
+function sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) {
+ var method
+ var skipArgs = 1
+
+ switch (signMethod) {
+ case 'RSA-SHA1':
+ method = rsasign
+ break
+ case 'HMAC-SHA1':
+ method = hmacsign
+ break
+ case 'PLAINTEXT':
+ method = plaintext
+ skipArgs = 4
+ break
+ default:
+ throw new Error("Signature method not supported: " + signMethod)
+ }
+
+ return method.apply(null, [].slice.call(arguments, skipArgs))
+}
+
+exports.hmacsign = hmacsign
+exports.rsasign = rsasign
+exports.plaintext = plaintext
+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
new file mode 100644
index 000000000..eeaaa68d3
--- /dev/null
+++ b/node_modules/request/node_modules/oauth-sign/package.json
@@ -0,0 +1,59 @@
+{
+ "author": {
+ "name": "Mikeal Rogers",
+ "email": "mikeal.rogers@gmail.com",
+ "url": "http://www.futurealoof.com"
+ },
+ "name": "oauth-sign",
+ "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.",
+ "version": "0.8.0",
+ "license": "Apache-2.0",
+ "repository": {
+ "url": "git+https://github.com/mikeal/oauth-sign.git"
+ },
+ "main": "index.js",
+ "dependencies": {},
+ "devDependencies": {},
+ "optionalDependencies": {},
+ "engines": {
+ "node": "*"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "gitHead": "e1f2b42ff039901ce977f8e81918767d97d496b5",
+ "bugs": {
+ "url": "https://github.com/mikeal/oauth-sign/issues"
+ },
+ "homepage": "https://github.com/mikeal/oauth-sign#readme",
+ "_id": "oauth-sign@0.8.0",
+ "_shasum": "938fdc875765ba527137d8aec9d178e24debc553",
+ "_from": "oauth-sign@>=0.8.0 <0.9.0",
+ "_npmVersion": "2.10.1",
+ "_nodeVersion": "0.12.4",
+ "_npmUser": {
+ "name": "simov",
+ "email": "simeonvelichkov@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ {
+ "name": "nylen",
+ "email": "jnylen@gmail.com"
+ },
+ {
+ "name": "simov",
+ "email": "simeonvelichkov@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "938fdc875765ba527137d8aec9d178e24debc553",
+ "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/oauth-sign/test.js b/node_modules/request/node_modules/oauth-sign/test.js
new file mode 100644
index 000000000..a8847270d
--- /dev/null
+++ b/node_modules/request/node_modules/oauth-sign/test.js
@@ -0,0 +1,89 @@
+var oauth = require('./index')
+ , hmacsign = oauth.hmacsign
+ , assert = require('assert')
+ , qs = require('querystring')
+ ;
+
+// Tests from Twitter documentation https://dev.twitter.com/docs/auth/oauth
+
+var reqsign = hmacsign('POST', 'https://api.twitter.com/oauth/request_token',
+ { oauth_callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11'
+ , oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g'
+ , oauth_nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk'
+ , oauth_signature_method: 'HMAC-SHA1'
+ , oauth_timestamp: '1272323042'
+ , oauth_version: '1.0'
+ }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98")
+
+console.log(reqsign)
+console.log('8wUi7m5HFQy76nowoCThusfgB+Q=')
+assert.equal(reqsign, '8wUi7m5HFQy76nowoCThusfgB+Q=')
+
+var accsign = hmacsign('POST', 'https://api.twitter.com/oauth/access_token',
+ { oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g'
+ , oauth_nonce: '9zWH6qe0qG7Lc1telCn7FhUbLyVdjEaL3MO5uHxn8'
+ , oauth_signature_method: 'HMAC-SHA1'
+ , oauth_token: '8ldIZyxQeVrFZXFOZH5tAwj6vzJYuLQpl0WUEYtWc'
+ , oauth_timestamp: '1272323047'
+ , oauth_verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY'
+ , oauth_version: '1.0'
+ }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA")
+
+console.log(accsign)
+console.log('PUw/dHA4fnlJYM6RhXk5IU/0fCc=')
+assert.equal(accsign, 'PUw/dHA4fnlJYM6RhXk5IU/0fCc=')
+
+var upsign = hmacsign('POST', 'http://api.twitter.com/1/statuses/update.json',
+ { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g"
+ , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y"
+ , oauth_signature_method: "HMAC-SHA1"
+ , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw"
+ , oauth_timestamp: "1272325550"
+ , oauth_version: "1.0"
+ , status: 'setting up my twitter 私のさえずりを設定する'
+ }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA")
+
+console.log(upsign)
+console.log('yOahq5m0YjDDjfjxHaXEsW9D+X0=')
+assert.equal(upsign, 'yOahq5m0YjDDjfjxHaXEsW9D+X0=')
+
+// handle objects in params (useful for Wordpress REST API)
+var upsign = hmacsign('POST', 'http://wordpress.com/wp-json',
+ { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g"
+ , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y"
+ , oauth_signature_method: "HMAC-SHA1"
+ , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw"
+ , oauth_timestamp: "1272325550"
+ , oauth_version: "1.0"
+ , filter: { number: "-1" }
+ }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA")
+
+console.log(upsign)
+console.log('YrJFBdwnjuIitGpKrxLUplcuuUQ=')
+assert.equal(upsign, 'YrJFBdwnjuIitGpKrxLUplcuuUQ=')
+
+// example in rfc5849
+var params = qs.parse('b5=%3D%253D&a3=a&c%40=&a2=r%20b' + '&' + 'c2&a3=2+q')
+params.oauth_consumer_key = '9djdj82h48djs9d2'
+params.oauth_token = 'kkk9d7dh3k39sjv7'
+params.oauth_nonce = '7d8f3e4a'
+params.oauth_signature_method = 'HMAC-SHA1'
+params.oauth_timestamp = '137131201'
+
+var rfc5849sign = hmacsign('POST', 'http://example.com/request',
+ params, "j49sk3j29djd", "dh893hdasih9")
+
+console.log(rfc5849sign)
+console.log('r6/TJjbCOr97/+UU0NsvSne7s5g=')
+assert.equal(rfc5849sign, 'r6/TJjbCOr97/+UU0NsvSne7s5g=')
+
+
+// PLAINTEXT
+
+var plainSign = oauth.sign('PLAINTEXT', 'GET', 'http://dummy.com', {}, 'consumer_secret', 'token_secret')
+console.log(plainSign)
+assert.equal(plainSign, 'consumer_secret&token_secret')
+
+plainSign = oauth.plaintext('consumer_secret', 'token_secret')
+console.log(plainSign)
+assert.equal(plainSign, 'consumer_secret&token_secret')
diff --git a/node_modules/request/node_modules/qs/.eslintignore b/node_modules/request/node_modules/qs/.eslintignore
new file mode 100644
index 000000000..1521c8b76
--- /dev/null
+++ b/node_modules/request/node_modules/qs/.eslintignore
@@ -0,0 +1 @@
+dist
diff --git a/node_modules/request/node_modules/qs/.npmignore b/node_modules/request/node_modules/qs/.npmignore
new file mode 100644
index 000000000..7e1574dc5
--- /dev/null
+++ b/node_modules/request/node_modules/qs/.npmignore
@@ -0,0 +1,18 @@
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+complexity.md
diff --git a/node_modules/request/node_modules/qs/.travis.yml b/node_modules/request/node_modules/qs/.travis.yml
new file mode 100644
index 000000000..335fded1a
--- /dev/null
+++ b/node_modules/request/node_modules/qs/.travis.yml
@@ -0,0 +1,8 @@
+language: node_js
+
+node_js:
+ - 0.10
+ - 4.0
+ - 4
+
+sudo: false
diff --git a/node_modules/request/node_modules/qs/CHANGELOG.md b/node_modules/request/node_modules/qs/CHANGELOG.md
new file mode 100644
index 000000000..e43b1aceb
--- /dev/null
+++ b/node_modules/request/node_modules/qs/CHANGELOG.md
@@ -0,0 +1,99 @@
+
+## [**5.1.0**](https://github.com/hapijs/qs/issues?milestone=29&state=open)
+- [**#117**](https://github.com/hapijs/qs/issues/117) make URI encoding stringified results optional
+- [**#106**](https://github.com/hapijs/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify
+
+## [**5.0.0**](https://github.com/hapijs/qs/issues?milestone=28&state=closed)
+- [**#114**](https://github.com/hapijs/qs/issues/114) default allowDots to false
+- [**#100**](https://github.com/hapijs/qs/issues/100) include dist to npm
+
+## [**4.0.0**](https://github.com/hapijs/qs/issues?milestone=26&state=closed)
+- [**#98**](https://github.com/hapijs/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional
+
+## [**3.1.0**](https://github.com/hapijs/qs/issues?milestone=24&state=closed)
+- [**#89**](https://github.com/hapijs/qs/issues/89) Add option to disable "Transform dot notation to bracket notation"
+
+## [**3.0.0**](https://github.com/hapijs/qs/issues?milestone=23&state=closed)
+- [**#80**](https://github.com/hapijs/qs/issues/80) qs.parse silently drops properties
+- [**#77**](https://github.com/hapijs/qs/issues/77) Perf boost
+- [**#60**](https://github.com/hapijs/qs/issues/60) Add explicit option to disable array parsing
+- [**#74**](https://github.com/hapijs/qs/issues/74) Bad parse when turning array into object
+- [**#81**](https://github.com/hapijs/qs/issues/81) Add a `filter` option
+- [**#68**](https://github.com/hapijs/qs/issues/68) Fixed issue with recursion and passing strings into objects.
+- [**#66**](https://github.com/hapijs/qs/issues/66) Add mixed array and object dot notation support Closes: #47
+- [**#76**](https://github.com/hapijs/qs/issues/76) RFC 3986
+- [**#85**](https://github.com/hapijs/qs/issues/85) No equal sign
+- [**#84**](https://github.com/hapijs/qs/issues/84) update license attribute
+
+## [**2.4.1**](https://github.com/hapijs/qs/issues?milestone=20&state=closed)
+- [**#73**](https://github.com/hapijs/qs/issues/73) Property 'hasOwnProperty' of object #<Object> is not a function
+
+## [**2.4.0**](https://github.com/hapijs/qs/issues?milestone=19&state=closed)
+- [**#70**](https://github.com/hapijs/qs/issues/70) Add arrayFormat option
+
+## [**2.3.3**](https://github.com/hapijs/qs/issues?milestone=18&state=closed)
+- [**#59**](https://github.com/hapijs/qs/issues/59) make sure array indexes are >= 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 "undefined" and "false" instead of throwing "TypeError".
+
+## [**2.3.0**](https://github.com/hapijs/qs/issues?milestone=15&state=closed)
+- [**#50**](https://github.com/hapijs/qs/issues/50) add option to omit array indices, closes #46
+
+## [**2.2.5**](https://github.com/hapijs/qs/issues?milestone=14&state=closed)
+- [**#39**](https://github.com/hapijs/qs/issues/39) Is there an alternative to Buffer.isBuffer?
+- [**#49**](https://github.com/hapijs/qs/issues/49) refactor utils.merge, fixes #45
+- [**#41**](https://github.com/hapijs/qs/issues/41) avoid browserifying Buffer, for #39
+
+## [**2.2.4**](https://github.com/hapijs/qs/issues?milestone=13&state=closed)
+- [**#38**](https://github.com/hapijs/qs/issues/38) how to handle object keys beginning with a number
+
+## [**2.2.3**](https://github.com/hapijs/qs/issues?milestone=12&state=closed)
+- [**#37**](https://github.com/hapijs/qs/issues/37) parser discards first empty value in array
+- [**#36**](https://github.com/hapijs/qs/issues/36) Update to lab 4.x
+
+## [**2.2.2**](https://github.com/hapijs/qs/issues?milestone=11&state=closed)
+- [**#33**](https://github.com/hapijs/qs/issues/33) Error when plain object in a value
+- [**#34**](https://github.com/hapijs/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty
+- [**#24**](https://github.com/hapijs/qs/issues/24) Changelog? Semver?
+
+## [**2.2.1**](https://github.com/hapijs/qs/issues?milestone=10&state=closed)
+- [**#32**](https://github.com/hapijs/qs/issues/32) account for circular references properly, closes #31
+- [**#31**](https://github.com/hapijs/qs/issues/31) qs.parse stackoverflow on circular objects
+
+## [**2.2.0**](https://github.com/hapijs/qs/issues?milestone=9&state=closed)
+- [**#26**](https://github.com/hapijs/qs/issues/26) Don't use Buffer global if it's not present
+- [**#30**](https://github.com/hapijs/qs/issues/30) Bug when merging non-object values into arrays
+- [**#29**](https://github.com/hapijs/qs/issues/29) Don't call Utils.clone at the top of Utils.merge
+- [**#23**](https://github.com/hapijs/qs/issues/23) Ability to not limit parameters?
+
+## [**2.1.0**](https://github.com/hapijs/qs/issues?milestone=8&state=closed)
+- [**#22**](https://github.com/hapijs/qs/issues/22) Enable using a RegExp as delimiter
+
+## [**2.0.0**](https://github.com/hapijs/qs/issues?milestone=7&state=closed)
+- [**#18**](https://github.com/hapijs/qs/issues/18) Why is there arrayLimit?
+- [**#20**](https://github.com/hapijs/qs/issues/20) Configurable parametersLimit
+- [**#21**](https://github.com/hapijs/qs/issues/21) make all limits optional, for #18, for #20
+
+## [**1.2.2**](https://github.com/hapijs/qs/issues?milestone=6&state=closed)
+- [**#19**](https://github.com/hapijs/qs/issues/19) Don't overwrite null values
+
+## [**1.2.1**](https://github.com/hapijs/qs/issues?milestone=5&state=closed)
+- [**#16**](https://github.com/hapijs/qs/issues/16) ignore non-string delimiters
+- [**#15**](https://github.com/hapijs/qs/issues/15) Close code block
+
+## [**1.2.0**](https://github.com/hapijs/qs/issues?milestone=4&state=closed)
+- [**#12**](https://github.com/hapijs/qs/issues/12) Add optional delim argument
+- [**#13**](https://github.com/hapijs/qs/issues/13) fix #11: flattened keys in array are now correctly parsed
+
+## [**1.1.0**](https://github.com/hapijs/qs/issues?milestone=3&state=closed)
+- [**#7**](https://github.com/hapijs/qs/issues/7) Empty values of a POST array disappear after being submitted
+- [**#9**](https://github.com/hapijs/qs/issues/9) Should not omit equals signs (=) when value is null
+- [**#6**](https://github.com/hapijs/qs/issues/6) Minor grammar fix in README
+
+## [**1.0.2**](https://github.com/hapijs/qs/issues?milestone=2&state=closed)
+- [**#5**](https://github.com/hapijs/qs/issues/5) array holes incorrectly copied into object on large index
diff --git a/node_modules/request/node_modules/qs/CONTRIBUTING.md b/node_modules/request/node_modules/qs/CONTRIBUTING.md
new file mode 100644
index 000000000..892836159
--- /dev/null
+++ b/node_modules/request/node_modules/qs/CONTRIBUTING.md
@@ -0,0 +1 @@
+Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md).
diff --git a/node_modules/request/node_modules/qs/LICENSE b/node_modules/request/node_modules/qs/LICENSE
new file mode 100644
index 000000000..d4569487a
--- /dev/null
+++ b/node_modules/request/node_modules/qs/LICENSE
@@ -0,0 +1,28 @@
+Copyright (c) 2014 Nathan LaFreniere and other contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The names of any contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ * * *
+
+The complete list of contributors can be found at: https://github.com/hapijs/qs/graphs/contributors
diff --git a/node_modules/request/node_modules/qs/README.md b/node_modules/request/node_modules/qs/README.md
new file mode 100644
index 000000000..3c61db31a
--- /dev/null
+++ b/node_modules/request/node_modules/qs/README.md
@@ -0,0 +1,331 @@
+# qs
+
+A querystring parsing and stringifying library with some added security.
+
+[![Build Status](https://secure.travis-ci.org/hapijs/qs.svg)](http://travis-ci.org/hapijs/qs)
+
+Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf)
+
+The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring).
+
+## Usage
+
+```javascript
+var Qs = require('qs');
+
+var obj = Qs.parse('a=c'); // { a: 'c' }
+var str = Qs.stringify(obj); // 'a=c'
+```
+
+### Parsing Objects
+
+```javascript
+Qs.parse(string, [options]);
+```
+
+**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`.
+For example, the string `'foo[bar]=baz'` converts to:
+
+```javascript
+{
+ foo: {
+ bar: 'baz'
+ }
+}
+```
+
+When using the `plainObjects` option the parsed value is returned as a plain object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like:
+
+```javascript
+Qs.parse('a.hasOwnProperty=b', { plainObjects: true });
+// { a: { hasOwnProperty: 'b' } }
+```
+
+By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option.
+
+```javascript
+Qs.parse('a.hasOwnProperty=b', { allowPrototypes: true });
+// { a: { hasOwnProperty: 'b' } }
+```
+
+URI encoded strings work too:
+
+```javascript
+Qs.parse('a%5Bb%5D=c');
+// { a: { b: 'c' } }
+```
+
+You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`:
+
+```javascript
+{
+ foo: {
+ bar: {
+ baz: 'foobarbaz'
+ }
+ }
+}
+```
+
+By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like
+`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be:
+
+```javascript
+{
+ a: {
+ b: {
+ c: {
+ d: {
+ e: {
+ f: {
+ '[g][h][i]': 'j'
+ }
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+This depth can be overridden by passing a `depth` option to `Qs.parse(string, [options])`:
+
+```javascript
+Qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });
+// { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }
+```
+
+The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number.
+
+For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option:
+
+```javascript
+Qs.parse('a=b&c=d', { parameterLimit: 1 });
+// { a: 'b' }
+```
+
+An optional delimiter can also be passed:
+
+```javascript
+Qs.parse('a=b;c=d', { delimiter: ';' });
+// { a: 'b', c: 'd' }
+```
+
+Delimiters can be a regular expression too:
+
+```javascript
+Qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });
+// { a: 'b', c: 'd', e: 'f' }
+```
+
+Option `allowDots` can be used to enable dot notation:
+
+```javascript
+Qs.parse('a.b=c', { allowDots: true });
+// { a: { b: 'c' } }
+```
+
+### Parsing Arrays
+
+**qs** can also parse arrays using a similar `[]` notation:
+
+```javascript
+Qs.parse('a[]=b&a[]=c');
+// { a: ['b', 'c'] }
+```
+
+You may specify an index as well:
+
+```javascript
+Qs.parse('a[1]=c&a[0]=b');
+// { a: ['b', 'c'] }
+```
+
+Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number
+to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving
+their order:
+
+```javascript
+Qs.parse('a[1]=b&a[15]=c');
+// { a: ['b', 'c'] }
+```
+
+Note that an empty string is also a value, and will be preserved:
+
+```javascript
+Qs.parse('a[]=&a[]=b');
+// { a: ['', 'b'] }
+Qs.parse('a[0]=b&a[1]=&a[2]=c');
+// { a: ['b', '', 'c'] }
+```
+
+**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will
+instead be converted to an object with the index as the key:
+
+```javascript
+Qs.parse('a[100]=b');
+// { a: { '100': 'b' } }
+```
+
+This limit can be overridden by passing an `arrayLimit` option:
+
+```javascript
+Qs.parse('a[1]=b', { arrayLimit: 0 });
+// { a: { '1': 'b' } }
+```
+
+To disable array parsing entirely, set `parseArrays` to `false`.
+
+```javascript
+Qs.parse('a[]=b', { parseArrays: false });
+// { a: { '0': 'b' } }
+```
+
+If you mix notations, **qs** will merge the two items into an object:
+
+```javascript
+Qs.parse('a[0]=b&a[b]=c');
+// { a: { '0': 'b', b: 'c' } }
+```
+
+You can also create arrays of objects:
+
+```javascript
+Qs.parse('a[][b]=c');
+// { a: [{ b: 'c' }] }
+```
+
+### Stringifying
+
+```javascript
+Qs.stringify(object, [options]);
+```
+
+When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect:
+
+```javascript
+Qs.stringify({ a: 'b' });
+// 'a=b'
+Qs.stringify({ a: { b: 'c' } });
+// 'a%5Bb%5D=c'
+```
+
+This encoding can be disabled by setting the `encode` option to `false`:
+
+```javascript
+Qs.stringify({ a: { b: 'c' } }, { encode: false });
+// 'a[b]=c'
+```
+
+Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage.
+
+When arrays are stringified, by default they are given explicit indices:
+
+```javascript
+Qs.stringify({ a: ['b', 'c', 'd'] });
+// 'a[0]=b&a[1]=c&a[2]=d'
+```
+
+You may override this by setting the `indices` option to `false`:
+
+```javascript
+Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });
+// 'a=b&a=c&a=d'
+```
+
+You may use the `arrayFormat` option to specify the format of the output array
+
+```javascript
+Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })
+// 'a[0]=b&a[1]=c'
+Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })
+// 'a[]=b&a[]=c'
+Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })
+// 'a=b&a=c'
+```
+
+Empty strings and null values will omit the value, but the equals sign (=) remains in place:
+
+```javascript
+Qs.stringify({ a: '' });
+// 'a='
+```
+
+Properties that are set to `undefined` will be omitted entirely:
+
+```javascript
+Qs.stringify({ a: null, b: undefined });
+// 'a='
+```
+
+The delimiter may be overridden with stringify as well:
+
+```javascript
+Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' });
+// 'a=b;c=d'
+```
+
+Finally, you can use the `filter` option to restrict which keys will be included in the stringified output.
+If you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if you
+pass an array, it will be used to select properties and array indices for stringification:
+
+```javascript
+function filterFunc(prefix, value) {
+ if (prefix == 'b') {
+ // Return an `undefined` value to omit a property.
+ return;
+ }
+ if (prefix == 'e[f]') {
+ return value.getTime();
+ }
+ if (prefix == 'e[g][0]') {
+ return value * 2;
+ }
+ return value;
+}
+Qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc })
+// 'a=b&c=d&e[f]=123&e[g][0]=4'
+Qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] })
+// 'a=b&e=f'
+Qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] })
+// 'a[0]=b&a[2]=d'
+```
+
+### Handling of `null` values
+
+By default, `null` values are treated like empty strings:
+
+```javascript
+Qs.stringify({ a: null, b: '' });
+// 'a=&b='
+```
+
+Parsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings.
+
+```javascript
+Qs.parse('a&b=')
+// { a: '', b: '' }
+```
+
+To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null`
+values have no `=` sign:
+
+```javascript
+Qs.stringify({ a: null, b: '' }, { strictNullHandling: true });
+// 'a&b='
+```
+
+To parse values without `=` back to `null` use the `strictNullHandling` flag:
+
+```javascript
+Qs.parse('a&b=', { strictNullHandling: true });
+// { a: null, b: '' }
+
+```
+
+To completely skip rendering keys with `null` values, use the `skipNulls` flag:
+
+```javascript
+qs.stringify({ a: 'b', c: null}, { skipNulls: true })
+// 'a=b'
+```
diff --git a/node_modules/request/node_modules/qs/bower.json b/node_modules/request/node_modules/qs/bower.json
new file mode 100644
index 000000000..53a70d0c9
--- /dev/null
+++ b/node_modules/request/node_modules/qs/bower.json
@@ -0,0 +1,22 @@
+{
+ "name": "qs",
+ "main": "dist/qs.js",
+ "version": "5.1.0",
+ "homepage": "https://github.com/hapijs/qs",
+ "authors": [
+ "Nathan LaFreniere <quitlahok@gmail.com>"
+ ],
+ "description": "A querystring parser that supports nesting and arrays, with a depth limit",
+ "keywords": [
+ "querystring",
+ "qs"
+ ],
+ "license": "BSD-3-Clause",
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "test",
+ "tests"
+ ]
+}
diff --git a/node_modules/request/node_modules/qs/component.json b/node_modules/request/node_modules/qs/component.json
new file mode 100644
index 000000000..1a1f72c7a
--- /dev/null
+++ b/node_modules/request/node_modules/qs/component.json
@@ -0,0 +1,15 @@
+{
+ "name": "qs",
+ "repository": "hapijs/qs",
+ "description": "query-string parser / stringifier with nesting support",
+ "version": "5.1.0",
+ "keywords": ["querystring", "query", "parser"],
+ "main": "lib/index.js",
+ "scripts": [
+ "lib/index.js",
+ "lib/parse.js",
+ "lib/stringify.js",
+ "lib/utils.js"
+ ],
+ "license": "BSD-3-Clause"
+}
diff --git a/node_modules/request/node_modules/qs/dist/qs.js b/node_modules/request/node_modules/qs/dist/qs.js
new file mode 100644
index 000000000..b72e97682
--- /dev/null
+++ b/node_modules/request/node_modules/qs/dist/qs.js
@@ -0,0 +1,544 @@
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
+// Load modules
+
+var Stringify = require('./stringify');
+var Parse = require('./parse');
+
+
+// Declare internals
+
+var internals = {};
+
+
+module.exports = {
+ stringify: Stringify,
+ parse: Parse
+};
+
+},{"./parse":2,"./stringify":3}],2:[function(require,module,exports){
+// Load modules
+
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {
+ delimiter: '&',
+ depth: 5,
+ arrayLimit: 20,
+ parameterLimit: 1000,
+ strictNullHandling: false,
+ plainObjects: false,
+ allowPrototypes: false,
+ allowDots: false
+};
+
+
+internals.parseValues = function (str, options) {
+
+ var obj = {};
+ var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit);
+
+ for (var i = 0, il = parts.length; i < il; ++i) {
+ var part = parts[i];
+ var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1;
+
+ if (pos === -1) {
+ obj[Utils.decode(part)] = '';
+
+ if (options.strictNullHandling) {
+ obj[Utils.decode(part)] = null;
+ }
+ }
+ else {
+ var key = Utils.decode(part.slice(0, pos));
+ var val = Utils.decode(part.slice(pos + 1));
+
+ if (!Object.prototype.hasOwnProperty.call(obj, key)) {
+ obj[key] = val;
+ }
+ else {
+ obj[key] = [].concat(obj[key]).concat(val);
+ }
+ }
+ }
+
+ return obj;
+};
+
+
+internals.parseObject = function (chain, val, options) {
+
+ if (!chain.length) {
+ return val;
+ }
+
+ var root = chain.shift();
+
+ var obj;
+ if (root === '[]') {
+ obj = [];
+ obj = obj.concat(internals.parseObject(chain, val, options));
+ }
+ else {
+ obj = options.plainObjects ? Object.create(null) : {};
+ var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root;
+ var index = parseInt(cleanRoot, 10);
+ var indexString = '' + index;
+ if (!isNaN(index) &&
+ root !== cleanRoot &&
+ indexString === cleanRoot &&
+ index >= 0 &&
+ (options.parseArrays &&
+ index <= options.arrayLimit)) {
+
+ obj = [];
+ obj[index] = internals.parseObject(chain, val, options);
+ }
+ else {
+ obj[cleanRoot] = internals.parseObject(chain, val, options);
+ }
+ }
+
+ return obj;
+};
+
+
+internals.parseKeys = function (key, val, options) {
+
+ if (!key) {
+ return;
+ }
+
+ // Transform dot notation to bracket notation
+
+ if (options.allowDots) {
+ key = key.replace(/\.([^\.\[]+)/g, '[$1]');
+ }
+
+ // The regex chunks
+
+ var parent = /^([^\[\]]*)/;
+ var child = /(\[[^\[\]]*\])/g;
+
+ // Get the parent
+
+ var segment = parent.exec(key);
+
+ // Stash the parent if it exists
+
+ var keys = [];
+ if (segment[1]) {
+ // If we aren't using plain objects, optionally prefix keys
+ // that would overwrite object prototype properties
+ if (!options.plainObjects &&
+ Object.prototype.hasOwnProperty(segment[1])) {
+
+ if (!options.allowPrototypes) {
+ return;
+ }
+ }
+
+ keys.push(segment[1]);
+ }
+
+ // Loop through children appending to the array until we hit depth
+
+ var i = 0;
+ while ((segment = child.exec(key)) !== null && i < options.depth) {
+
+ ++i;
+ if (!options.plainObjects &&
+ Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) {
+
+ if (!options.allowPrototypes) {
+ continue;
+ }
+ }
+ keys.push(segment[1]);
+ }
+
+ // If there's a remainder, just add whatever is left
+
+ if (segment) {
+ keys.push('[' + key.slice(segment.index) + ']');
+ }
+
+ return internals.parseObject(keys, val, options);
+};
+
+
+module.exports = function (str, options) {
+
+ options = options || {};
+ options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter;
+ options.depth = typeof options.depth === 'number' ? options.depth : internals.depth;
+ options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit;
+ options.parseArrays = options.parseArrays !== false;
+ options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : internals.allowDots;
+ options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : internals.plainObjects;
+ options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : internals.allowPrototypes;
+ options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit;
+ options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling;
+
+ if (str === '' ||
+ str === null ||
+ typeof str === 'undefined') {
+
+ return options.plainObjects ? Object.create(null) : {};
+ }
+
+ var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str;
+ var obj = options.plainObjects ? Object.create(null) : {};
+
+ // Iterate over the keys and setup the new object
+
+ var keys = Object.keys(tempObj);
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ var newObj = internals.parseKeys(key, tempObj[key], options);
+ obj = Utils.merge(obj, newObj, options);
+ }
+
+ return Utils.compact(obj);
+};
+
+},{"./utils":4}],3:[function(require,module,exports){
+// Load modules
+
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {
+ delimiter: '&',
+ arrayPrefixGenerators: {
+ brackets: function (prefix, key) {
+
+ return prefix + '[]';
+ },
+ indices: function (prefix, key) {
+
+ return prefix + '[' + key + ']';
+ },
+ repeat: function (prefix, key) {
+
+ return prefix;
+ }
+ },
+ strictNullHandling: false,
+ skipNulls: false,
+ encode: true
+};
+
+
+internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter) {
+
+ if (typeof filter === 'function') {
+ obj = filter(prefix, obj);
+ }
+ else if (Utils.isBuffer(obj)) {
+ obj = obj.toString();
+ }
+ else if (obj instanceof Date) {
+ obj = obj.toISOString();
+ }
+ else if (obj === null) {
+ if (strictNullHandling) {
+ return encode ? Utils.encode(prefix) : prefix;
+ }
+
+ obj = '';
+ }
+
+ if (typeof obj === 'string' ||
+ typeof obj === 'number' ||
+ typeof obj === 'boolean') {
+
+ if (encode) {
+ return [Utils.encode(prefix) + '=' + Utils.encode(obj)];
+ }
+ return [prefix + '=' + obj];
+ }
+
+ var values = [];
+
+ if (typeof obj === 'undefined') {
+ return values;
+ }
+
+ var objKeys = Array.isArray(filter) ? filter : Object.keys(obj);
+ for (var i = 0, il = objKeys.length; i < il; ++i) {
+ var key = objKeys[i];
+
+ if (skipNulls &&
+ obj[key] === null) {
+
+ continue;
+ }
+
+ if (Array.isArray(obj)) {
+ values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+ }
+ else {
+ values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+ }
+ }
+
+ return values;
+};
+
+
+module.exports = function (obj, options) {
+
+ options = options || {};
+ var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter;
+ var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling;
+ var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls;
+ var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode;
+ var objKeys;
+ var filter;
+ if (typeof options.filter === 'function') {
+ filter = options.filter;
+ obj = filter('', obj);
+ }
+ else if (Array.isArray(options.filter)) {
+ objKeys = filter = options.filter;
+ }
+
+ var keys = [];
+
+ if (typeof obj !== 'object' ||
+ obj === null) {
+
+ return '';
+ }
+
+ var arrayFormat;
+ if (options.arrayFormat in internals.arrayPrefixGenerators) {
+ arrayFormat = options.arrayFormat;
+ }
+ else if ('indices' in options) {
+ arrayFormat = options.indices ? 'indices' : 'repeat';
+ }
+ else {
+ arrayFormat = 'indices';
+ }
+
+ var generateArrayPrefix = internals.arrayPrefixGenerators[arrayFormat];
+
+ if (!objKeys) {
+ objKeys = Object.keys(obj);
+ }
+
+ for (var i = 0, il = objKeys.length; i < il; ++i) {
+ var key = objKeys[i];
+
+ if (skipNulls &&
+ obj[key] === null) {
+
+ continue;
+ }
+
+ keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+ }
+
+ return keys.join(delimiter);
+};
+
+},{"./utils":4}],4:[function(require,module,exports){
+// Load modules
+
+
+// Declare internals
+
+var internals = {};
+internals.hexTable = new Array(256);
+for (var h = 0; h < 256; ++h) {
+ internals.hexTable[h] = '%' + ((h < 16 ? '0' : '') + h.toString(16)).toUpperCase();
+}
+
+
+exports.arrayToObject = function (source, options) {
+
+ var obj = options.plainObjects ? Object.create(null) : {};
+ for (var i = 0, il = source.length; i < il; ++i) {
+ if (typeof source[i] !== 'undefined') {
+
+ obj[i] = source[i];
+ }
+ }
+
+ return obj;
+};
+
+
+exports.merge = function (target, source, options) {
+
+ if (!source) {
+ return target;
+ }
+
+ if (typeof source !== 'object') {
+ if (Array.isArray(target)) {
+ target.push(source);
+ }
+ else if (typeof target === 'object') {
+ target[source] = true;
+ }
+ else {
+ target = [target, source];
+ }
+
+ return target;
+ }
+
+ if (typeof target !== 'object') {
+ target = [target].concat(source);
+ return target;
+ }
+
+ if (Array.isArray(target) &&
+ !Array.isArray(source)) {
+
+ target = exports.arrayToObject(target, options);
+ }
+
+ var keys = Object.keys(source);
+ for (var k = 0, kl = keys.length; k < kl; ++k) {
+ var key = keys[k];
+ var value = source[key];
+
+ if (!Object.prototype.hasOwnProperty.call(target, key)) {
+ target[key] = value;
+ }
+ else {
+ target[key] = exports.merge(target[key], value, options);
+ }
+ }
+
+ return target;
+};
+
+
+exports.decode = function (str) {
+
+ try {
+ return decodeURIComponent(str.replace(/\+/g, ' '));
+ } catch (e) {
+ return str;
+ }
+};
+
+exports.encode = function (str) {
+
+ // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
+ // It has been adapted here for stricter adherence to RFC 3986
+ if (str.length === 0) {
+ return str;
+ }
+
+ if (typeof str !== 'string') {
+ str = '' + str;
+ }
+
+ var out = '';
+ for (var i = 0, il = str.length; i < il; ++i) {
+ var c = str.charCodeAt(i);
+
+ if (c === 0x2D || // -
+ c === 0x2E || // .
+ c === 0x5F || // _
+ c === 0x7E || // ~
+ (c >= 0x30 && c <= 0x39) || // 0-9
+ (c >= 0x41 && c <= 0x5A) || // a-z
+ (c >= 0x61 && c <= 0x7A)) { // A-Z
+
+ out += str[i];
+ continue;
+ }
+
+ if (c < 0x80) {
+ out += internals.hexTable[c];
+ continue;
+ }
+
+ if (c < 0x800) {
+ out += internals.hexTable[0xC0 | (c >> 6)] + internals.hexTable[0x80 | (c & 0x3F)];
+ continue;
+ }
+
+ if (c < 0xD800 || c >= 0xE000) {
+ out += internals.hexTable[0xE0 | (c >> 12)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)];
+ continue;
+ }
+
+ ++i;
+ c = 0x10000 + (((c & 0x3FF) << 10) | (str.charCodeAt(i) & 0x3FF));
+ out += internals.hexTable[0xF0 | (c >> 18)] + internals.hexTable[0x80 | ((c >> 12) & 0x3F)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)];
+ }
+
+ return out;
+};
+
+exports.compact = function (obj, refs) {
+
+ if (typeof obj !== 'object' ||
+ obj === null) {
+
+ return obj;
+ }
+
+ refs = refs || [];
+ var lookup = refs.indexOf(obj);
+ if (lookup !== -1) {
+ return refs[lookup];
+ }
+
+ refs.push(obj);
+
+ if (Array.isArray(obj)) {
+ var compacted = [];
+
+ for (var i = 0, il = obj.length; i < il; ++i) {
+ if (typeof obj[i] !== 'undefined') {
+ compacted.push(obj[i]);
+ }
+ }
+
+ return compacted;
+ }
+
+ var keys = Object.keys(obj);
+ for (i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ obj[key] = exports.compact(obj[key], refs);
+ }
+
+ return obj;
+};
+
+
+exports.isRegExp = function (obj) {
+
+ return Object.prototype.toString.call(obj) === '[object RegExp]';
+};
+
+
+exports.isBuffer = function (obj) {
+
+ if (obj === null ||
+ typeof obj === 'undefined') {
+
+ return false;
+ }
+
+ return !!(obj.constructor &&
+ obj.constructor.isBuffer &&
+ obj.constructor.isBuffer(obj));
+};
+
+},{}]},{},[1])(1)
+}); \ No newline at end of file
diff --git a/node_modules/request/node_modules/qs/lib/index.js b/node_modules/request/node_modules/qs/lib/index.js
new file mode 100644
index 000000000..0e094933d
--- /dev/null
+++ b/node_modules/request/node_modules/qs/lib/index.js
@@ -0,0 +1,15 @@
+// Load modules
+
+var Stringify = require('./stringify');
+var Parse = require('./parse');
+
+
+// Declare internals
+
+var internals = {};
+
+
+module.exports = {
+ stringify: Stringify,
+ parse: Parse
+};
diff --git a/node_modules/request/node_modules/qs/lib/parse.js b/node_modules/request/node_modules/qs/lib/parse.js
new file mode 100644
index 000000000..4a2137efa
--- /dev/null
+++ b/node_modules/request/node_modules/qs/lib/parse.js
@@ -0,0 +1,187 @@
+// Load modules
+
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {
+ delimiter: '&',
+ depth: 5,
+ arrayLimit: 20,
+ parameterLimit: 1000,
+ strictNullHandling: false,
+ plainObjects: false,
+ allowPrototypes: false,
+ allowDots: false
+};
+
+
+internals.parseValues = function (str, options) {
+
+ var obj = {};
+ var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit);
+
+ for (var i = 0, il = parts.length; i < il; ++i) {
+ var part = parts[i];
+ var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1;
+
+ if (pos === -1) {
+ obj[Utils.decode(part)] = '';
+
+ if (options.strictNullHandling) {
+ obj[Utils.decode(part)] = null;
+ }
+ }
+ else {
+ var key = Utils.decode(part.slice(0, pos));
+ var val = Utils.decode(part.slice(pos + 1));
+
+ if (!Object.prototype.hasOwnProperty.call(obj, key)) {
+ obj[key] = val;
+ }
+ else {
+ obj[key] = [].concat(obj[key]).concat(val);
+ }
+ }
+ }
+
+ return obj;
+};
+
+
+internals.parseObject = function (chain, val, options) {
+
+ if (!chain.length) {
+ return val;
+ }
+
+ var root = chain.shift();
+
+ var obj;
+ if (root === '[]') {
+ obj = [];
+ obj = obj.concat(internals.parseObject(chain, val, options));
+ }
+ else {
+ obj = options.plainObjects ? Object.create(null) : {};
+ var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root;
+ var index = parseInt(cleanRoot, 10);
+ var indexString = '' + index;
+ if (!isNaN(index) &&
+ root !== cleanRoot &&
+ indexString === cleanRoot &&
+ index >= 0 &&
+ (options.parseArrays &&
+ index <= options.arrayLimit)) {
+
+ obj = [];
+ obj[index] = internals.parseObject(chain, val, options);
+ }
+ else {
+ obj[cleanRoot] = internals.parseObject(chain, val, options);
+ }
+ }
+
+ return obj;
+};
+
+
+internals.parseKeys = function (key, val, options) {
+
+ if (!key) {
+ return;
+ }
+
+ // Transform dot notation to bracket notation
+
+ if (options.allowDots) {
+ key = key.replace(/\.([^\.\[]+)/g, '[$1]');
+ }
+
+ // The regex chunks
+
+ var parent = /^([^\[\]]*)/;
+ var child = /(\[[^\[\]]*\])/g;
+
+ // Get the parent
+
+ var segment = parent.exec(key);
+
+ // Stash the parent if it exists
+
+ var keys = [];
+ if (segment[1]) {
+ // If we aren't using plain objects, optionally prefix keys
+ // that would overwrite object prototype properties
+ if (!options.plainObjects &&
+ Object.prototype.hasOwnProperty(segment[1])) {
+
+ if (!options.allowPrototypes) {
+ return;
+ }
+ }
+
+ keys.push(segment[1]);
+ }
+
+ // Loop through children appending to the array until we hit depth
+
+ var i = 0;
+ while ((segment = child.exec(key)) !== null && i < options.depth) {
+
+ ++i;
+ if (!options.plainObjects &&
+ Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) {
+
+ if (!options.allowPrototypes) {
+ continue;
+ }
+ }
+ keys.push(segment[1]);
+ }
+
+ // If there's a remainder, just add whatever is left
+
+ if (segment) {
+ keys.push('[' + key.slice(segment.index) + ']');
+ }
+
+ return internals.parseObject(keys, val, options);
+};
+
+
+module.exports = function (str, options) {
+
+ options = options || {};
+ options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter;
+ options.depth = typeof options.depth === 'number' ? options.depth : internals.depth;
+ options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit;
+ options.parseArrays = options.parseArrays !== false;
+ options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : internals.allowDots;
+ options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : internals.plainObjects;
+ options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : internals.allowPrototypes;
+ options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit;
+ options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling;
+
+ if (str === '' ||
+ str === null ||
+ typeof str === 'undefined') {
+
+ return options.plainObjects ? Object.create(null) : {};
+ }
+
+ var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str;
+ var obj = options.plainObjects ? Object.create(null) : {};
+
+ // Iterate over the keys and setup the new object
+
+ var keys = Object.keys(tempObj);
+ for (var i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ var newObj = internals.parseKeys(key, tempObj[key], options);
+ obj = Utils.merge(obj, newObj, options);
+ }
+
+ return Utils.compact(obj);
+};
diff --git a/node_modules/request/node_modules/qs/lib/stringify.js b/node_modules/request/node_modules/qs/lib/stringify.js
new file mode 100644
index 000000000..d05aa8752
--- /dev/null
+++ b/node_modules/request/node_modules/qs/lib/stringify.js
@@ -0,0 +1,154 @@
+// Load modules
+
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {
+ delimiter: '&',
+ arrayPrefixGenerators: {
+ brackets: function (prefix, key) {
+
+ return prefix + '[]';
+ },
+ indices: function (prefix, key) {
+
+ return prefix + '[' + key + ']';
+ },
+ repeat: function (prefix, key) {
+
+ return prefix;
+ }
+ },
+ strictNullHandling: false,
+ skipNulls: false,
+ encode: true
+};
+
+
+internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort) {
+
+ if (typeof filter === 'function') {
+ obj = filter(prefix, obj);
+ }
+ else if (Utils.isBuffer(obj)) {
+ obj = obj.toString();
+ }
+ else if (obj instanceof Date) {
+ obj = obj.toISOString();
+ }
+ else if (obj === null) {
+ if (strictNullHandling) {
+ return encode ? Utils.encode(prefix) : prefix;
+ }
+
+ obj = '';
+ }
+
+ if (typeof obj === 'string' ||
+ typeof obj === 'number' ||
+ typeof obj === 'boolean') {
+
+ if (encode) {
+ return [Utils.encode(prefix) + '=' + Utils.encode(obj)];
+ }
+ return [prefix + '=' + obj];
+ }
+
+ var values = [];
+
+ if (typeof obj === 'undefined') {
+ return values;
+ }
+
+ var objKeys;
+ if (Array.isArray(filter)) {
+ objKeys = filter;
+ } else {
+ var keys = Object.keys(obj);
+ objKeys = sort ? keys.sort(sort) : keys;
+ }
+
+ for (var i = 0, il = objKeys.length; i < il; ++i) {
+ var key = objKeys[i];
+
+ if (skipNulls &&
+ obj[key] === null) {
+
+ continue;
+ }
+
+ if (Array.isArray(obj)) {
+ values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+ }
+ else {
+ values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+ }
+ }
+
+ return values;
+};
+
+
+module.exports = function (obj, options) {
+
+ options = options || {};
+ var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter;
+ var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling;
+ var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls;
+ var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode;
+ var sort = typeof options.sort === 'function' ? options.sort : null;
+ var objKeys;
+ var filter;
+ if (typeof options.filter === 'function') {
+ filter = options.filter;
+ obj = filter('', obj);
+ }
+ else if (Array.isArray(options.filter)) {
+ objKeys = filter = options.filter;
+ }
+
+ var keys = [];
+
+ if (typeof obj !== 'object' ||
+ obj === null) {
+
+ return '';
+ }
+
+ var arrayFormat;
+ if (options.arrayFormat in internals.arrayPrefixGenerators) {
+ arrayFormat = options.arrayFormat;
+ }
+ else if ('indices' in options) {
+ arrayFormat = options.indices ? 'indices' : 'repeat';
+ }
+ else {
+ arrayFormat = 'indices';
+ }
+
+ var generateArrayPrefix = internals.arrayPrefixGenerators[arrayFormat];
+
+ if (!objKeys) {
+ objKeys = Object.keys(obj);
+ }
+
+ if (sort) {
+ objKeys.sort(sort);
+ }
+
+ for (var i = 0, il = objKeys.length; i < il; ++i) {
+ var key = objKeys[i];
+
+ if (skipNulls &&
+ obj[key] === null) {
+
+ continue;
+ }
+
+ keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort));
+ }
+
+ return keys.join(delimiter);
+};
diff --git a/node_modules/request/node_modules/qs/lib/utils.js b/node_modules/request/node_modules/qs/lib/utils.js
new file mode 100644
index 000000000..88f314732
--- /dev/null
+++ b/node_modules/request/node_modules/qs/lib/utils.js
@@ -0,0 +1,190 @@
+// Load modules
+
+
+// Declare internals
+
+var internals = {};
+internals.hexTable = new Array(256);
+for (var h = 0; h < 256; ++h) {
+ internals.hexTable[h] = '%' + ((h < 16 ? '0' : '') + h.toString(16)).toUpperCase();
+}
+
+
+exports.arrayToObject = function (source, options) {
+
+ var obj = options.plainObjects ? Object.create(null) : {};
+ for (var i = 0, il = source.length; i < il; ++i) {
+ if (typeof source[i] !== 'undefined') {
+
+ obj[i] = source[i];
+ }
+ }
+
+ return obj;
+};
+
+
+exports.merge = function (target, source, options) {
+
+ if (!source) {
+ return target;
+ }
+
+ if (typeof source !== 'object') {
+ if (Array.isArray(target)) {
+ target.push(source);
+ }
+ else if (typeof target === 'object') {
+ target[source] = true;
+ }
+ else {
+ target = [target, source];
+ }
+
+ return target;
+ }
+
+ if (typeof target !== 'object') {
+ target = [target].concat(source);
+ return target;
+ }
+
+ if (Array.isArray(target) &&
+ !Array.isArray(source)) {
+
+ target = exports.arrayToObject(target, options);
+ }
+
+ var keys = Object.keys(source);
+ for (var k = 0, kl = keys.length; k < kl; ++k) {
+ var key = keys[k];
+ var value = source[key];
+
+ if (!Object.prototype.hasOwnProperty.call(target, key)) {
+ target[key] = value;
+ }
+ else {
+ target[key] = exports.merge(target[key], value, options);
+ }
+ }
+
+ return target;
+};
+
+
+exports.decode = function (str) {
+
+ try {
+ return decodeURIComponent(str.replace(/\+/g, ' '));
+ } catch (e) {
+ return str;
+ }
+};
+
+exports.encode = function (str) {
+
+ // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
+ // It has been adapted here for stricter adherence to RFC 3986
+ if (str.length === 0) {
+ return str;
+ }
+
+ if (typeof str !== 'string') {
+ str = '' + str;
+ }
+
+ var out = '';
+ for (var i = 0, il = str.length; i < il; ++i) {
+ var c = str.charCodeAt(i);
+
+ if (c === 0x2D || // -
+ c === 0x2E || // .
+ c === 0x5F || // _
+ c === 0x7E || // ~
+ (c >= 0x30 && c <= 0x39) || // 0-9
+ (c >= 0x41 && c <= 0x5A) || // a-z
+ (c >= 0x61 && c <= 0x7A)) { // A-Z
+
+ out += str[i];
+ continue;
+ }
+
+ if (c < 0x80) {
+ out += internals.hexTable[c];
+ continue;
+ }
+
+ if (c < 0x800) {
+ out += internals.hexTable[0xC0 | (c >> 6)] + internals.hexTable[0x80 | (c & 0x3F)];
+ continue;
+ }
+
+ if (c < 0xD800 || c >= 0xE000) {
+ out += internals.hexTable[0xE0 | (c >> 12)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)];
+ continue;
+ }
+
+ ++i;
+ c = 0x10000 + (((c & 0x3FF) << 10) | (str.charCodeAt(i) & 0x3FF));
+ out += internals.hexTable[0xF0 | (c >> 18)] + internals.hexTable[0x80 | ((c >> 12) & 0x3F)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)];
+ }
+
+ return out;
+};
+
+exports.compact = function (obj, refs) {
+
+ if (typeof obj !== 'object' ||
+ obj === null) {
+
+ return obj;
+ }
+
+ refs = refs || [];
+ var lookup = refs.indexOf(obj);
+ if (lookup !== -1) {
+ return refs[lookup];
+ }
+
+ refs.push(obj);
+
+ if (Array.isArray(obj)) {
+ var compacted = [];
+
+ for (var i = 0, il = obj.length; i < il; ++i) {
+ if (typeof obj[i] !== 'undefined') {
+ compacted.push(obj[i]);
+ }
+ }
+
+ return compacted;
+ }
+
+ var keys = Object.keys(obj);
+ for (i = 0, il = keys.length; i < il; ++i) {
+ var key = keys[i];
+ obj[key] = exports.compact(obj[key], refs);
+ }
+
+ return obj;
+};
+
+
+exports.isRegExp = function (obj) {
+
+ return Object.prototype.toString.call(obj) === '[object RegExp]';
+};
+
+
+exports.isBuffer = function (obj) {
+
+ if (obj === null ||
+ typeof obj === 'undefined') {
+
+ return false;
+ }
+
+ return !!(obj.constructor &&
+ obj.constructor.isBuffer &&
+ obj.constructor.isBuffer(obj));
+};
diff --git a/node_modules/request/node_modules/qs/package.json b/node_modules/request/node_modules/qs/package.json
new file mode 100644
index 000000000..7e60df700
--- /dev/null
+++ b/node_modules/request/node_modules/qs/package.json
@@ -0,0 +1,59 @@
+{
+ "name": "qs",
+ "description": "A querystring parser that supports nesting and arrays, with a depth limit",
+ "homepage": "https://github.com/hapijs/qs",
+ "version": "5.2.0",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/hapijs/qs.git"
+ },
+ "main": "lib/index.js",
+ "keywords": [
+ "querystring",
+ "qs"
+ ],
+ "engines": ">=0.10.40",
+ "dependencies": {},
+ "devDependencies": {
+ "browserify": "^10.2.1",
+ "code": "1.x.x",
+ "lab": "5.x.x"
+ },
+ "scripts": {
+ "test": "lab -a code -t 100 -L",
+ "test-tap": "lab -a code -r tap -o tests.tap",
+ "test-cov-html": "lab -a code -r html -o coverage.html",
+ "dist": "browserify --standalone Qs lib/index.js > dist/qs.js"
+ },
+ "license": "BSD-3-Clause",
+ "gitHead": "a341cdf2fadba5ede1ce6c95c7051f6f31f37b81",
+ "bugs": {
+ "url": "https://github.com/hapijs/qs/issues"
+ },
+ "_id": "qs@5.2.0",
+ "_shasum": "a9f31142af468cb72b25b30136ba2456834916be",
+ "_from": "qs@>=5.2.0 <5.3.0",
+ "_npmVersion": "3.3.5",
+ "_nodeVersion": "0.10.40",
+ "_npmUser": {
+ "name": "nlf",
+ "email": "quitlahok@gmail.com"
+ },
+ "dist": {
+ "shasum": "a9f31142af468cb72b25b30136ba2456834916be",
+ "tarball": "http://registry.npmjs.org/qs/-/qs-5.2.0.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "nlf",
+ "email": "quitlahok@gmail.com"
+ },
+ {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/qs/-/qs-5.2.0.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
new file mode 100644
index 000000000..679f19747
--- /dev/null
+++ b/node_modules/request/node_modules/qs/test/parse.js
@@ -0,0 +1,478 @@
+/* eslint no-extend-native:0 */
+// Load modules
+
+var Code = require('code');
+var Lab = require('lab');
+var Qs = require('../');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var expect = Code.expect;
+var describe = lab.experiment;
+var it = lab.test;
+
+
+describe('parse()', function () {
+
+ it('parses a simple string', function (done) {
+
+ expect(Qs.parse('0=foo')).to.deep.equal({ '0': 'foo' });
+ expect(Qs.parse('foo=c++')).to.deep.equal({ foo: 'c ' });
+ expect(Qs.parse('a[>=]=23')).to.deep.equal({ a: { '>=': '23' } });
+ expect(Qs.parse('a[<=>]==23')).to.deep.equal({ a: { '<=>': '=23' } });
+ expect(Qs.parse('a[==]=23')).to.deep.equal({ a: { '==': '23' } });
+ expect(Qs.parse('foo', { strictNullHandling: true })).to.deep.equal({ foo: null });
+ expect(Qs.parse('foo' )).to.deep.equal({ foo: '' });
+ expect(Qs.parse('foo=')).to.deep.equal({ foo: '' });
+ expect(Qs.parse('foo=bar')).to.deep.equal({ foo: 'bar' });
+ expect(Qs.parse(' foo = bar = baz ')).to.deep.equal({ ' foo ': ' bar = baz ' });
+ expect(Qs.parse('foo=bar=baz')).to.deep.equal({ foo: 'bar=baz' });
+ expect(Qs.parse('foo=bar&bar=baz')).to.deep.equal({ foo: 'bar', bar: 'baz' });
+ expect(Qs.parse('foo2=bar2&baz2=')).to.deep.equal({ foo2: 'bar2', baz2: '' });
+ expect(Qs.parse('foo=bar&baz', { strictNullHandling: true })).to.deep.equal({ foo: 'bar', baz: null });
+ expect(Qs.parse('foo=bar&baz')).to.deep.equal({ foo: 'bar', baz: '' });
+ expect(Qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World')).to.deep.equal({
+ cht: 'p3',
+ chd: 't:60,40',
+ chs: '250x100',
+ chl: 'Hello|World'
+ });
+ done();
+ });
+
+ it('allows enabling dot notation', function (done) {
+
+ expect(Qs.parse('a.b=c')).to.deep.equal({ 'a.b': 'c' });
+ expect(Qs.parse('a.b=c', { allowDots: true })).to.deep.equal({ a: { b: 'c' } });
+ done();
+ });
+
+ it('parses a single nested string', function (done) {
+
+ expect(Qs.parse('a[b]=c')).to.deep.equal({ a: { b: 'c' } });
+ done();
+ });
+
+ it('parses a double nested string', function (done) {
+
+ expect(Qs.parse('a[b][c]=d')).to.deep.equal({ a: { b: { c: 'd' } } });
+ done();
+ });
+
+ it('defaults to a depth of 5', function (done) {
+
+ expect(Qs.parse('a[b][c][d][e][f][g][h]=i')).to.deep.equal({ a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } });
+ done();
+ });
+
+ it('only parses one level when depth = 1', function (done) {
+
+ expect(Qs.parse('a[b][c]=d', { depth: 1 })).to.deep.equal({ a: { b: { '[c]': 'd' } } });
+ expect(Qs.parse('a[b][c][d]=e', { depth: 1 })).to.deep.equal({ a: { b: { '[c][d]': 'e' } } });
+ done();
+ });
+
+ it('parses a simple array', function (done) {
+
+ expect(Qs.parse('a=b&a=c')).to.deep.equal({ a: ['b', 'c'] });
+ done();
+ });
+
+ it('parses an explicit array', function (done) {
+
+ expect(Qs.parse('a[]=b')).to.deep.equal({ a: ['b'] });
+ expect(Qs.parse('a[]=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] });
+ expect(Qs.parse('a[]=b&a[]=c&a[]=d')).to.deep.equal({ a: ['b', 'c', 'd'] });
+ done();
+ });
+
+ it('parses a mix of simple and explicit arrays', function (done) {
+
+ expect(Qs.parse('a=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] });
+ expect(Qs.parse('a[]=b&a=c')).to.deep.equal({ a: ['b', 'c'] });
+ expect(Qs.parse('a[0]=b&a=c')).to.deep.equal({ a: ['b', 'c'] });
+ expect(Qs.parse('a=b&a[0]=c')).to.deep.equal({ a: ['b', 'c'] });
+ expect(Qs.parse('a[1]=b&a=c')).to.deep.equal({ a: ['b', 'c'] });
+ expect(Qs.parse('a=b&a[1]=c')).to.deep.equal({ a: ['b', 'c'] });
+ done();
+ });
+
+ it('parses a nested array', function (done) {
+
+ expect(Qs.parse('a[b][]=c&a[b][]=d')).to.deep.equal({ a: { b: ['c', 'd'] } });
+ expect(Qs.parse('a[>=]=25')).to.deep.equal({ a: { '>=': '25' } });
+ done();
+ });
+
+ it('allows to specify array indices', function (done) {
+
+ expect(Qs.parse('a[1]=c&a[0]=b&a[2]=d')).to.deep.equal({ a: ['b', 'c', 'd'] });
+ expect(Qs.parse('a[1]=c&a[0]=b')).to.deep.equal({ a: ['b', 'c'] });
+ expect(Qs.parse('a[1]=c')).to.deep.equal({ a: ['c'] });
+ done();
+ });
+
+ it('limits specific array indices to 20', function (done) {
+
+ expect(Qs.parse('a[20]=a')).to.deep.equal({ a: ['a'] });
+ expect(Qs.parse('a[21]=a')).to.deep.equal({ a: { '21': 'a' } });
+ done();
+ });
+
+ it('supports keys that begin with a number', function (done) {
+
+ expect(Qs.parse('a[12b]=c')).to.deep.equal({ a: { '12b': 'c' } });
+ done();
+ });
+
+ it('supports encoded = signs', function (done) {
+
+ expect(Qs.parse('he%3Dllo=th%3Dere')).to.deep.equal({ 'he=llo': 'th=ere' });
+ done();
+ });
+
+ it('is ok with url encoded strings', function (done) {
+
+ expect(Qs.parse('a[b%20c]=d')).to.deep.equal({ a: { 'b c': 'd' } });
+ expect(Qs.parse('a[b]=c%20d')).to.deep.equal({ a: { b: 'c d' } });
+ done();
+ });
+
+ it('allows brackets in the value', function (done) {
+
+ expect(Qs.parse('pets=["tobi"]')).to.deep.equal({ pets: '["tobi"]' });
+ expect(Qs.parse('operators=[">=", "<="]')).to.deep.equal({ operators: '[">=", "<="]' });
+ done();
+ });
+
+ it('allows empty values', function (done) {
+
+ expect(Qs.parse('')).to.deep.equal({});
+ expect(Qs.parse(null)).to.deep.equal({});
+ expect(Qs.parse(undefined)).to.deep.equal({});
+ done();
+ });
+
+ it('transforms arrays to objects', function (done) {
+
+ expect(Qs.parse('foo[0]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } });
+ expect(Qs.parse('foo[bad]=baz&foo[0]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
+ expect(Qs.parse('foo[bad]=baz&foo[]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
+ expect(Qs.parse('foo[]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } });
+ expect(Qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } });
+ expect(Qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb')).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
+ expect(Qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c')).to.deep.equal({ a: { '0': 'b', t: 'u', c: true } });
+ expect(Qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y')).to.deep.equal({ a: { '0': 'b', '1': 'c', x: 'y' } });
+ done();
+ });
+
+ it('transforms arrays to objects (dot notation)', function (done) {
+
+ expect(Qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true })).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: 'baz' } });
+ expect(Qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true })).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } });
+ expect(Qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true })).to.deep.equal({ foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } });
+ expect(Qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true })).to.deep.equal({ foo: [{ baz: ['15'], bar: '2' }] });
+ expect(Qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true })).to.deep.equal({ foo: [{ baz: ['15', '16'], bar: '2' }] });
+ expect(Qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
+ expect(Qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
+ expect(Qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true })).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } });
+ expect(Qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } });
+ expect(Qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true })).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
+ done();
+ });
+
+ it('can add keys to objects', function (done) {
+
+ expect(Qs.parse('a[b]=c&a=d')).to.deep.equal({ a: { b: 'c', d: true } });
+ done();
+ });
+
+ it('correctly prunes undefined values when converting an array to an object', function (done) {
+
+ expect(Qs.parse('a[2]=b&a[99999999]=c')).to.deep.equal({ a: { '2': 'b', '99999999': 'c' } });
+ done();
+ });
+
+ it('supports malformed uri characters', function (done) {
+
+ expect(Qs.parse('{%:%}', { strictNullHandling: true })).to.deep.equal({ '{%:%}': null });
+ expect(Qs.parse('{%:%}=')).to.deep.equal({ '{%:%}': '' });
+ expect(Qs.parse('foo=%:%}')).to.deep.equal({ foo: '%:%}' });
+ done();
+ });
+
+ it('doesn\'t produce empty keys', function (done) {
+
+ expect(Qs.parse('_r=1&')).to.deep.equal({ '_r': '1' });
+ done();
+ });
+
+ it('cannot access Object prototype', function (done) {
+
+ Qs.parse('constructor[prototype][bad]=bad');
+ Qs.parse('bad[constructor][prototype][bad]=bad');
+ expect(typeof Object.prototype.bad).to.equal('undefined');
+ done();
+ });
+
+ it('parses arrays of objects', function (done) {
+
+ expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] });
+ expect(Qs.parse('a[0][b]=c')).to.deep.equal({ a: [{ b: 'c' }] });
+ done();
+ });
+
+ it('allows for empty strings in arrays', function (done) {
+
+ expect(Qs.parse('a[]=b&a[]=&a[]=c')).to.deep.equal({ a: ['b', '', 'c'] });
+ expect(Qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true })).to.deep.equal({ a: ['b', null, 'c', ''] });
+ expect(Qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true })).to.deep.equal({ a: ['b', '', 'c', null] });
+ expect(Qs.parse('a[]=&a[]=b&a[]=c')).to.deep.equal({ a: ['', 'b', 'c'] });
+ done();
+ });
+
+ it('compacts sparse arrays', function (done) {
+
+ expect(Qs.parse('a[10]=1&a[2]=2')).to.deep.equal({ a: ['2', '1'] });
+ done();
+ });
+
+ it('parses semi-parsed strings', function (done) {
+
+ expect(Qs.parse({ 'a[b]': 'c' })).to.deep.equal({ a: { b: 'c' } });
+ expect(Qs.parse({ 'a[b]': 'c', 'a[d]': 'e' })).to.deep.equal({ a: { b: 'c', d: 'e' } });
+ done();
+ });
+
+ it('parses buffers correctly', function (done) {
+
+ var b = new Buffer('test');
+ expect(Qs.parse({ a: b })).to.deep.equal({ a: b });
+ done();
+ });
+
+ it('continues parsing when no parent is found', function (done) {
+
+ expect(Qs.parse('[]=&a=b')).to.deep.equal({ '0': '', a: 'b' });
+ expect(Qs.parse('[]&a=b', { strictNullHandling: true })).to.deep.equal({ '0': null, a: 'b' });
+ expect(Qs.parse('[foo]=bar')).to.deep.equal({ foo: 'bar' });
+ done();
+ });
+
+ it('does not error when parsing a very long array', function (done) {
+
+ var str = 'a[]=a';
+ while (Buffer.byteLength(str) < 128 * 1024) {
+ str += '&' + str;
+ }
+
+ expect(function () {
+
+ Qs.parse(str);
+ }).to.not.throw();
+
+ done();
+ });
+
+ it('should not throw when a native prototype has an enumerable property', { parallel: false }, function (done) {
+
+ Object.prototype.crash = '';
+ Array.prototype.crash = '';
+ expect(Qs.parse.bind(null, 'a=b')).to.not.throw();
+ expect(Qs.parse('a=b')).to.deep.equal({ a: 'b' });
+ expect(Qs.parse.bind(null, 'a[][b]=c')).to.not.throw();
+ expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] });
+ delete Object.prototype.crash;
+ delete Array.prototype.crash;
+ done();
+ });
+
+ it('parses a string with an alternative string delimiter', function (done) {
+
+ expect(Qs.parse('a=b;c=d', { delimiter: ';' })).to.deep.equal({ a: 'b', c: 'd' });
+ done();
+ });
+
+ it('parses a string with an alternative RegExp delimiter', function (done) {
+
+ expect(Qs.parse('a=b; c=d', { delimiter: /[;,] */ })).to.deep.equal({ a: 'b', c: 'd' });
+ done();
+ });
+
+ it('does not use non-splittable objects as delimiters', function (done) {
+
+ expect(Qs.parse('a=b&c=d', { delimiter: true })).to.deep.equal({ a: 'b', c: 'd' });
+ done();
+ });
+
+ it('allows overriding parameter limit', function (done) {
+
+ expect(Qs.parse('a=b&c=d', { parameterLimit: 1 })).to.deep.equal({ a: 'b' });
+ done();
+ });
+
+ it('allows setting the parameter limit to Infinity', function (done) {
+
+ expect(Qs.parse('a=b&c=d', { parameterLimit: Infinity })).to.deep.equal({ a: 'b', c: 'd' });
+ done();
+ });
+
+ 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();
+ });
+
+ it('allows disabling array parsing', function (done) {
+
+ expect(Qs.parse('a[0]=b&a[1]=c', { parseArrays: false })).to.deep.equal({ a: { '0': 'b', '1': 'c' } });
+ done();
+ });
+
+ it('parses an object', function (done) {
+
+ var input = {
+ 'user[name]': { 'pop[bob]': 3 },
+ 'user[email]': null
+ };
+
+ var expected = {
+ 'user': {
+ 'name': { 'pop[bob]': 3 },
+ 'email': null
+ }
+ };
+
+ var result = Qs.parse(input);
+
+ expect(result).to.deep.equal(expected);
+ done();
+ });
+
+ it('parses an object in dot notation', function (done) {
+
+ var input = {
+ 'user.name': { 'pop[bob]': 3 },
+ 'user.email.': null
+ };
+
+ var expected = {
+ 'user': {
+ 'name': { 'pop[bob]': 3 },
+ 'email': null
+ }
+ };
+
+ var result = Qs.parse(input, { allowDots: true });
+
+ expect(result).to.deep.equal(expected);
+ done();
+ });
+
+ it('parses an object and not child values', function (done) {
+
+ var input = {
+ 'user[name]': { 'pop[bob]': { 'test': 3 } },
+ 'user[email]': null
+ };
+
+ var expected = {
+ 'user': {
+ 'name': { 'pop[bob]': { 'test': 3 } },
+ 'email': null
+ }
+ };
+
+ var result = Qs.parse(input);
+
+ expect(result).to.deep.equal(expected);
+ done();
+ });
+
+ it('does not blow up when Buffer global is missing', function (done) {
+
+ var tempBuffer = global.Buffer;
+ delete global.Buffer;
+ var result = Qs.parse('a=b&c=d');
+ global.Buffer = tempBuffer;
+ expect(result).to.deep.equal({ a: 'b', c: 'd' });
+ done();
+ });
+
+ it('does not crash when parsing circular references', function (done) {
+
+ var a = {};
+ a.b = a;
+
+ var parsed;
+
+ expect(function () {
+
+ parsed = Qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a });
+ }).to.not.throw();
+
+ 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();
+ });
+
+ it('parses plain objects correctly', function (done) {
+
+ var a = Object.create(null);
+ a.b = 'c';
+
+ expect(Qs.parse(a)).to.deep.equal({ b: 'c' });
+ var result = Qs.parse({ a: a });
+ expect(result).to.contain('a');
+ expect(result.a).to.deep.equal(a);
+ done();
+ });
+
+ it('parses dates correctly', function (done) {
+
+ var now = new Date();
+ expect(Qs.parse({ a: now })).to.deep.equal({ a: now });
+ done();
+ });
+
+ it('parses regular expressions correctly', function (done) {
+
+ var re = /^test$/;
+ expect(Qs.parse({ a: re })).to.deep.equal({ a: re });
+ done();
+ });
+
+ it('can allow overwriting prototype properties', function (done) {
+
+ expect(Qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true })).to.deep.equal({ a: { hasOwnProperty: 'b' } }, { prototype: false });
+ expect(Qs.parse('hasOwnProperty=b', { allowPrototypes: true })).to.deep.equal({ hasOwnProperty: 'b' }, { prototype: false });
+ done();
+ });
+
+ it('can return plain objects', function (done) {
+
+ var expected = Object.create(null);
+ expected.a = Object.create(null);
+ expected.a.b = 'c';
+ expected.a.hasOwnProperty = 'd';
+ expect(Qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true })).to.deep.equal(expected);
+ expect(Qs.parse(null, { plainObjects: true })).to.deep.equal(Object.create(null));
+ var expectedArray = Object.create(null);
+ expectedArray.a = Object.create(null);
+ expectedArray.a['0'] = 'b';
+ expectedArray.a.c = 'd';
+ expect(Qs.parse('a[]=b&a[c]=d', { plainObjects: true })).to.deep.equal(expectedArray);
+ done();
+ });
+});
diff --git a/node_modules/request/node_modules/qs/test/stringify.js b/node_modules/request/node_modules/qs/test/stringify.js
new file mode 100644
index 000000000..53139ff90
--- /dev/null
+++ b/node_modules/request/node_modules/qs/test/stringify.js
@@ -0,0 +1,293 @@
+/* eslint no-extend-native:0 */
+// Load modules
+
+var Code = require('code');
+var Lab = require('lab');
+var Qs = require('../');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var expect = Code.expect;
+var describe = lab.experiment;
+var it = lab.test;
+
+
+describe('stringify()', function () {
+
+ it('stringifies a querystring object', function (done) {
+
+ expect(Qs.stringify({ a: 'b' })).to.equal('a=b');
+ expect(Qs.stringify({ a: 1 })).to.equal('a=1');
+ expect(Qs.stringify({ a: 1, b: 2 })).to.equal('a=1&b=2');
+ expect(Qs.stringify({ a: 'A_Z' })).to.equal('a=A_Z');
+ expect(Qs.stringify({ a: '€' })).to.equal('a=%E2%82%AC');
+ expect(Qs.stringify({ a: '' })).to.equal('a=%EE%80%80');
+ expect(Qs.stringify({ a: 'א' })).to.equal('a=%D7%90');
+ expect(Qs.stringify({ a: '𐐷' })).to.equal('a=%F0%90%90%B7');
+ done();
+ });
+
+ it('stringifies a nested object', function (done) {
+
+ expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c');
+ expect(Qs.stringify({ a: { b: { c: { d: 'e' } } } })).to.equal('a%5Bb%5D%5Bc%5D%5Bd%5D=e');
+ done();
+ });
+
+ it('stringifies an array value', function (done) {
+
+ expect(Qs.stringify({ a: ['b', 'c', 'd'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d');
+ done();
+ });
+
+ it('omits nulls when asked', function (done) {
+
+ expect(Qs.stringify({ a: 'b', c: null }, { skipNulls: true })).to.equal('a=b');
+ done();
+ });
+
+
+ it('omits nested nulls when asked', function (done) {
+
+ expect(Qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true })).to.equal('a%5Bb%5D=c');
+ done();
+ });
+
+ it('omits array indices when asked', function (done) {
+
+ expect(Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false })).to.equal('a=b&a=c&a=d');
+ done();
+ });
+
+ it('stringifies a nested array value', function (done) {
+
+ expect(Qs.stringify({ a: { b: ['c', 'd'] } })).to.equal('a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d');
+ done();
+ });
+
+ it('stringifies an object inside an array', function (done) {
+
+ expect(Qs.stringify({ a: [{ b: 'c' }] })).to.equal('a%5B0%5D%5Bb%5D=c');
+ expect(Qs.stringify({ a: [{ b: { c: [1] } }] })).to.equal('a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1');
+ done();
+ });
+
+ it('does not omit object keys when indices = false', function (done) {
+
+ expect(Qs.stringify({ a: [{ b: 'c' }] }, { indices: false })).to.equal('a%5Bb%5D=c');
+ done();
+ });
+
+ it('uses indices notation for arrays when indices=true', function (done) {
+
+ expect(Qs.stringify({ a: ['b', 'c'] }, { indices: true })).to.equal('a%5B0%5D=b&a%5B1%5D=c');
+ done();
+ });
+
+ it('uses indices notation for arrays when no arrayFormat is specified', function (done) {
+
+ expect(Qs.stringify({ a: ['b', 'c'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c');
+ done();
+ });
+
+ it('uses indices notation for arrays when no arrayFormat=indices', function (done) {
+
+ expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })).to.equal('a%5B0%5D=b&a%5B1%5D=c');
+ done();
+ });
+
+ it('uses repeat notation for arrays when no arrayFormat=repeat', function (done) {
+
+ expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })).to.equal('a=b&a=c');
+ done();
+ });
+
+ it('uses brackets notation for arrays when no arrayFormat=brackets', function (done) {
+
+ expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })).to.equal('a%5B%5D=b&a%5B%5D=c');
+ done();
+ });
+
+ it('stringifies a complicated object', function (done) {
+
+ expect(Qs.stringify({ a: { b: 'c', d: 'e' } })).to.equal('a%5Bb%5D=c&a%5Bd%5D=e');
+ done();
+ });
+
+ it('stringifies an empty value', function (done) {
+
+ expect(Qs.stringify({ a: '' })).to.equal('a=');
+ expect(Qs.stringify({ a: null }, { strictNullHandling: true })).to.equal('a');
+
+ expect(Qs.stringify({ a: '', b: '' })).to.equal('a=&b=');
+ expect(Qs.stringify({ a: null, b: '' }, { strictNullHandling: true })).to.equal('a&b=');
+
+ expect(Qs.stringify({ a: { b: '' } })).to.equal('a%5Bb%5D=');
+ expect(Qs.stringify({ a: { b: null } }, { strictNullHandling: true })).to.equal('a%5Bb%5D');
+ expect(Qs.stringify({ a: { b: null } }, { strictNullHandling: false })).to.equal('a%5Bb%5D=');
+
+ done();
+ });
+
+ it('stringifies an empty object', function (done) {
+
+ var obj = Object.create(null);
+ obj.a = 'b';
+ expect(Qs.stringify(obj)).to.equal('a=b');
+ done();
+ });
+
+ it('returns an empty string for invalid input', function (done) {
+
+ expect(Qs.stringify(undefined)).to.equal('');
+ expect(Qs.stringify(false)).to.equal('');
+ expect(Qs.stringify(null)).to.equal('');
+ expect(Qs.stringify('')).to.equal('');
+ done();
+ });
+
+ it('stringifies an object with an empty object as a child', function (done) {
+
+ var obj = {
+ a: Object.create(null)
+ };
+
+ obj.a.b = 'c';
+ expect(Qs.stringify(obj)).to.equal('a%5Bb%5D=c');
+ done();
+ });
+
+ it('drops keys with a value of undefined', function (done) {
+
+ expect(Qs.stringify({ a: undefined })).to.equal('');
+
+ expect(Qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true })).to.equal('a%5Bc%5D');
+ expect(Qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false })).to.equal('a%5Bc%5D=');
+ expect(Qs.stringify({ a: { b: undefined, c: '' } })).to.equal('a%5Bc%5D=');
+ done();
+ });
+
+ it('url encodes values', function (done) {
+
+ expect(Qs.stringify({ a: 'b c' })).to.equal('a=b%20c');
+ done();
+ });
+
+ it('stringifies a date', function (done) {
+
+ var now = new Date();
+ var str = 'a=' + encodeURIComponent(now.toISOString());
+ expect(Qs.stringify({ a: now })).to.equal(str);
+ done();
+ });
+
+ it('stringifies the weird object from qs', function (done) {
+
+ expect(Qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' })).to.equal('my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F');
+ done();
+ });
+
+ it('skips properties that are part of the object prototype', function (done) {
+
+ Object.prototype.crash = 'test';
+ expect(Qs.stringify({ a: 'b' })).to.equal('a=b');
+ expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c');
+ delete Object.prototype.crash;
+ done();
+ });
+
+ it('stringifies boolean values', function (done) {
+
+ expect(Qs.stringify({ a: true })).to.equal('a=true');
+ expect(Qs.stringify({ a: { b: true } })).to.equal('a%5Bb%5D=true');
+ expect(Qs.stringify({ b: false })).to.equal('b=false');
+ expect(Qs.stringify({ b: { c: false } })).to.equal('b%5Bc%5D=false');
+ done();
+ });
+
+ it('stringifies buffer values', function (done) {
+
+ expect(Qs.stringify({ a: new Buffer('test') })).to.equal('a=test');
+ expect(Qs.stringify({ a: { b: new Buffer('test') } })).to.equal('a%5Bb%5D=test');
+ done();
+ });
+
+ it('stringifies an object using an alternative delimiter', function (done) {
+
+ expect(Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' })).to.equal('a=b;c=d');
+ done();
+ });
+
+ it('doesn\'t blow up when Buffer global is missing', function (done) {
+
+ var tempBuffer = global.Buffer;
+ delete global.Buffer;
+ var result = Qs.stringify({ a: 'b', c: 'd' });
+ global.Buffer = tempBuffer;
+ expect(result).to.equal('a=b&c=d');
+ done();
+ });
+
+ it('selects properties when filter=array', function (done) {
+
+ expect(Qs.stringify({ a: 'b' }, { filter: ['a'] })).to.equal('a=b');
+ expect(Qs.stringify({ a: 1 }, { filter: [] })).to.equal('');
+ expect(Qs.stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, { filter: ['a', 'b', 0, 2] })).to.equal('a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3');
+ done();
+
+ });
+
+ it('supports custom representations when filter=function', function (done) {
+
+ var calls = 0;
+ var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } };
+ var filterFunc = function (prefix, value) {
+
+ calls++;
+ if (calls === 1) {
+ expect(prefix).to.be.empty();
+ expect(value).to.equal(obj);
+ }
+ else if (prefix === 'c') {
+ return;
+ }
+ else if (value instanceof Date) {
+ expect(prefix).to.equal('e[f]');
+ return value.getTime();
+ }
+ return value;
+ };
+
+ expect(Qs.stringify(obj, { filter: filterFunc })).to.equal('a=b&e%5Bf%5D=1257894000000');
+ expect(calls).to.equal(5);
+ done();
+
+ });
+
+ it('can disable uri encoding', function (done) {
+
+ expect(Qs.stringify({ a: 'b' }, { encode: false })).to.equal('a=b');
+ expect(Qs.stringify({ a: { b: 'c' } }, { encode: false })).to.equal('a[b]=c');
+ expect(Qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false })).to.equal('a=b&c');
+ done();
+ });
+
+ it('can sort the keys', function (done) {
+
+ var sort = function alphabeticalSort (a, b) {
+
+ return a.localeCompare(b);
+ };
+
+ expect(Qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort : sort })).to.equal('a=c&b=f&z=y');
+ expect(Qs.stringify({ a: 'c', z: { j: 'a', i:'b' }, b : 'f' }, { sort : sort })).to.equal('a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a');
+ done();
+ });
+});
diff --git a/node_modules/request/node_modules/qs/test/utils.js b/node_modules/request/node_modules/qs/test/utils.js
new file mode 100644
index 000000000..a9a6b520d
--- /dev/null
+++ b/node_modules/request/node_modules/qs/test/utils.js
@@ -0,0 +1,28 @@
+// Load modules
+
+var Code = require('code');
+var Lab = require('lab');
+var Utils = require('../lib/utils');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var lab = exports.lab = Lab.script();
+var expect = Code.expect;
+var describe = lab.experiment;
+var it = lab.test;
+
+
+describe('merge()', function () {
+
+ it('can merge two objects with the same key', function (done) {
+
+ expect(Utils.merge({ a: 'b' }, { a: 'c' })).to.deep.equal({ a: ['b', 'c'] });
+ done();
+ });
+});
diff --git a/node_modules/request/node_modules/stringstream/.npmignore b/node_modules/request/node_modules/stringstream/.npmignore
new file mode 100644
index 000000000..7dccd9707
--- /dev/null
+++ b/node_modules/request/node_modules/stringstream/.npmignore
@@ -0,0 +1,15 @@
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+
+pids
+logs
+results
+
+node_modules
+npm-debug.log \ No newline at end of file
diff --git a/node_modules/request/node_modules/stringstream/.travis.yml b/node_modules/request/node_modules/stringstream/.travis.yml
new file mode 100644
index 000000000..f1d0f13c8
--- /dev/null
+++ b/node_modules/request/node_modules/stringstream/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
diff --git a/node_modules/request/node_modules/stringstream/LICENSE.txt b/node_modules/request/node_modules/stringstream/LICENSE.txt
new file mode 100644
index 000000000..eac188156
--- /dev/null
+++ b/node_modules/request/node_modules/stringstream/LICENSE.txt
@@ -0,0 +1,4 @@
+Copyright 2012 Michael Hart (michael.hart.au@gmail.com)
+
+This project is free software released under the MIT license:
+http://www.opensource.org/licenses/mit-license.php
diff --git a/node_modules/request/node_modules/stringstream/README.md b/node_modules/request/node_modules/stringstream/README.md
new file mode 100644
index 000000000..32fc98255
--- /dev/null
+++ b/node_modules/request/node_modules/stringstream/README.md
@@ -0,0 +1,38 @@
+# Decode streams into strings The Right Way(tm)
+
+```javascript
+var fs = require('fs')
+var zlib = require('zlib')
+var strs = require('stringstream')
+
+var utf8Stream = fs.createReadStream('massiveLogFile.gz')
+ .pipe(zlib.createGunzip())
+ .pipe(strs('utf8'))
+```
+
+No need to deal with `setEncoding()` weirdness, just compose streams
+like they were supposed to be!
+
+Handles input and output encoding:
+
+```javascript
+// Stream from utf8 to hex to base64... Why not, ay.
+var hex64Stream = fs.createReadStream('myFile')
+ .pipe(strs('utf8', 'hex'))
+ .pipe(strs('hex', 'base64'))
+```
+
+Also deals with `base64` output correctly by aligning each emitted data
+chunk so that there are no dangling `=` characters:
+
+```javascript
+var stream = fs.createReadStream('myFile').pipe(strs('base64'))
+
+var base64Str = ''
+
+stream.on('data', function(data) { base64Str += data })
+stream.on('end', function() {
+ console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding()
+ console.log('Original file is: ' + new Buffer(base64Str, 'base64'))
+})
+```
diff --git a/node_modules/request/node_modules/stringstream/example.js b/node_modules/request/node_modules/stringstream/example.js
new file mode 100644
index 000000000..f82b85edc
--- /dev/null
+++ b/node_modules/request/node_modules/stringstream/example.js
@@ -0,0 +1,27 @@
+var fs = require('fs')
+var zlib = require('zlib')
+var strs = require('stringstream')
+
+var utf8Stream = fs.createReadStream('massiveLogFile.gz')
+ .pipe(zlib.createGunzip())
+ .pipe(strs('utf8'))
+
+utf8Stream.pipe(process.stdout)
+
+// Stream from utf8 to hex to base64... Why not, ay.
+var hex64Stream = fs.createReadStream('myFile')
+ .pipe(strs('utf8', 'hex'))
+ .pipe(strs('hex', 'base64'))
+
+hex64Stream.pipe(process.stdout)
+
+// Deals with base64 correctly by aligning chunks
+var stream = fs.createReadStream('myFile').pipe(strs('base64'))
+
+var base64Str = ''
+
+stream.on('data', function(data) { base64Str += data })
+stream.on('end', function() {
+ console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding()
+ console.log('Original file is: ' + new Buffer(base64Str, 'base64'))
+})
diff --git a/node_modules/request/node_modules/stringstream/package.json b/node_modules/request/node_modules/stringstream/package.json
new file mode 100644
index 000000000..37b7bec83
--- /dev/null
+++ b/node_modules/request/node_modules/stringstream/package.json
@@ -0,0 +1,32 @@
+{
+ "name": "stringstream",
+ "version": "0.0.4",
+ "description": "Encode and decode streams into string streams",
+ "author": {
+ "name": "Michael Hart",
+ "email": "michael.hart.au@gmail.com",
+ "url": "http://github.com/mhart"
+ },
+ "main": "stringstream.js",
+ "keywords": [
+ "string",
+ "stream",
+ "base64",
+ "gzip"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/mhart/StringStream.git"
+ },
+ "license": "MIT",
+ "readme": "# Decode streams into strings The Right Way(tm)\n\n```javascript\nvar fs = require('fs')\nvar zlib = require('zlib')\nvar strs = require('stringstream')\n\nvar utf8Stream = fs.createReadStream('massiveLogFile.gz')\n .pipe(zlib.createGunzip())\n .pipe(strs('utf8'))\n```\n\nNo need to deal with `setEncoding()` weirdness, just compose streams\nlike they were supposed to be!\n\nHandles input and output encoding:\n\n```javascript\n// Stream from utf8 to hex to base64... Why not, ay.\nvar hex64Stream = fs.createReadStream('myFile')\n .pipe(strs('utf8', 'hex'))\n .pipe(strs('hex', 'base64'))\n```\n\nAlso deals with `base64` output correctly by aligning each emitted data\nchunk so that there are no dangling `=` characters:\n\n```javascript\nvar stream = fs.createReadStream('myFile').pipe(strs('base64'))\n\nvar base64Str = ''\n\nstream.on('data', function(data) { base64Str += data })\nstream.on('end', function() {\n console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding()\n console.log('Original file is: ' + new Buffer(base64Str, 'base64'))\n})\n```\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/mhart/StringStream/issues"
+ },
+ "homepage": "https://github.com/mhart/StringStream#readme",
+ "_id": "stringstream@0.0.4",
+ "_shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92",
+ "_resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz",
+ "_from": "stringstream@>=0.0.4 <0.1.0"
+}
diff --git a/node_modules/request/node_modules/stringstream/stringstream.js b/node_modules/request/node_modules/stringstream/stringstream.js
new file mode 100644
index 000000000..4ece1275f
--- /dev/null
+++ b/node_modules/request/node_modules/stringstream/stringstream.js
@@ -0,0 +1,102 @@
+var util = require('util')
+var Stream = require('stream')
+var StringDecoder = require('string_decoder').StringDecoder
+
+module.exports = StringStream
+module.exports.AlignedStringDecoder = AlignedStringDecoder
+
+function StringStream(from, to) {
+ if (!(this instanceof StringStream)) return new StringStream(from, to)
+
+ Stream.call(this)
+
+ if (from == null) from = 'utf8'
+
+ this.readable = this.writable = true
+ this.paused = false
+ this.toEncoding = (to == null ? from : to)
+ this.fromEncoding = (to == null ? '' : from)
+ this.decoder = new AlignedStringDecoder(this.toEncoding)
+}
+util.inherits(StringStream, Stream)
+
+StringStream.prototype.write = function(data) {
+ if (!this.writable) {
+ var err = new Error('stream not writable')
+ err.code = 'EPIPE'
+ this.emit('error', err)
+ return false
+ }
+ if (this.fromEncoding) {
+ if (Buffer.isBuffer(data)) data = data.toString()
+ data = new Buffer(data, this.fromEncoding)
+ }
+ var string = this.decoder.write(data)
+ if (string.length) this.emit('data', string)
+ return !this.paused
+}
+
+StringStream.prototype.flush = function() {
+ if (this.decoder.flush) {
+ var string = this.decoder.flush()
+ if (string.length) this.emit('data', string)
+ }
+}
+
+StringStream.prototype.end = function() {
+ if (!this.writable && !this.readable) return
+ this.flush()
+ this.emit('end')
+ this.writable = this.readable = false
+ this.destroy()
+}
+
+StringStream.prototype.destroy = function() {
+ this.decoder = null
+ this.writable = this.readable = false
+ this.emit('close')
+}
+
+StringStream.prototype.pause = function() {
+ this.paused = true
+}
+
+StringStream.prototype.resume = function () {
+ if (this.paused) this.emit('drain')
+ this.paused = false
+}
+
+function AlignedStringDecoder(encoding) {
+ StringDecoder.call(this, encoding)
+
+ switch (this.encoding) {
+ case 'base64':
+ this.write = alignedWrite
+ this.alignedBuffer = new Buffer(3)
+ this.alignedBytes = 0
+ break
+ }
+}
+util.inherits(AlignedStringDecoder, StringDecoder)
+
+AlignedStringDecoder.prototype.flush = function() {
+ if (!this.alignedBuffer || !this.alignedBytes) return ''
+ var leftover = this.alignedBuffer.toString(this.encoding, 0, this.alignedBytes)
+ this.alignedBytes = 0
+ return leftover
+}
+
+function alignedWrite(buffer) {
+ var rem = (this.alignedBytes + buffer.length) % this.alignedBuffer.length
+ if (!rem && !this.alignedBytes) return buffer.toString(this.encoding)
+
+ var returnBuffer = new Buffer(this.alignedBytes + buffer.length - rem)
+
+ this.alignedBuffer.copy(returnBuffer, 0, 0, this.alignedBytes)
+ buffer.copy(returnBuffer, this.alignedBytes, 0, buffer.length - rem)
+
+ buffer.copy(this.alignedBuffer, 0, buffer.length - rem, buffer.length)
+ this.alignedBytes = rem
+
+ return returnBuffer.toString(this.encoding)
+}
diff --git a/node_modules/request/node_modules/tough-cookie/LICENSE b/node_modules/request/node_modules/tough-cookie/LICENSE
new file mode 100644
index 000000000..1bc286fb5
--- /dev/null
+++ b/node_modules/request/node_modules/tough-cookie/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 2015, Salesforce.com, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+===
+
+The following exceptions apply:
+
+===
+
+`public_suffix_list.dat` was obtained from
+<https://publicsuffix.org/list/public_suffix_list.dat> via
+<http://publicsuffix.org>. The license for this file is MPL/2.0. The header of
+that file reads as follows:
+
+ // This Source Code Form is subject to the terms of the Mozilla Public
+ // License, v. 2.0. If a copy of the MPL was not distributed with this
+ // file, You can obtain one at http://mozilla.org/MPL/2.0/.
diff --git a/node_modules/request/node_modules/tough-cookie/README.md b/node_modules/request/node_modules/tough-cookie/README.md
new file mode 100644
index 000000000..9899dbf6e
--- /dev/null
+++ b/node_modules/request/node_modules/tough-cookie/README.md
@@ -0,0 +1,492 @@
+[RFC6265](https://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js
+
+[![Build Status](https://travis-ci.org/SalesforceEng/tough-cookie.png?branch=master)](https://travis-ci.org/SalesforceEng/tough-cookie)
+
+[![NPM Stats](https://nodei.co/npm/tough-cookie.png?downloads=true&stars=true)](https://npmjs.org/package/tough-cookie)
+![NPM Downloads](https://nodei.co/npm-dl/tough-cookie.png?months=9)
+
+# Synopsis
+
+``` javascript
+var tough = require('tough-cookie');
+var Cookie = tough.Cookie;
+var cookie = Cookie.parse(header);
+cookie.value = 'somethingdifferent';
+header = cookie.toString();
+
+var cookiejar = new tough.CookieJar();
+cookiejar.setCookie(cookie, 'http://currentdomain.example.com/path', cb);
+// ...
+cookiejar.getCookies('http://example.com/otherpath',function(err,cookies) {
+ res.headers['cookie'] = cookies.join('; ');
+});
+```
+
+# Installation
+
+It's _so_ easy!
+
+`npm install tough-cookie`
+
+Why the name? NPM modules `cookie`, `cookies` and `cookiejar` were already taken.
+
+# API
+
+## tough
+
+Functions on the module you get from `require('tough-cookie')`. All can be used as pure functions and don't need to be "bound".
+
+**Note**: prior to 1.0.x, several of these functions took a `strict` parameter. This has since been removed from the API as it was no longer necessary.
+
+### `parseDate(string)`
+
+Parse a cookie date string into a `Date`. Parses according to RFC6265 Section 5.1.1, not `Date.parse()`.
+
+### `formatDate(date)`
+
+Format a Date into a RFC1123 string (the RFC6265-recommended format).
+
+### `canonicalDomain(str)`
+
+Transforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects).
+
+### `domainMatch(str,domStr[,canonicalize=true])`
+
+Answers "does this real domain match the domain in a cookie?". The `str` is the "current" domain-name and the `domStr` is the "cookie" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a "suffix match".
+
+The `canonicalize` parameter will run the other two paramters through `canonicalDomain` or not.
+
+### `defaultPath(path)`
+
+Given a current request/response path, gives the Path apropriate for storing in a cookie. This is basically the "directory" of a "file" in the path, but is specified by Section 5.1.4 of the RFC.
+
+The `path` parameter MUST be _only_ the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the `.pathname` property of node's `uri.parse()` output.
+
+### `pathMatch(reqPath,cookiePath)`
+
+Answers "does the request-path path-match a given cookie-path?" as per RFC6265 Section 5.1.4. Returns a boolean.
+
+This is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`.
+
+### `parse(cookieString[, options])`
+
+alias for `Cookie.parse(cookieString[, options])`
+
+### `fromJSON(string)`
+
+alias for `Cookie.fromJSON(string)`
+
+### `getPublicSuffix(hostname)`
+
+Returns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns `null` if the hostname cannot have cookies set for it.
+
+For example: `www.example.com` and `www.subdomain.example.com` both have public suffix `example.com`.
+
+For further information, see http://publicsuffix.org/. This module derives its list from that site.
+
+### `cookieCompare(a,b)`
+
+For use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). The sort algorithm is, in order of precedence:
+
+* Longest `.path`
+* oldest `.creation` (which has a 1ms precision, same as `Date`)
+* lowest `.creationIndex` (to get beyond the 1ms precision)
+
+``` javascript
+var cookies = [ /* unsorted array of Cookie objects */ ];
+cookies = cookies.sort(cookieCompare);
+```
+
+**Note**: Since JavaScript's `Date` is limited to a 1ms precision, cookies within the same milisecond are entirely possible. This is especially true when using the `now` option to `.setCookie()`. The `.creationIndex` property is a per-process global counter, assigned during construction with `new Cookie()`. This preserves the spirit of the RFC sorting: older cookies go first. This works great for `MemoryCookieStore`, since `Set-Cookie` headers are parsed in order, but may not be so great for distributed systems. Sophisticated `Store`s may wish to set this to some other _logical clock_ such that if cookies A and B are created in the same millisecond, but cookie A is created before cookie B, then `A.creationIndex < B.creationIndex`. If you want to alter the global counter, which you probably _shouldn't_ do, it's stored in `Cookie.cookiesCreated`.
+
+### `permuteDomain(domain)`
+
+Generates a list of all possible domains that `domainMatch()` the parameter. May be handy for implementing cookie stores.
+
+### `permutePath(path)`
+
+Generates a list of all possible paths that `pathMatch()` the parameter. May be handy for implementing cookie stores.
+
+
+## Cookie
+
+Exported via `tough.Cookie`.
+
+### `Cookie.parse(cookieString[, options])`
+
+Parses a single Cookie or Set-Cookie HTTP header into a `Cookie` object. Returns `undefined` if the string can't be parsed.
+
+The options parameter is not required and currently has only one property:
+
+ * _loose_ - boolean - if `true` enable parsing of key-less cookies like `=abc` and `=`, which are not RFC-compliant.
+
+If options is not an object, it is ignored, which means you can use `Array#map` with it.
+
+Here's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response:
+
+``` javascript
+if (res.headers['set-cookie'] instanceof Array)
+ cookies = res.headers['set-cookie'].map(Cookie.parse);
+else
+ cookies = [Cookie.parse(res.headers['set-cookie'])];
+```
+
+### Properties
+
+Cookie object properties:
+
+ * _key_ - string - the name or key of the cookie (default "")
+ * _value_ - string - the value of the cookie (default "")
+ * _expires_ - `Date` - if set, the `Expires=` attribute of the cookie (defaults to the string `"Infinity"`). See `setExpires()`
+ * _maxAge_ - seconds - if set, the `Max-Age=` attribute _in seconds_ of the cookie. May also be set to strings `"Infinity"` and `"-Infinity"` for non-expiry and immediate-expiry, respectively. See `setMaxAge()`
+ * _domain_ - string - the `Domain=` attribute of the cookie
+ * _path_ - string - the `Path=` of the cookie
+ * _secure_ - boolean - the `Secure` cookie flag
+ * _httpOnly_ - boolean - the `HttpOnly` cookie flag
+ * _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside)
+ * _creation_ - `Date` - when this cookie was constructed
+ * _creationIndex_ - number - set at construction, used to provide greater sort precision (please see `cookieCompare(a,b)` for a full explanation)
+
+After a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes:
+
+ * _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied)
+ * _pathIsDefault_ - boolean - if true, there was no Path field on the cookie and `defaultPath()` was used to derive one.
+ * _creation_ - `Date` - **modified** from construction to when the cookie was added to the jar
+ * _lastAccessed_ - `Date` - last time the cookie got accessed. Will affect cookie cleaning once implemented. Using `cookiejar.getCookies(...)` will update this attribute.
+
+### `Cookie([{properties}])`
+
+Receives an options object that can contain any of the above Cookie properties, uses the default for unspecified properties.
+
+### `.toString()`
+
+encode to a Set-Cookie header value. The Expires cookie field is set using `formatDate()`, but is omitted entirely if `.expires` is `Infinity`.
+
+### `.cookieString()`
+
+encode to a Cookie header value (i.e. the `.key` and `.value` properties joined with '=').
+
+### `.setExpires(String)`
+
+sets the expiry based on a date-string passed through `parseDate()`. If parseDate returns `null` (i.e. can't parse this date string), `.expires` is set to `"Infinity"` (a string) is set.
+
+### `.setMaxAge(number)`
+
+sets the maxAge in seconds. Coerces `-Infinity` to `"-Infinity"` and `Infinity` to `"Infinity"` so it JSON serializes correctly.
+
+### `.expiryTime([now=Date.now()])`
+
+### `.expiryDate([now=Date.now()])`
+
+expiryTime() Computes the absolute unix-epoch milliseconds that this cookie expires. expiryDate() works similarly, except it returns a `Date` object. Note that in both cases the `now` parameter should be milliseconds.
+
+Max-Age takes precedence over Expires (as per the RFC). The `.creation` attribute -- or, by default, the `now` paramter -- is used to offset the `.maxAge` attribute.
+
+If Expires (`.expires`) is set, that's returned.
+
+Otherwise, `expiryTime()` returns `Infinity` and `expiryDate()` returns a `Date` object for "Tue, 19 Jan 2038 03:14:07 GMT" (latest date that can be expressed by a 32-bit `time_t`; the common limit for most user-agents).
+
+### `.TTL([now=Date.now()])`
+
+compute the TTL relative to `now` (milliseconds). The same precedence rules as for `expiryTime`/`expiryDate` apply.
+
+The "number" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired. Otherwise a time-to-live in milliseconds is returned.
+
+### `.canonicalizedDoman()`
+
+### `.cdomain()`
+
+return the canonicalized `.domain` field. This is lower-cased and punycode (RFC3490) encoded if the domain has any non-ASCII characters.
+
+### `.toJSON()`
+
+For convenience in using `JSON.serialize(cookie)`. Returns a plain-old `Object` that can be JSON-serialized.
+
+Any `Date` properties (i.e., `.expires`, `.creation`, and `.lastAccessed`) are exported in ISO format (`.toISOString()`).
+
+**NOTE**: Custom `Cookie` properties will be discarded. In tough-cookie 1.x, since there was no `.toJSON` method explicitly defined, all enumerable properties were captured. If you want a property to be serialized, add the property name to the `Cookie.serializableProperties` Array.
+
+### `Cookie.fromJSON(strOrObj)`
+
+Does the reverse of `cookie.toJSON()`. If passed a string, will `JSON.parse()` that first.
+
+Any `Date` properties (i.e., `.expires`, `.creation`, and `.lastAccessed`) are parsed via `Date.parse()`, not the tough-cookie `parseDate`, since it's JavaScript/JSON-y timestamps being handled at this layer.
+
+Returns `null` upon JSON parsing error.
+
+### `.clone()`
+
+Does a deep clone of this cookie, exactly implemented as `Cookie.fromJSON(cookie.toJSON())`.
+
+### `.validate()`
+
+Status: *IN PROGRESS*. Works for a few things, but is by no means comprehensive.
+
+validates cookie attributes for semantic correctness. Useful for "lint" checking any Set-Cookie headers you generate. For now, it returns a boolean, but eventually could return a reason string -- you can future-proof with this construct:
+
+``` javascript
+if (cookie.validate() === true) {
+ // it's tasty
+} else {
+ // yuck!
+}
+```
+
+
+## CookieJar
+
+Exported via `tough.CookieJar`.
+
+### `CookieJar([store],[options])`
+
+Simply use `new CookieJar()`. If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used.
+
+The `options` object can be omitted and can have the following properties:
+
+ * _rejectPublicSuffixes_ - boolean - default `true` - reject cookies with domains like "com" and "co.uk"
+ * _looseMode_ - boolean - default `false` - accept malformed cookies like `bar` and `=bar`, which have an implied empty name.
+ This is not in the standard, but is used sometimes on the web and is accepted by (most) browsers.
+
+Since eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods.
+
+### `.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie))`
+
+Attempt to set the cookie in the cookie jar. If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through. The cookie will have updated `.creation`, `.lastAccessed` and `.hostOnly` properties.
+
+The `options` object can be omitted and can have the following properties:
+
+ * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.
+ * _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.
+ * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies
+ * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains. `Store` errors aren't ignored by this option.
+
+As per the RFC, the `.hostOnly` property is set if there was no "Domain=" parameter in the cookie string (or `.domain` was null on the Cookie object). The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual).
+
+### `.setCookieSync(cookieOrString, currentUrl, [{options}])`
+
+Synchronous version of `setCookie`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
+
+### `.getCookies(currentUrl, [{options},] cb(err,cookies))`
+
+Retrieve the list of cookies that can be sent in a Cookie header for the current url.
+
+If an error is encountered, that's passed as `err` to the callback, otherwise an `Array` of `Cookie` objects is passed. The array is sorted with `cookieCompare()` unless the `{sort:false}` option is given.
+
+The `options` object can be omitted and can have the following properties:
+
+ * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.
+ * _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.
+ * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies
+ * _expire_ - boolean - default `true` - perform expiry-time checking of cookies and asynchronously remove expired cookies from the store. Using `false` will return expired cookies and **not** remove them from the store (which is useful for replaying Set-Cookie headers, potentially).
+ * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the underlying store (the default `MemoryCookieStore` supports it).
+
+The `.lastAccessed` property of the returned cookies will have been updated.
+
+### `.getCookiesSync(currentUrl, [{options}])`
+
+Synchronous version of `getCookies`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
+
+### `.getCookieString(...)`
+
+Accepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback. Simply maps the `Cookie` array via `.cookieString()`.
+
+### `.getCookieStringSync(...)`
+
+Synchronous version of `getCookieString`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
+
+### `.getSetCookieStrings(...)`
+
+Returns an array of strings suitable for **Set-Cookie** headers. Accepts the same options as `.getCookies()`. Simply maps the cookie array via `.toString()`.
+
+### `.getSetCookieStringsSync(...)`
+
+Synchronous version of `getSetCookieStrings`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
+
+### `.serialize(cb(err,serializedObject))`
+
+Serialize the Jar if the underlying store supports `.getAllCookies`.
+
+**NOTE**: Custom `Cookie` properties will be discarded. If you want a property to be serialized, add the property name to the `Cookie.serializableProperties` Array.
+
+See [Serialization Format].
+
+### `.serializeSync()`
+
+Sync version of .serialize
+
+### `.toJSON()`
+
+Alias of .serializeSync() for the convenience of `JSON.stringify(cookiejar)`.
+
+### `CookieJar.deserialize(serialized, [store], cb(err,object))`
+
+A new Jar is created and the serialized Cookies are added to the underlying store. Each `Cookie` is added via `store.putCookie` in the order in which they appear in the serialization.
+
+The `store` argument is optional, but should be an instance of `Store`. By default, a new instance of `MemoryCookieStore` is created.
+
+As a convenience, if `serialized` is a string, it is passed through `JSON.parse` first. If that throws an error, this is passed to the callback.
+
+### `CookieJar.deserializeSync(serialized, [store])`
+
+Sync version of `.deserialize`. _Note_ that the `store` must be synchronous for this to work.
+
+### `CookieJar.fromJSON(string)`
+
+Alias of `.deserializeSync` to provide consistency with `Cookie.fromJSON()`.
+
+### `.clone([store,]cb(err,newJar))`
+
+Produces a deep clone of this jar. Modifications to the original won't affect the clone, and vice versa.
+
+The `store` argument is optional, but should be an instance of `Store`. By default, a new instance of `MemoryCookieStore` is created. Transferring between store types is supported so long as the source implements `.getAllCookies()` and the destination implements `.putCookie()`.
+
+### `.cloneSync([store])`
+
+Synchronous version of `.clone`, returning a new `CookieJar` instance.
+
+The `store` argument is optional, but must be a _synchronous_ `Store` instance if specified. If not passed, a new instance of `MemoryCookieStore` is used.
+
+The _source_ and _destination_ must both be synchronous `Store`s. If one or both stores are asynchronous, use `.clone` instead. Recall that `MemoryCookieStore` supports both synchronous and asynchronous API calls.
+
+## Store
+
+Base class for CookieJar stores. Available as `tough.Store`.
+
+## Store API
+
+The storage model for each `CookieJar` instance can be replaced with a custom implementation. The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file. The API uses continuation-passing-style to allow for asynchronous stores.
+
+Stores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`.
+
+Stores are asynchronous by default, but if `store.synchronous` is set to `true`, then the `*Sync` methods on the of the containing `CookieJar` can be used (however, the continuation-passing style
+
+All `domain` parameters will have been normalized before calling.
+
+The Cookie store must have all of the following methods.
+
+### `store.findCookie(domain, path, key, cb(err,cookie))`
+
+Retrieve a cookie with the given domain, path and key (a.k.a. name). The RFC maintains that exactly one of these cookies should exist in a store. If the store is using versioning, this means that the latest/newest such cookie should be returned.
+
+Callback takes an error and the resulting `Cookie` object. If no cookie is found then `null` MUST be passed instead (i.e. not an error).
+
+### `store.findCookies(domain, path, cb(err,cookies))`
+
+Locates cookies matching the given domain and path. This is most often called in the context of `cookiejar.getCookies()` above.
+
+If no cookies are found, the callback MUST be passed an empty array.
+
+The resulting list will be checked for applicability to the current request according to the RFC (domain-match, path-match, http-only-flag, secure-flag, expiry, etc.), so it's OK to use an optimistic search algorithm when implementing this method. However, the search algorithm used SHOULD try to find cookies that `domainMatch()` the domain and `pathMatch()` the path in order to limit the amount of checking that needs to be done.
+
+As of version 0.9.12, the `allPaths` option to `cookiejar.getCookies()` above will cause the path here to be `null`. If the path is `null`, path-matching MUST NOT be performed (i.e. domain-matching only).
+
+### `store.putCookie(cookie, cb(err))`
+
+Adds a new cookie to the store. The implementation SHOULD replace any existing cookie with the same `.domain`, `.path`, and `.key` properties -- depending on the nature of the implementation, it's possible that between the call to `fetchCookie` and `putCookie` that a duplicate `putCookie` can occur.
+
+The `cookie` object MUST NOT be modified; the caller will have already updated the `.creation` and `.lastAccessed` properties.
+
+Pass an error if the cookie cannot be stored.
+
+### `store.updateCookie(oldCookie, newCookie, cb(err))`
+
+Update an existing cookie. The implementation MUST update the `.value` for a cookie with the same `domain`, `.path` and `.key`. The implementation SHOULD check that the old value in the store is equivalent to `oldCookie` - how the conflict is resolved is up to the store.
+
+The `.lastAccessed` property will always be different between the two objects (to the precision possible via JavaScript's clock). Both `.creation` and `.creationIndex` are guaranteed to be the same. Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are selected for automatic deletion (e.g., least-recently-used, which is up to the store to implement).
+
+Stores may wish to optimize changing the `.value` of the cookie in the store versus storing a new cookie. If the implementation doesn't define this method a stub that calls `putCookie(newCookie,cb)` will be added to the store object.
+
+The `newCookie` and `oldCookie` objects MUST NOT be modified.
+
+Pass an error if the newCookie cannot be stored.
+
+### `store.removeCookie(domain, path, key, cb(err))`
+
+Remove a cookie from the store (see notes on `findCookie` about the uniqueness constraint).
+
+The implementation MUST NOT pass an error if the cookie doesn't exist; only pass an error due to the failure to remove an existing cookie.
+
+### `store.removeCookies(domain, path, cb(err))`
+
+Removes matching cookies from the store. The `path` parameter is optional, and if missing means all paths in a domain should be removed.
+
+Pass an error ONLY if removing any existing cookies failed.
+
+### `store.getAllCookies(cb(err, cookies))`
+
+Produces an `Array` of all cookies during `jar.serialize()`. The items in the array can be true `Cookie` objects or generic `Object`s with the [Serialization Format] data structure.
+
+Cookies SHOULD be returned in creation order to preserve sorting via `compareCookies()`. For reference, `MemoryCookieStore` will sort by `.creationIndex` since it uses true `Cookie` objects internally. If you don't return the cookies in creation order, they'll still be sorted by creation time, but this only has a precision of 1ms. See `compareCookies` for more detail.
+
+Pass an error if retrieval fails.
+
+## MemoryCookieStore
+
+Inherits from `Store`.
+
+A just-in-memory CookieJar synchronous store implementation, used by default. Despite being a synchronous implementation, it's usable with both the synchronous and asynchronous forms of the `CookieJar` API.
+
+# Serialization Format
+
+**NOTE**: if you want to have custom `Cookie` properties serialized, add the property name to `Cookie.serializableProperties`.
+
+```js
+ {
+ // The version of tough-cookie that serialized this jar.
+ version: 'tough-cookie@1.x.y',
+
+ // add the store type, to make humans happy:
+ storeType: 'MemoryCookieStore',
+
+ // CookieJar configuration:
+ rejectPublicSuffixes: true,
+ // ... future items go here
+
+ // Gets filled from jar.store.getAllCookies():
+ cookies: [
+ {
+ key: 'string',
+ value: 'string',
+ // ...
+ /* other Cookie.serializableProperties go here */
+ }
+ ]
+ }
+```
+
+# Copyright and License
+
+(tl;dr: BSD-3-Clause with some MPL/2.0)
+
+```text
+ Copyright (c) 2015, Salesforce.com, Inc.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ 3. Neither the name of Salesforce.com nor the names of its contributors may
+ be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+```
+
+Portions may be licensed under different licenses (in particular `public_suffix_list.dat` is MPL/2.0); please read that file and the LICENSE file for full details.
diff --git a/node_modules/request/node_modules/tough-cookie/lib/cookie.js b/node_modules/request/node_modules/tough-cookie/lib/cookie.js
new file mode 100644
index 000000000..f1cb5e287
--- /dev/null
+++ b/node_modules/request/node_modules/tough-cookie/lib/cookie.js
@@ -0,0 +1,1342 @@
+/*!
+ * Copyright (c) 2015, Salesforce.com, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of Salesforce.com nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+'use strict';
+var net = require('net');
+var urlParse = require('url').parse;
+var pubsuffix = require('./pubsuffix');
+var Store = require('./store').Store;
+var MemoryCookieStore = require('./memstore').MemoryCookieStore;
+var pathMatch = require('./pathMatch').pathMatch;
+var VERSION = require('../package.json').version;
+
+var punycode;
+try {
+ punycode = require('punycode');
+} catch(e) {
+ console.warn("cookie: can't load punycode; won't use punycode for domain normalization");
+}
+
+var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/;
+
+// From RFC6265 S4.1.1
+// note that it excludes \x3B ";"
+var COOKIE_OCTET = /[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]/;
+var COOKIE_OCTETS = new RegExp('^'+COOKIE_OCTET.source+'+$');
+
+var CONTROL_CHARS = /[\x00-\x1F]/;
+
+// Double quotes are part of the value (see: S4.1.1).
+// '\r', '\n' and '\0' should be treated as a terminator in the "relaxed" mode
+// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60)
+// '=' and ';' are attribute/values separators
+// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L64)
+var COOKIE_PAIR = /^(([^=;]+))\s*=\s*(("?)[^\n\r\0]*\3)/
+
+// Used to parse non-RFC-compliant cookies like '=abc' when given the `loose`
+// option in Cookie.parse:
+var LOOSE_COOKIE_PAIR = /^((?:=)?([^=;]*)\s*=\s*)?(("?)[^\n\r\0]*\3)/;
+
+// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"'
+// Note ';' is \x3B
+var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/;
+
+// Used for checking whether or not there is a trailing semi-colon
+var TRAILING_SEMICOLON = /;+$/;
+
+var DAY_OF_MONTH = /^(\d{1,2})[^\d]*$/;
+var TIME = /^(\d{1,2})[^\d]*:(\d{1,2})[^\d]*:(\d{1,2})[^\d]*$/;
+var MONTH = /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/i;
+
+var MONTH_TO_NUM = {
+ jan:0, feb:1, mar:2, apr:3, may:4, jun:5,
+ jul:6, aug:7, sep:8, oct:9, nov:10, dec:11
+};
+var NUM_TO_MONTH = [
+ 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'
+];
+var NUM_TO_DAY = [
+ 'Sun','Mon','Tue','Wed','Thu','Fri','Sat'
+];
+
+var YEAR = /^(\d{2}|\d{4})$/; // 2 to 4 digits
+
+var MAX_TIME = 2147483647000; // 31-bit max
+var MIN_TIME = 0; // 31-bit min
+
+
+// RFC6265 S5.1.1 date parser:
+function parseDate(str) {
+ if (!str) {
+ return;
+ }
+
+ /* RFC6265 S5.1.1:
+ * 2. Process each date-token sequentially in the order the date-tokens
+ * appear in the cookie-date
+ */
+ var tokens = str.split(DATE_DELIM);
+ if (!tokens) {
+ return;
+ }
+
+ var hour = null;
+ var minutes = null;
+ var seconds = null;
+ var day = null;
+ var month = null;
+ var year = null;
+
+ for (var i=0; i<tokens.length; i++) {
+ var token = tokens[i].trim();
+ if (!token.length) {
+ continue;
+ }
+
+ var result;
+
+ /* 2.1. If the found-time flag is not set and the token matches the time
+ * production, set the found-time flag and set the hour- value,
+ * minute-value, and second-value to the numbers denoted by the digits in
+ * the date-token, respectively. Skip the remaining sub-steps and continue
+ * to the next date-token.
+ */
+ if (seconds === null) {
+ result = TIME.exec(token);
+ if (result) {
+ hour = parseInt(result[1], 10);
+ minutes = parseInt(result[2], 10);
+ seconds = parseInt(result[3], 10);
+ /* RFC6265 S5.1.1.5:
+ * [fail if]
+ * * the hour-value is greater than 23,
+ * * the minute-value is greater than 59, or
+ * * the second-value is greater than 59.
+ */
+ if(hour > 23 || minutes > 59 || seconds > 59) {
+ return;
+ }
+
+ continue;
+ }
+ }
+
+ /* 2.2. If the found-day-of-month flag is not set and the date-token matches
+ * the day-of-month production, set the found-day-of- month flag and set
+ * the day-of-month-value to the number denoted by the date-token. Skip
+ * the remaining sub-steps and continue to the next date-token.
+ */
+ if (day === null) {
+ result = DAY_OF_MONTH.exec(token);
+ if (result) {
+ day = parseInt(result, 10);
+ /* RFC6265 S5.1.1.5:
+ * [fail if] the day-of-month-value is less than 1 or greater than 31
+ */
+ if(day < 1 || day > 31) {
+ return;
+ }
+ continue;
+ }
+ }
+
+ /* 2.3. If the found-month flag is not set and the date-token matches the
+ * month production, set the found-month flag and set the month-value to
+ * the month denoted by the date-token. Skip the remaining sub-steps and
+ * continue to the next date-token.
+ */
+ if (month === null) {
+ result = MONTH.exec(token);
+ if (result) {
+ month = MONTH_TO_NUM[result[1].toLowerCase()];
+ continue;
+ }
+ }
+
+ /* 2.4. If the found-year flag is not set and the date-token matches the year
+ * production, set the found-year flag and set the year-value to the number
+ * denoted by the date-token. Skip the remaining sub-steps and continue to
+ * the next date-token.
+ */
+ if (year === null) {
+ result = YEAR.exec(token);
+ if (result) {
+ year = parseInt(result[0], 10);
+ /* From S5.1.1:
+ * 3. If the year-value is greater than or equal to 70 and less
+ * than or equal to 99, increment the year-value by 1900.
+ * 4. If the year-value is greater than or equal to 0 and less
+ * than or equal to 69, increment the year-value by 2000.
+ */
+ if (70 <= year && year <= 99) {
+ year += 1900;
+ } else if (0 <= year && year <= 69) {
+ year += 2000;
+ }
+
+ if (year < 1601) {
+ return; // 5. ... the year-value is less than 1601
+ }
+ }
+ }
+ }
+
+ if (seconds === null || day === null || month === null || year === null) {
+ return; // 5. ... at least one of the found-day-of-month, found-month, found-
+ // year, or found-time flags is not set,
+ }
+
+ return new Date(Date.UTC(year, month, day, hour, minutes, seconds));
+}
+
+function formatDate(date) {
+ var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d;
+ var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h;
+ var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m;
+ var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s;
+ return NUM_TO_DAY[date.getUTCDay()] + ', ' +
+ d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+
+ h+':'+m+':'+s+' GMT';
+}
+
+// S5.1.2 Canonicalized Host Names
+function canonicalDomain(str) {
+ if (str == null) {
+ return null;
+ }
+ str = str.trim().replace(/^\./,''); // S4.1.2.3 & S5.2.3: ignore leading .
+
+ // convert to IDN if any non-ASCII characters
+ if (punycode && /[^\u0001-\u007f]/.test(str)) {
+ str = punycode.toASCII(str);
+ }
+
+ return str.toLowerCase();
+}
+
+// S5.1.3 Domain Matching
+function domainMatch(str, domStr, canonicalize) {
+ if (str == null || domStr == null) {
+ return null;
+ }
+ if (canonicalize !== false) {
+ str = canonicalDomain(str);
+ domStr = canonicalDomain(domStr);
+ }
+
+ /*
+ * "The domain string and the string are identical. (Note that both the
+ * domain string and the string will have been canonicalized to lower case at
+ * this point)"
+ */
+ if (str == domStr) {
+ return true;
+ }
+
+ /* "All of the following [three] conditions hold:" (order adjusted from the RFC) */
+
+ /* "* The string is a host name (i.e., not an IP address)." */
+ if (net.isIP(str)) {
+ return false;
+ }
+
+ /* "* The domain string is a suffix of the string" */
+ var idx = str.indexOf(domStr);
+ if (idx <= 0) {
+ return false; // it's a non-match (-1) or prefix (0)
+ }
+
+ // e.g "a.b.c".indexOf("b.c") === 2
+ // 5 === 3+2
+ if (str.length !== domStr.length + idx) { // it's not a suffix
+ return false;
+ }
+
+ /* "* The last character of the string that is not included in the domain
+ * string is a %x2E (".") character." */
+ if (str.substr(idx-1,1) !== '.') {
+ return false;
+ }
+
+ return true;
+}
+
+
+// RFC6265 S5.1.4 Paths and Path-Match
+
+/*
+ * "The user agent MUST use an algorithm equivalent to the following algorithm
+ * to compute the default-path of a cookie:"
+ *
+ * Assumption: the path (and not query part or absolute uri) is passed in.
+ */
+function defaultPath(path) {
+ // "2. If the uri-path is empty or if the first character of the uri-path is not
+ // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps.
+ if (!path || path.substr(0,1) !== "/") {
+ return "/";
+ }
+
+ // "3. If the uri-path contains no more than one %x2F ("/") character, output
+ // %x2F ("/") and skip the remaining step."
+ if (path === "/") {
+ return path;
+ }
+
+ var rightSlash = path.lastIndexOf("/");
+ if (rightSlash === 0) {
+ return "/";
+ }
+
+ // "4. Output the characters of the uri-path from the first character up to,
+ // but not including, the right-most %x2F ("/")."
+ return path.slice(0, rightSlash);
+}
+
+
+function parse(str, options) {
+ if (!options || typeof options !== 'object') {
+ options = {};
+ }
+ str = str.trim();
+
+ // S4.1.1 Trailing semi-colons are not part of the specification.
+ var semiColonCheck = TRAILING_SEMICOLON.exec(str);
+ if (semiColonCheck) {
+ str = str.slice(0, semiColonCheck.index);
+ }
+
+ // We use a regex to parse the "name-value-pair" part of S5.2
+ var firstSemi = str.indexOf(';'); // S5.2 step 1
+ var pairRe = options.loose ? LOOSE_COOKIE_PAIR : COOKIE_PAIR;
+ var result = pairRe.exec(firstSemi === -1 ? str : str.substr(0,firstSemi));
+
+ // Rx satisfies the "the name string is empty" and "lacks a %x3D ("=")"
+ // constraints as well as trimming any whitespace.
+ if (!result) {
+ return;
+ }
+
+ var c = new Cookie();
+ if (result[1]) {
+ c.key = result[2].trim();
+ } else {
+ c.key = '';
+ }
+ c.value = result[3].trim();
+ if (CONTROL_CHARS.test(c.key) || CONTROL_CHARS.test(c.value)) {
+ return;
+ }
+
+ if (firstSemi === -1) {
+ return c;
+ }
+
+ // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string
+ // (including the %x3B (";") in question)." plus later on in the same section
+ // "discard the first ";" and trim".
+ var unparsed = str.slice(firstSemi).replace(/^\s*;\s*/,'').trim();
+
+ // "If the unparsed-attributes string is empty, skip the rest of these
+ // steps."
+ if (unparsed.length === 0) {
+ return c;
+ }
+
+ /*
+ * S5.2 says that when looping over the items "[p]rocess the attribute-name
+ * and attribute-value according to the requirements in the following
+ * subsections" for every item. Plus, for many of the individual attributes
+ * in S5.3 it says to use the "attribute-value of the last attribute in the
+ * cookie-attribute-list". Therefore, in this implementation, we overwrite
+ * the previous value.
+ */
+ var cookie_avs = unparsed.split(/\s*;\s*/);
+ while (cookie_avs.length) {
+ var av = cookie_avs.shift();
+ var av_sep = av.indexOf('=');
+ var av_key, av_value;
+
+ if (av_sep === -1) {
+ av_key = av;
+ av_value = null;
+ } else {
+ av_key = av.substr(0,av_sep);
+ av_value = av.substr(av_sep+1);
+ }
+
+ av_key = av_key.trim().toLowerCase();
+
+ if (av_value) {
+ av_value = av_value.trim();
+ }
+
+ switch(av_key) {
+ case 'expires': // S5.2.1
+ if (av_value) {
+ var exp = parseDate(av_value);
+ // "If the attribute-value failed to parse as a cookie date, ignore the
+ // cookie-av."
+ if (exp) {
+ // over and underflow not realistically a concern: V8's getTime() seems to
+ // store something larger than a 32-bit time_t (even with 32-bit node)
+ c.expires = exp;
+ }
+ }
+ break;
+
+ case 'max-age': // S5.2.2
+ if (av_value) {
+ // "If the first character of the attribute-value is not a DIGIT or a "-"
+ // character ...[or]... If the remainder of attribute-value contains a
+ // non-DIGIT character, ignore the cookie-av."
+ if (/^-?[0-9]+$/.test(av_value)) {
+ var delta = parseInt(av_value, 10);
+ // "If delta-seconds is less than or equal to zero (0), let expiry-time
+ // be the earliest representable date and time."
+ c.setMaxAge(delta);
+ }
+ }
+ break;
+
+ case 'domain': // S5.2.3
+ // "If the attribute-value is empty, the behavior is undefined. However,
+ // the user agent SHOULD ignore the cookie-av entirely."
+ if (av_value) {
+ // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E
+ // (".") character."
+ var domain = av_value.trim().replace(/^\./, '');
+ if (domain) {
+ // "Convert the cookie-domain to lower case."
+ c.domain = domain.toLowerCase();
+ }
+ }
+ break;
+
+ case 'path': // S5.2.4
+ /*
+ * "If the attribute-value is empty or if the first character of the
+ * attribute-value is not %x2F ("/"):
+ * Let cookie-path be the default-path.
+ * Otherwise:
+ * Let cookie-path be the attribute-value."
+ *
+ * We'll represent the default-path as null since it depends on the
+ * context of the parsing.
+ */
+ c.path = av_value && av_value[0] === "/" ? av_value : null;
+ break;
+
+ case 'secure': // S5.2.5
+ /*
+ * "If the attribute-name case-insensitively matches the string "Secure",
+ * the user agent MUST append an attribute to the cookie-attribute-list
+ * with an attribute-name of Secure and an empty attribute-value."
+ */
+ c.secure = true;
+ break;
+
+ case 'httponly': // S5.2.6 -- effectively the same as 'secure'
+ c.httpOnly = true;
+ break;
+
+ default:
+ c.extensions = c.extensions || [];
+ c.extensions.push(av);
+ break;
+ }
+ }
+
+ return c;
+}
+
+// avoid the V8 deoptimization monster!
+function jsonParse(str) {
+ var obj;
+ try {
+ obj = JSON.parse(str);
+ } catch (e) {
+ return e;
+ }
+ return obj;
+}
+
+function fromJSON(str) {
+ if (!str) {
+ return null;
+ }
+
+ var obj;
+ if (typeof str === 'string') {
+ obj = jsonParse(str);
+ if (obj instanceof Error) {
+ return null;
+ }
+ } else {
+ // assume it's an Object
+ obj = str;
+ }
+
+ var c = new Cookie();
+ for (var i=0; i<Cookie.serializableProperties.length; i++) {
+ var prop = Cookie.serializableProperties[i];
+ if (obj[prop] === undefined ||
+ obj[prop] === Cookie.prototype[prop])
+ {
+ continue; // leave as prototype default
+ }
+
+ if (prop === 'expires' ||
+ prop === 'creation' ||
+ prop === 'lastAccessed')
+ {
+ if (obj[prop] === null) {
+ c[prop] = null;
+ } else {
+ c[prop] = obj[prop] == "Infinity" ?
+ "Infinity" : new Date(obj[prop]);
+ }
+ } else {
+ c[prop] = obj[prop];
+ }
+ }
+
+ return c;
+}
+
+/* Section 5.4 part 2:
+ * "* Cookies with longer paths are listed before cookies with
+ * shorter paths.
+ *
+ * * Among cookies that have equal-length path fields, cookies with
+ * earlier creation-times are listed before cookies with later
+ * creation-times."
+ */
+
+function cookieCompare(a,b) {
+ var cmp = 0;
+
+ // descending for length: b CMP a
+ var aPathLen = a.path ? a.path.length : 0;
+ var bPathLen = b.path ? b.path.length : 0;
+ cmp = bPathLen - aPathLen;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ // ascending for time: a CMP b
+ var aTime = a.creation ? a.creation.getTime() : MAX_TIME;
+ var bTime = b.creation ? b.creation.getTime() : MAX_TIME;
+ cmp = aTime - bTime;
+ if (cmp !== 0) {
+ return cmp;
+ }
+
+ // break ties for the same millisecond (precision of JavaScript's clock)
+ cmp = a.creationIndex - b.creationIndex;
+
+ return cmp;
+}
+
+// Gives the permutation of all possible pathMatch()es of a given path. The
+// array is in longest-to-shortest order. Handy for indexing.
+function permutePath(path) {
+ if (path === '/') {
+ return ['/'];
+ }
+ if (path.lastIndexOf('/') === path.length-1) {
+ path = path.substr(0,path.length-1);
+ }
+ var permutations = [path];
+ while (path.length > 1) {
+ var lindex = path.lastIndexOf('/');
+ if (lindex === 0) {
+ break;
+ }
+ path = path.substr(0,lindex);
+ permutations.push(path);
+ }
+ permutations.push('/');
+ return permutations;
+}
+
+function getCookieContext(url) {
+ if (url instanceof Object) {
+ return url;
+ }
+ // NOTE: decodeURI will throw on malformed URIs (see GH-32).
+ // Therefore, we will just skip decoding for such URIs.
+ try {
+ url = decodeURI(url);
+ }
+ catch(err) {
+ // Silently swallow error
+ }
+
+ return urlParse(url);
+}
+
+function Cookie(options) {
+ options = options || {};
+
+ Object.keys(options).forEach(function(prop) {
+ if (Cookie.prototype.hasOwnProperty(prop) &&
+ Cookie.prototype[prop] !== options[prop] &&
+ prop.substr(0,1) !== '_')
+ {
+ this[prop] = options[prop];
+ }
+ }, this);
+
+ this.creation = this.creation || new Date();
+
+ // used to break creation ties in cookieCompare():
+ Object.defineProperty(this, 'creationIndex', {
+ configurable: false,
+ enumerable: false, // important for assert.deepEqual checks
+ writable: true,
+ value: ++Cookie.cookiesCreated
+ });
+}
+
+Cookie.cookiesCreated = 0; // incremented each time a cookie is created
+
+Cookie.parse = parse;
+Cookie.fromJSON = fromJSON;
+
+Cookie.prototype.key = "";
+Cookie.prototype.value = "";
+
+// the order in which the RFC has them:
+Cookie.prototype.expires = "Infinity"; // coerces to literal Infinity
+Cookie.prototype.maxAge = null; // takes precedence over expires for TTL
+Cookie.prototype.domain = null;
+Cookie.prototype.path = null;
+Cookie.prototype.secure = false;
+Cookie.prototype.httpOnly = false;
+Cookie.prototype.extensions = null;
+
+// set by the CookieJar:
+Cookie.prototype.hostOnly = null; // boolean when set
+Cookie.prototype.pathIsDefault = null; // boolean when set
+Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse
+Cookie.prototype.lastAccessed = null; // Date when set
+Object.defineProperty(Cookie.prototype, 'creationIndex', {
+ configurable: true,
+ enumerable: false,
+ writable: true,
+ value: 0
+});
+
+Cookie.serializableProperties = Object.keys(Cookie.prototype)
+ .filter(function(prop) {
+ return !(
+ Cookie.prototype[prop] instanceof Function ||
+ prop === 'creationIndex' ||
+ prop.substr(0,1) === '_'
+ );
+ });
+
+Cookie.prototype.inspect = function inspect() {
+ var now = Date.now();
+ return 'Cookie="'+this.toString() +
+ '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') +
+ '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') +
+ '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') +
+ '"';
+};
+
+Cookie.prototype.toJSON = function() {
+ var obj = {};
+
+ var props = Cookie.serializableProperties;
+ for (var i=0; i<props.length; i++) {
+ var prop = props[i];
+ if (this[prop] === Cookie.prototype[prop]) {
+ continue; // leave as prototype default
+ }
+
+ if (prop === 'expires' ||
+ prop === 'creation' ||
+ prop === 'lastAccessed')
+ {
+ if (this[prop] === null) {
+ obj[prop] = null;
+ } else {
+ obj[prop] = this[prop] == "Infinity" ? // intentionally not ===
+ "Infinity" : this[prop].toISOString();
+ }
+ } else if (prop === 'maxAge') {
+ if (this[prop] !== null) {
+ // again, intentionally not ===
+ obj[prop] = (this[prop] == Infinity || this[prop] == -Infinity) ?
+ this[prop].toString() : this[prop];
+ }
+ } else {
+ if (this[prop] !== Cookie.prototype[prop]) {
+ obj[prop] = this[prop];
+ }
+ }
+ }
+
+ return obj;
+};
+
+Cookie.prototype.clone = function() {
+ return fromJSON(this.toJSON());
+};
+
+Cookie.prototype.validate = function validate() {
+ if (!COOKIE_OCTETS.test(this.value)) {
+ return false;
+ }
+ if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires)) {
+ return false;
+ }
+ if (this.maxAge != null && this.maxAge <= 0) {
+ return false; // "Max-Age=" non-zero-digit *DIGIT
+ }
+ if (this.path != null && !PATH_VALUE.test(this.path)) {
+ return false;
+ }
+
+ var cdomain = this.cdomain();
+ if (cdomain) {
+ if (cdomain.match(/\.$/)) {
+ return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this
+ }
+ var suffix = pubsuffix.getPublicSuffix(cdomain);
+ if (suffix == null) { // it's a public suffix
+ return false;
+ }
+ }
+ return true;
+};
+
+Cookie.prototype.setExpires = function setExpires(exp) {
+ if (exp instanceof Date) {
+ this.expires = exp;
+ } else {
+ this.expires = parseDate(exp) || "Infinity";
+ }
+};
+
+Cookie.prototype.setMaxAge = function setMaxAge(age) {
+ if (age === Infinity || age === -Infinity) {
+ this.maxAge = age.toString(); // so JSON.stringify() works
+ } else {
+ this.maxAge = age;
+ }
+};
+
+// gives Cookie header format
+Cookie.prototype.cookieString = function cookieString() {
+ var val = this.value;
+ if (val == null) {
+ val = '';
+ }
+ if (this.key === '') {
+ return val;
+ }
+ return this.key+'='+val;
+};
+
+// gives Set-Cookie header format
+Cookie.prototype.toString = function toString() {
+ var str = this.cookieString();
+
+ if (this.expires != Infinity) {
+ if (this.expires instanceof Date) {
+ str += '; Expires='+formatDate(this.expires);
+ } else {
+ str += '; Expires='+this.expires;
+ }
+ }
+
+ if (this.maxAge != null && this.maxAge != Infinity) {
+ str += '; Max-Age='+this.maxAge;
+ }
+
+ if (this.domain && !this.hostOnly) {
+ str += '; Domain='+this.domain;
+ }
+ if (this.path) {
+ str += '; Path='+this.path;
+ }
+
+ if (this.secure) {
+ str += '; Secure';
+ }
+ if (this.httpOnly) {
+ str += '; HttpOnly';
+ }
+ if (this.extensions) {
+ this.extensions.forEach(function(ext) {
+ str += '; '+ext;
+ });
+ }
+
+ return str;
+};
+
+// TTL() partially replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
+// elsewhere)
+// S5.3 says to give the "latest representable date" for which we use Infinity
+// For "expired" we use 0
+Cookie.prototype.TTL = function TTL(now) {
+ /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires
+ * attribute, the Max-Age attribute has precedence and controls the
+ * expiration date of the cookie.
+ * (Concurs with S5.3 step 3)
+ */
+ if (this.maxAge != null) {
+ return this.maxAge<=0 ? 0 : this.maxAge*1000;
+ }
+
+ var expires = this.expires;
+ if (expires != Infinity) {
+ if (!(expires instanceof Date)) {
+ expires = parseDate(expires) || Infinity;
+ }
+
+ if (expires == Infinity) {
+ return Infinity;
+ }
+
+ return expires.getTime() - (now || Date.now());
+ }
+
+ return Infinity;
+};
+
+// expiryTime() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
+// elsewhere)
+Cookie.prototype.expiryTime = function expiryTime(now) {
+ if (this.maxAge != null) {
+ var relativeTo = now || this.creation || new Date();
+ var age = (this.maxAge <= 0) ? -Infinity : this.maxAge*1000;
+ return relativeTo.getTime() + age;
+ }
+
+ if (this.expires == Infinity) {
+ return Infinity;
+ }
+ return this.expires.getTime();
+};
+
+// expiryDate() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
+// elsewhere), except it returns a Date
+Cookie.prototype.expiryDate = function expiryDate(now) {
+ var millisec = this.expiryTime(now);
+ if (millisec == Infinity) {
+ return new Date(MAX_TIME);
+ } else if (millisec == -Infinity) {
+ return new Date(MIN_TIME);
+ } else {
+ return new Date(millisec);
+ }
+};
+
+// This replaces the "persistent-flag" parts of S5.3 step 3
+Cookie.prototype.isPersistent = function isPersistent() {
+ return (this.maxAge != null || this.expires != Infinity);
+};
+
+// Mostly S5.1.2 and S5.2.3:
+Cookie.prototype.cdomain =
+Cookie.prototype.canonicalizedDomain = function canonicalizedDomain() {
+ if (this.domain == null) {
+ return null;
+ }
+ return canonicalDomain(this.domain);
+};
+
+function CookieJar(store, options) {
+ if (typeof options === "boolean") {
+ options = {rejectPublicSuffixes: options};
+ } else if (options == null) {
+ options = {};
+ }
+ if (options.rejectPublicSuffixes != null) {
+ this.rejectPublicSuffixes = options.rejectPublicSuffixes;
+ }
+ if (options.looseMode != null) {
+ this.enableLooseMode = options.looseMode;
+ }
+
+ if (!store) {
+ store = new MemoryCookieStore();
+ }
+ this.store = store;
+}
+CookieJar.prototype.store = null;
+CookieJar.prototype.rejectPublicSuffixes = true;
+CookieJar.prototype.enableLooseMode = false;
+var CAN_BE_SYNC = [];
+
+CAN_BE_SYNC.push('setCookie');
+CookieJar.prototype.setCookie = function(cookie, url, options, cb) {
+ var err;
+ var context = getCookieContext(url);
+ if (options instanceof Function) {
+ cb = options;
+ options = {};
+ }
+
+ var host = canonicalDomain(context.hostname);
+ var loose = this.enableLooseMode;
+ if (options.loose != null) {
+ loose = options.loose;
+ }
+
+ // S5.3 step 1
+ if (!(cookie instanceof Cookie)) {
+ cookie = Cookie.parse(cookie, { loose: loose });
+ }
+ if (!cookie) {
+ err = new Error("Cookie failed to parse");
+ return cb(options.ignoreError ? null : err);
+ }
+
+ // S5.3 step 2
+ var now = options.now || new Date(); // will assign later to save effort in the face of errors
+
+ // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie()
+
+ // S5.3 step 4: NOOP; domain is null by default
+
+ // S5.3 step 5: public suffixes
+ if (this.rejectPublicSuffixes && cookie.domain) {
+ var suffix = pubsuffix.getPublicSuffix(cookie.cdomain());
+ if (suffix == null) { // e.g. "com"
+ err = new Error("Cookie has domain set to a public suffix");
+ return cb(options.ignoreError ? null : err);
+ }
+ }
+
+ // S5.3 step 6:
+ if (cookie.domain) {
+ if (!domainMatch(host, cookie.cdomain(), false)) {
+ err = new Error("Cookie not in this host's domain. Cookie:"+cookie.cdomain()+" Request:"+host);
+ return cb(options.ignoreError ? null : err);
+ }
+
+ if (cookie.hostOnly == null) { // don't reset if already set
+ cookie.hostOnly = false;
+ }
+
+ } else {
+ cookie.hostOnly = true;
+ cookie.domain = host;
+ }
+
+ //S5.2.4 If the attribute-value is empty or if the first character of the
+ //attribute-value is not %x2F ("/"):
+ //Let cookie-path be the default-path.
+ if (!cookie.path || cookie.path[0] !== '/') {
+ cookie.path = defaultPath(context.pathname);
+ cookie.pathIsDefault = true;
+ }
+
+ // S5.3 step 8: NOOP; secure attribute
+ // S5.3 step 9: NOOP; httpOnly attribute
+
+ // S5.3 step 10
+ if (options.http === false && cookie.httpOnly) {
+ err = new Error("Cookie is HttpOnly and this isn't an HTTP API");
+ return cb(options.ignoreError ? null : err);
+ }
+
+ var store = this.store;
+
+ if (!store.updateCookie) {
+ store.updateCookie = function(oldCookie, newCookie, cb) {
+ this.putCookie(newCookie, cb);
+ };
+ }
+
+ function withCookie(err, oldCookie) {
+ if (err) {
+ return cb(err);
+ }
+
+ var next = function(err) {
+ if (err) {
+ return cb(err);
+ } else {
+ cb(null, cookie);
+ }
+ };
+
+ if (oldCookie) {
+ // S5.3 step 11 - "If the cookie store contains a cookie with the same name,
+ // domain, and path as the newly created cookie:"
+ if (options.http === false && oldCookie.httpOnly) { // step 11.2
+ err = new Error("old Cookie is HttpOnly and this isn't an HTTP API");
+ return cb(options.ignoreError ? null : err);
+ }
+ cookie.creation = oldCookie.creation; // step 11.3
+ cookie.creationIndex = oldCookie.creationIndex; // preserve tie-breaker
+ cookie.lastAccessed = now;
+ // Step 11.4 (delete cookie) is implied by just setting the new one:
+ store.updateCookie(oldCookie, cookie, next); // step 12
+
+ } else {
+ cookie.creation = cookie.lastAccessed = now;
+ store.putCookie(cookie, next); // step 12
+ }
+ }
+
+ store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);
+};
+
+// RFC6365 S5.4
+CAN_BE_SYNC.push('getCookies');
+CookieJar.prototype.getCookies = function(url, options, cb) {
+ var context = getCookieContext(url);
+ if (options instanceof Function) {
+ cb = options;
+ options = {};
+ }
+
+ var host = canonicalDomain(context.hostname);
+ var path = context.pathname || '/';
+
+ var secure = options.secure;
+ if (secure == null && context.protocol &&
+ (context.protocol == 'https:' || context.protocol == 'wss:'))
+ {
+ secure = true;
+ }
+
+ var http = options.http;
+ if (http == null) {
+ http = true;
+ }
+
+ var now = options.now || Date.now();
+ var expireCheck = options.expire !== false;
+ var allPaths = !!options.allPaths;
+ var store = this.store;
+
+ function matchingCookie(c) {
+ // "Either:
+ // The cookie's host-only-flag is true and the canonicalized
+ // request-host is identical to the cookie's domain.
+ // Or:
+ // The cookie's host-only-flag is false and the canonicalized
+ // request-host domain-matches the cookie's domain."
+ if (c.hostOnly) {
+ if (c.domain != host) {
+ return false;
+ }
+ } else {
+ if (!domainMatch(host, c.domain, false)) {
+ return false;
+ }
+ }
+
+ // "The request-uri's path path-matches the cookie's path."
+ if (!allPaths && !pathMatch(path, c.path)) {
+ return false;
+ }
+
+ // "If the cookie's secure-only-flag is true, then the request-uri's
+ // scheme must denote a "secure" protocol"
+ if (c.secure && !secure) {
+ return false;
+ }
+
+ // "If the cookie's http-only-flag is true, then exclude the cookie if the
+ // cookie-string is being generated for a "non-HTTP" API"
+ if (c.httpOnly && !http) {
+ return false;
+ }
+
+ // deferred from S5.3
+ // non-RFC: allow retention of expired cookies by choice
+ if (expireCheck && c.expiryTime() <= now) {
+ store.removeCookie(c.domain, c.path, c.key, function(){}); // result ignored
+ return false;
+ }
+
+ return true;
+ }
+
+ store.findCookies(host, allPaths ? null : path, function(err,cookies) {
+ if (err) {
+ return cb(err);
+ }
+
+ cookies = cookies.filter(matchingCookie);
+
+ // sorting of S5.4 part 2
+ if (options.sort !== false) {
+ cookies = cookies.sort(cookieCompare);
+ }
+
+ // S5.4 part 3
+ var now = new Date();
+ cookies.forEach(function(c) {
+ c.lastAccessed = now;
+ });
+ // TODO persist lastAccessed
+
+ cb(null,cookies);
+ });
+};
+
+CAN_BE_SYNC.push('getCookieString');
+CookieJar.prototype.getCookieString = function(/*..., cb*/) {
+ var args = Array.prototype.slice.call(arguments,0);
+ var cb = args.pop();
+ var next = function(err,cookies) {
+ if (err) {
+ cb(err);
+ } else {
+ cb(null, cookies
+ .sort(cookieCompare)
+ .map(function(c){
+ return c.cookieString();
+ })
+ .join('; '));
+ }
+ };
+ args.push(next);
+ this.getCookies.apply(this,args);
+};
+
+CAN_BE_SYNC.push('getSetCookieStrings');
+CookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) {
+ var args = Array.prototype.slice.call(arguments,0);
+ var cb = args.pop();
+ var next = function(err,cookies) {
+ if (err) {
+ cb(err);
+ } else {
+ cb(null, cookies.map(function(c){
+ return c.toString();
+ }));
+ }
+ };
+ args.push(next);
+ this.getCookies.apply(this,args);
+};
+
+CAN_BE_SYNC.push('serialize');
+CookieJar.prototype.serialize = function(cb) {
+ var type = this.store.constructor.name;
+ if (type === 'Object') {
+ type = null;
+ }
+
+ // update README.md "Serialization Format" if you change this, please!
+ var serialized = {
+ // The version of tough-cookie that serialized this jar. Generally a good
+ // practice since future versions can make data import decisions based on
+ // known past behavior. When/if this matters, use `semver`.
+ version: 'tough-cookie@'+VERSION,
+
+ // add the store type, to make humans happy:
+ storeType: type,
+
+ // CookieJar configuration:
+ rejectPublicSuffixes: !!this.rejectPublicSuffixes,
+
+ // this gets filled from getAllCookies:
+ cookies: []
+ };
+
+ if (!(this.store.getAllCookies &&
+ typeof this.store.getAllCookies === 'function'))
+ {
+ return cb(new Error('store does not support getAllCookies and cannot be serialized'));
+ }
+
+ this.store.getAllCookies(function(err,cookies) {
+ if (err) {
+ return cb(err);
+ }
+
+ serialized.cookies = cookies.map(function(cookie) {
+ // convert to serialized 'raw' cookies
+ cookie = (cookie instanceof Cookie) ? cookie.toJSON() : cookie;
+
+ // Remove the index so new ones get assigned during deserialization
+ delete cookie.creationIndex;
+
+ return cookie;
+ });
+
+ return cb(null, serialized);
+ });
+};
+
+// well-known name that JSON.stringify calls
+CookieJar.prototype.toJSON = function() {
+ return this.serializeSync();
+};
+
+// use the class method CookieJar.deserialize instead of calling this directly
+CAN_BE_SYNC.push('_importCookies');
+CookieJar.prototype._importCookies = function(serialized, cb) {
+ var jar = this;
+ var cookies = serialized.cookies;
+ if (!cookies || !Array.isArray(cookies)) {
+ return cb(new Error('serialized jar has no cookies array'));
+ }
+
+ function putNext(err) {
+ if (err) {
+ return cb(err);
+ }
+
+ if (!cookies.length) {
+ return cb(err, jar);
+ }
+
+ var cookie;
+ try {
+ cookie = fromJSON(cookies.shift());
+ } catch (e) {
+ return cb(e);
+ }
+
+ if (cookie === null) {
+ return putNext(null); // skip this cookie
+ }
+
+ jar.store.putCookie(cookie, putNext);
+ }
+
+ putNext();
+};
+
+CookieJar.deserialize = function(strOrObj, store, cb) {
+ if (arguments.length !== 3) {
+ // store is optional
+ cb = store;
+ store = null;
+ }
+
+ var serialized;
+ if (typeof strOrObj === 'string') {
+ serialized = jsonParse(strOrObj);
+ if (serialized instanceof Error) {
+ return cb(serialized);
+ }
+ } else {
+ serialized = strOrObj;
+ }
+
+ var jar = new CookieJar(store, serialized.rejectPublicSuffixes);
+ jar._importCookies(serialized, function(err) {
+ if (err) {
+ return cb(err);
+ }
+ cb(null, jar);
+ });
+};
+
+CookieJar.fromJSON = CookieJar.deserializeSync;
+CookieJar.deserializeSync = function(strOrObj, store) {
+ var serialized = typeof strOrObj === 'string' ?
+ JSON.parse(strOrObj) : strOrObj;
+ var jar = new CookieJar(store, serialized.rejectPublicSuffixes);
+
+ // catch this mistake early:
+ if (!jar.store.synchronous) {
+ throw new Error('CookieJar store is not synchronous; use async API instead.');
+ }
+
+ jar._importCookiesSync(serialized);
+ return jar;
+};
+
+CAN_BE_SYNC.push('clone');
+CookieJar.prototype.clone = function(newStore, cb) {
+ if (arguments.length === 1) {
+ cb = newStore;
+ newStore = null;
+ }
+
+ this.serialize(function(err,serialized) {
+ if (err) {
+ return cb(err);
+ }
+ CookieJar.deserialize(newStore, serialized, cb);
+ });
+};
+
+// Use a closure to provide a true imperative API for synchronous stores.
+function syncWrap(method) {
+ return function() {
+ if (!this.store.synchronous) {
+ throw new Error('CookieJar store is not synchronous; use async API instead.');
+ }
+
+ var args = Array.prototype.slice.call(arguments);
+ var syncErr, syncResult;
+ args.push(function syncCb(err, result) {
+ syncErr = err;
+ syncResult = result;
+ });
+ this[method].apply(this, args);
+
+ if (syncErr) {
+ throw syncErr;
+ }
+ return syncResult;
+ };
+}
+
+// wrap all declared CAN_BE_SYNC methods in the sync wrapper
+CAN_BE_SYNC.forEach(function(method) {
+ CookieJar.prototype[method+'Sync'] = syncWrap(method);
+});
+
+module.exports = {
+ CookieJar: CookieJar,
+ Cookie: Cookie,
+ Store: Store,
+ MemoryCookieStore: MemoryCookieStore,
+ parseDate: parseDate,
+ formatDate: formatDate,
+ parse: parse,
+ fromJSON: fromJSON,
+ domainMatch: domainMatch,
+ defaultPath: defaultPath,
+ pathMatch: pathMatch,
+ getPublicSuffix: pubsuffix.getPublicSuffix,
+ cookieCompare: cookieCompare,
+ permuteDomain: require('./permuteDomain').permuteDomain,
+ permutePath: permutePath,
+ canonicalDomain: canonicalDomain
+};
diff --git a/node_modules/request/node_modules/tough-cookie/lib/memstore.js b/node_modules/request/node_modules/tough-cookie/lib/memstore.js
new file mode 100644
index 000000000..89ceb6900
--- /dev/null
+++ b/node_modules/request/node_modules/tough-cookie/lib/memstore.js
@@ -0,0 +1,170 @@
+/*!
+ * Copyright (c) 2015, Salesforce.com, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of Salesforce.com nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+'use strict';
+var Store = require('./store').Store;
+var permuteDomain = require('./permuteDomain').permuteDomain;
+var pathMatch = require('./pathMatch').pathMatch;
+var util = require('util');
+
+function MemoryCookieStore() {
+ Store.call(this);
+ this.idx = {};
+}
+util.inherits(MemoryCookieStore, Store);
+exports.MemoryCookieStore = MemoryCookieStore;
+MemoryCookieStore.prototype.idx = null;
+
+// Since it's just a struct in RAM, this Store is synchronous
+MemoryCookieStore.prototype.synchronous = true;
+
+// force a default depth:
+MemoryCookieStore.prototype.inspect = function() {
+ return "{ idx: "+util.inspect(this.idx, false, 2)+' }';
+};
+
+MemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) {
+ if (!this.idx[domain]) {
+ return cb(null,undefined);
+ }
+ if (!this.idx[domain][path]) {
+ return cb(null,undefined);
+ }
+ return cb(null,this.idx[domain][path][key]||null);
+};
+
+MemoryCookieStore.prototype.findCookies = function(domain, path, cb) {
+ var results = [];
+ if (!domain) {
+ return cb(null,[]);
+ }
+
+ var pathMatcher;
+ if (!path) {
+ // null means "all paths"
+ pathMatcher = function matchAll(domainIndex) {
+ for (var curPath in domainIndex) {
+ var pathIndex = domainIndex[curPath];
+ for (var key in pathIndex) {
+ results.push(pathIndex[key]);
+ }
+ }
+ };
+
+ } else {
+ pathMatcher = function matchRFC(domainIndex) {
+ //NOTE: we should use path-match algorithm from S5.1.4 here
+ //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299)
+ Object.keys(domainIndex).forEach(function (cookiePath) {
+ if (pathMatch(path, cookiePath)) {
+ var pathIndex = domainIndex[cookiePath];
+
+ for (var key in pathIndex) {
+ results.push(pathIndex[key]);
+ }
+ }
+ });
+ };
+ }
+
+ var domains = permuteDomain(domain) || [domain];
+ var idx = this.idx;
+ domains.forEach(function(curDomain) {
+ var domainIndex = idx[curDomain];
+ if (!domainIndex) {
+ return;
+ }
+ pathMatcher(domainIndex);
+ });
+
+ cb(null,results);
+};
+
+MemoryCookieStore.prototype.putCookie = function(cookie, cb) {
+ if (!this.idx[cookie.domain]) {
+ this.idx[cookie.domain] = {};
+ }
+ if (!this.idx[cookie.domain][cookie.path]) {
+ this.idx[cookie.domain][cookie.path] = {};
+ }
+ this.idx[cookie.domain][cookie.path][cookie.key] = cookie;
+ cb(null);
+};
+
+MemoryCookieStore.prototype.updateCookie = function(oldCookie, newCookie, cb) {
+ // updateCookie() may avoid updating cookies that are identical. For example,
+ // lastAccessed may not be important to some stores and an equality
+ // comparison could exclude that field.
+ this.putCookie(newCookie,cb);
+};
+
+MemoryCookieStore.prototype.removeCookie = function(domain, path, key, cb) {
+ if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) {
+ delete this.idx[domain][path][key];
+ }
+ cb(null);
+};
+
+MemoryCookieStore.prototype.removeCookies = function(domain, path, cb) {
+ if (this.idx[domain]) {
+ if (path) {
+ delete this.idx[domain][path];
+ } else {
+ delete this.idx[domain];
+ }
+ }
+ return cb(null);
+};
+
+MemoryCookieStore.prototype.getAllCookies = function(cb) {
+ var cookies = [];
+ var idx = this.idx;
+
+ var domains = Object.keys(idx);
+ domains.forEach(function(domain) {
+ var paths = Object.keys(idx[domain]);
+ paths.forEach(function(path) {
+ var keys = Object.keys(idx[domain][path]);
+ keys.forEach(function(key) {
+ if (key !== null) {
+ cookies.push(idx[domain][path][key]);
+ }
+ });
+ });
+ });
+
+ // Sort by creationIndex so deserializing retains the creation order.
+ // When implementing your own store, this SHOULD retain the order too
+ cookies.sort(function(a,b) {
+ return (a.creationIndex||0) - (b.creationIndex||0);
+ });
+
+ cb(null, cookies);
+};
diff --git a/node_modules/request/node_modules/tough-cookie/lib/pathMatch.js b/node_modules/request/node_modules/tough-cookie/lib/pathMatch.js
new file mode 100644
index 000000000..7c7a79f1f
--- /dev/null
+++ b/node_modules/request/node_modules/tough-cookie/lib/pathMatch.js
@@ -0,0 +1,61 @@
+/*!
+ * Copyright (c) 2015, Salesforce.com, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of Salesforce.com nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+"use strict";
+/*
+ * "A request-path path-matches a given cookie-path if at least one of the
+ * following conditions holds:"
+ */
+function pathMatch (reqPath, cookiePath) {
+ // "o The cookie-path and the request-path are identical."
+ if (cookiePath === reqPath) {
+ return true;
+ }
+
+ var idx = reqPath.indexOf(cookiePath);
+ if (idx === 0) {
+ // "o The cookie-path is a prefix of the request-path, and the last
+ // character of the cookie-path is %x2F ("/")."
+ if (cookiePath.substr(-1) === "/") {
+ return true;
+ }
+
+ // " o The cookie-path is a prefix of the request-path, and the first
+ // character of the request-path that is not included in the cookie- path
+ // is a %x2F ("/") character."
+ if (reqPath.substr(cookiePath.length, 1) === "/") {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+exports.pathMatch = pathMatch;
diff --git a/node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js b/node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js
new file mode 100644
index 000000000..8af841b65
--- /dev/null
+++ b/node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js
@@ -0,0 +1,56 @@
+/*!
+ * Copyright (c) 2015, Salesforce.com, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of Salesforce.com nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+"use strict";
+var pubsuffix = require('./pubsuffix');
+
+// Gives the permutation of all possible domainMatch()es of a given domain. The
+// array is in shortest-to-longest order. Handy for indexing.
+function permuteDomain (domain) {
+ var pubSuf = pubsuffix.getPublicSuffix(domain);
+ if (!pubSuf) {
+ return null;
+ }
+ if (pubSuf == domain) {
+ return [domain];
+ }
+
+ var prefix = domain.slice(0, -(pubSuf.length + 1)); // ".example.com"
+ var parts = prefix.split('.').reverse();
+ var cur = pubSuf;
+ var permutations = [cur];
+ while (parts.length) {
+ cur = parts.shift() + '.' + cur;
+ permutations.push(cur);
+ }
+ return permutations;
+}
+
+exports.permuteDomain = permuteDomain;
diff --git a/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js b/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js
new file mode 100644
index 000000000..62fd3da3f
--- /dev/null
+++ b/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js
@@ -0,0 +1,98 @@
+/****************************************************
+ * AUTOMATICALLY GENERATED by generate-pubsuffix.js *
+ * DO NOT EDIT! *
+ ****************************************************/
+
+"use strict";
+
+var punycode = require('punycode');
+
+module.exports.getPublicSuffix = function getPublicSuffix(domain) {
+ /*!
+ * Copyright (c) 2015, Salesforce.com, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of Salesforce.com nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+ if (!domain) {
+ return null;
+ }
+ if (domain.match(/^\./)) {
+ return null;
+ }
+ var asciiDomain = punycode.toASCII(domain);
+ var converted = false;
+ if (asciiDomain !== domain) {
+ domain = asciiDomain;
+ converted = true;
+ }
+ if (index[domain]) {
+ return null;
+ }
+
+ domain = domain.toLowerCase();
+ var parts = domain.split('.').reverse();
+
+ var suffix = '';
+ var suffixLen = 0;
+ for (var i=0; i<parts.length; i++) {
+ var part = parts[i];
+ var starstr = '*'+suffix;
+ var partstr = part+suffix;
+
+ if (index[starstr]) { // star rule matches
+ suffixLen = i+1;
+ if (index[partstr] === false) { // exception rule matches (NB: false, not undefined)
+ suffixLen--;
+ }
+ } else if (index[partstr]) { // exact match, not exception
+ suffixLen = i+1;
+ }
+
+ suffix = '.'+partstr;
+ }
+
+ if (index['*'+suffix]) { // *.domain exists (e.g. *.kyoto.jp for domain='kyoto.jp');
+ return null;
+ }
+
+ suffixLen = suffixLen || 1;
+ if (parts.length > suffixLen) {
+ var publicSuffix = parts.slice(0,suffixLen+1).reverse().join('.');
+ return converted ? punycode.toUnicode(publicSuffix) : publicSuffix;
+ }
+
+ return null;
+};
+
+// The following generated structure is used under the MPL version 2.0
+// See public-suffix.txt for more information
+
+var index = module.exports.index = Object.freeze(
+{"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"crew.aero":true,"design.aero":true,"dgca.aero":true,"educator.aero":true,"emergency.aero":true,"engine.aero":true,"engineer.aero":true,"entertainment.aero":true,"equipment.aero":true,"exchange.aero":true,"express.aero":true,"federation.aero":true,"flight.aero":true,"freight.aero":true,"fuel.aero":true,"gliding.aero":true,"government.aero":true,"groundhandling.aero":true,"group.aero":true,"hanggliding.aero":true,"homebuilt.aero":true,"insurance.aero":true,"journal.aero":true,"journalist.aero":true,"leasing.aero":true,"logistics.aero":true,"magazine.aero":true,"maintenance.aero":true,"marketplace.aero":true,"media.aero":true,"microlight.aero":true,"modelling.aero":true,"navigation.aero":true,"parachuting.aero":true,"paragliding.aero":true,"passenger-association.aero":true,"pilot.aero":true,"press.aero":true,"production.aero":true,"recreation.aero":true,"repbody.aero":true,"res.aero":true,"research.aero":true,"rotorcraft.aero":true,"safety.aero":true,"scientist.aero":true,"services.aero":true,"show.aero":true,"skydiving.aero":true,"software.aero":true,"student.aero":true,"taxi.aero":true,"trader.aero":true,"trading.aero":true,"trainer.aero":true,"union.aero":true,"workinggroup.aero":true,"works.aero":true,"af":true,"gov.af":true,"com.af":true,"org.af":true,"net.af":true,"edu.af":true,"ag":true,"com.ag":true,"org.ag":true,"net.ag":true,"co.ag":true,"nom.ag":true,"ai":true,"off.ai":true,"com.ai":true,"net.ai":true,"org.ai":true,"al":true,"com.al":true,"edu.al":true,"gov.al":true,"mil.al":true,"net.al":true,"org.al":true,"am":true,"an":true,"com.an":true,"net.an":true,"org.an":true,"edu.an":true,"ao":true,"ed.ao":true,"gv.ao":true,"og.ao":true,"co.ao":true,"pb.ao":true,"it.ao":true,"aq":true,"ar":true,"com.ar":true,"edu.ar":true,"gob.ar":true,"gov.ar":true,"int.ar":true,"mil.ar":true,"net.ar":true,"org.ar":true,"tur.ar":true,"arpa":true,"e164.arpa":true,"in-addr.arpa":true,"ip6.arpa":true,"iris.arpa":true,"uri.arpa":true,"urn.arpa":true,"as":true,"gov.as":true,"asia":true,"at":true,"ac.at":true,"co.at":true,"gv.at":true,"or.at":true,"au":true,"com.au":true,"net.au":true,"org.au":true,"edu.au":true,"gov.au":true,"asn.au":true,"id.au":true,"info.au":true,"conf.au":true,"oz.au":true,"act.au":true,"nsw.au":true,"nt.au":true,"qld.au":true,"sa.au":true,"tas.au":true,"vic.au":true,"wa.au":true,"act.edu.au":true,"nsw.edu.au":true,"nt.edu.au":true,"qld.edu.au":true,"sa.edu.au":true,"tas.edu.au":true,"vic.edu.au":true,"wa.edu.au":true,"qld.gov.au":true,"sa.gov.au":true,"tas.gov.au":true,"vic.gov.au":true,"wa.gov.au":true,"aw":true,"com.aw":true,"ax":true,"az":true,"com.az":true,"net.az":true,"int.az":true,"gov.az":true,"org.az":true,"edu.az":true,"info.az":true,"pp.az":true,"mil.az":true,"name.az":true,"pro.az":true,"biz.az":true,"ba":true,"org.ba":true,"net.ba":true,"edu.ba":true,"gov.ba":true,"mil.ba":true,"unsa.ba":true,"unbi.ba":true,"co.ba":true,"com.ba":true,"rs.ba":true,"bb":true,"biz.bb":true,"co.bb":true,"com.bb":true,"edu.bb":true,"gov.bb":true,"info.bb":true,"net.bb":true,"org.bb":true,"store.bb":true,"tv.bb":true,"*.bd":true,"be":true,"ac.be":true,"bf":true,"gov.bf":true,"bg":true,"a.bg":true,"b.bg":true,"c.bg":true,"d.bg":true,"e.bg":true,"f.bg":true,"g.bg":true,"h.bg":true,"i.bg":true,"j.bg":true,"k.bg":true,"l.bg":true,"m.bg":true,"n.bg":true,"o.bg":true,"p.bg":true,"q.bg":true,"r.bg":true,"s.bg":true,"t.bg":true,"u.bg":true,"v.bg":true,"w.bg":true,"x.bg":true,"y.bg":true,"z.bg":true,"0.bg":true,"1.bg":true,"2.bg":true,"3.bg":true,"4.bg":true,"5.bg":true,"6.bg":true,"7.bg":true,"8.bg":true,"9.bg":true,"bh":true,"com.bh":true,"edu.bh":true,"net.bh":true,"org.bh":true,"gov.bh":true,"bi":true,"co.bi":true,"com.bi":true,"edu.bi":true,"or.bi":true,"org.bi":true,"biz":true,"bj":true,"asso.bj":true,"barreau.bj":true,"gouv.bj":true,"bm":true,"com.bm":true,"edu.bm":true,"gov.bm":true,"net.bm":true,"org.bm":true,"*.bn":true,"bo":true,"com.bo":true,"edu.bo":true,"gov.bo":true,"gob.bo":true,"int.bo":true,"org.bo":true,"net.bo":true,"mil.bo":true,"tv.bo":true,"br":true,"adm.br":true,"adv.br":true,"agr.br":true,"am.br":true,"arq.br":true,"art.br":true,"ato.br":true,"b.br":true,"bio.br":true,"blog.br":true,"bmd.br":true,"cim.br":true,"cng.br":true,"cnt.br":true,"com.br":true,"coop.br":true,"ecn.br":true,"eco.br":true,"edu.br":true,"emp.br":true,"eng.br":true,"esp.br":true,"etc.br":true,"eti.br":true,"far.br":true,"flog.br":true,"fm.br":true,"fnd.br":true,"fot.br":true,"fst.br":true,"g12.br":true,"ggf.br":true,"gov.br":true,"imb.br":true,"ind.br":true,"inf.br":true,"jor.br":true,"jus.br":true,"leg.br":true,"lel.br":true,"mat.br":true,"med.br":true,"mil.br":true,"mp.br":true,"mus.br":true,"net.br":true,"*.nom.br":true,"not.br":true,"ntr.br":true,"odo.br":true,"org.br":true,"ppg.br":true,"pro.br":true,"psc.br":true,"psi.br":true,"qsl.br":true,"radio.br":true,"rec.br":true,"slg.br":true,"srv.br":true,"taxi.br":true,"teo.br":true,"tmp.br":true,"trd.br":true,"tur.br":true,"tv.br":true,"vet.br":true,"vlog.br":true,"wiki.br":true,"zlg.br":true,"bs":true,"com.bs":true,"net.bs":true,"org.bs":true,"edu.bs":true,"gov.bs":true,"bt":true,"com.bt":true,"edu.bt":true,"gov.bt":true,"net.bt":true,"org.bt":true,"bv":true,"bw":true,"co.bw":true,"org.bw":true,"by":true,"gov.by":true,"mil.by":true,"com.by":true,"of.by":true,"bz":true,"com.bz":true,"net.bz":true,"org.bz":true,"edu.bz":true,"gov.bz":true,"ca":true,"ab.ca":true,"bc.ca":true,"mb.ca":true,"nb.ca":true,"nf.ca":true,"nl.ca":true,"ns.ca":true,"nt.ca":true,"nu.ca":true,"on.ca":true,"pe.ca":true,"qc.ca":true,"sk.ca":true,"yk.ca":true,"gc.ca":true,"cat":true,"cc":true,"cd":true,"gov.cd":true,"cf":true,"cg":true,"ch":true,"ci":true,"org.ci":true,"or.ci":true,"com.ci":true,"co.ci":true,"edu.ci":true,"ed.ci":true,"ac.ci":true,"net.ci":true,"go.ci":true,"asso.ci":true,"xn--aroport-bya.ci":true,"int.ci":true,"presse.ci":true,"md.ci":true,"gouv.ci":true,"*.ck":true,"www.ck":false,"cl":true,"gov.cl":true,"gob.cl":true,"co.cl":true,"mil.cl":true,"cm":true,"co.cm":true,"com.cm":true,"gov.cm":true,"net.cm":true,"cn":true,"ac.cn":true,"com.cn":true,"edu.cn":true,"gov.cn":true,"net.cn":true,"org.cn":true,"mil.cn":true,"xn--55qx5d.cn":true,"xn--io0a7i.cn":true,"xn--od0alg.cn":true,"ah.cn":true,"bj.cn":true,"cq.cn":true,"fj.cn":true,"gd.cn":true,"gs.cn":true,"gz.cn":true,"gx.cn":true,"ha.cn":true,"hb.cn":true,"he.cn":true,"hi.cn":true,"hl.cn":true,"hn.cn":true,"jl.cn":true,"js.cn":true,"jx.cn":true,"ln.cn":true,"nm.cn":true,"nx.cn":true,"qh.cn":true,"sc.cn":true,"sd.cn":true,"sh.cn":true,"sn.cn":true,"sx.cn":true,"tj.cn":true,"xj.cn":true,"xz.cn":true,"yn.cn":true,"zj.cn":true,"hk.cn":true,"mo.cn":true,"tw.cn":true,"co":true,"arts.co":true,"com.co":true,"edu.co":true,"firm.co":true,"gov.co":true,"info.co":true,"int.co":true,"mil.co":true,"net.co":true,"nom.co":true,"org.co":true,"rec.co":true,"web.co":true,"com":true,"coop":true,"cr":true,"ac.cr":true,"co.cr":true,"ed.cr":true,"fi.cr":true,"go.cr":true,"or.cr":true,"sa.cr":true,"cu":true,"com.cu":true,"edu.cu":true,"org.cu":true,"net.cu":true,"gov.cu":true,"inf.cu":true,"cv":true,"cw":true,"com.cw":true,"edu.cw":true,"net.cw":true,"org.cw":true,"cx":true,"gov.cx":true,"ac.cy":true,"biz.cy":true,"com.cy":true,"ekloges.cy":true,"gov.cy":true,"ltd.cy":true,"name.cy":true,"net.cy":true,"org.cy":true,"parliament.cy":true,"press.cy":true,"pro.cy":true,"tm.cy":true,"cz":true,"de":true,"dj":true,"dk":true,"dm":true,"com.dm":true,"net.dm":true,"org.dm":true,"edu.dm":true,"gov.dm":true,"do":true,"art.do":true,"com.do":true,"edu.do":true,"gob.do":true,"gov.do":true,"mil.do":true,"net.do":true,"org.do":true,"sld.do":true,"web.do":true,"dz":true,"com.dz":true,"org.dz":true,"net.dz":true,"gov.dz":true,"edu.dz":true,"asso.dz":true,"pol.dz":true,"art.dz":true,"ec":true,"com.ec":true,"info.ec":true,"net.ec":true,"fin.ec":true,"k12.ec":true,"med.ec":true,"pro.ec":true,"org.ec":true,"edu.ec":true,"gov.ec":true,"gob.ec":true,"mil.ec":true,"edu":true,"ee":true,"edu.ee":true,"gov.ee":true,"riik.ee":true,"lib.ee":true,"med.ee":true,"com.ee":true,"pri.ee":true,"aip.ee":true,"org.ee":true,"fie.ee":true,"eg":true,"com.eg":true,"edu.eg":true,"eun.eg":true,"gov.eg":true,"mil.eg":true,"name.eg":true,"net.eg":true,"org.eg":true,"sci.eg":true,"*.er":true,"es":true,"com.es":true,"nom.es":true,"org.es":true,"gob.es":true,"edu.es":true,"et":true,"com.et":true,"gov.et":true,"org.et":true,"edu.et":true,"biz.et":true,"name.et":true,"info.et":true,"net.et":true,"eu":true,"fi":true,"aland.fi":true,"*.fj":true,"*.fk":true,"fm":true,"fo":true,"fr":true,"com.fr":true,"asso.fr":true,"nom.fr":true,"prd.fr":true,"presse.fr":true,"tm.fr":true,"aeroport.fr":true,"assedic.fr":true,"avocat.fr":true,"avoues.fr":true,"cci.fr":true,"chambagri.fr":true,"chirurgiens-dentistes.fr":true,"experts-comptables.fr":true,"geometre-expert.fr":true,"gouv.fr":true,"greta.fr":true,"huissier-justice.fr":true,"medecin.fr":true,"notaires.fr":true,"pharmacien.fr":true,"port.fr":true,"veterinaire.fr":true,"ga":true,"gb":true,"gd":true,"ge":true,"com.ge":true,"edu.ge":true,"gov.ge":true,"org.ge":true,"mil.ge":true,"net.ge":true,"pvt.ge":true,"gf":true,"gg":true,"co.gg":true,"net.gg":true,"org.gg":true,"gh":true,"com.gh":true,"edu.gh":true,"gov.gh":true,"org.gh":true,"mil.gh":true,"gi":true,"com.gi":true,"ltd.gi":true,"gov.gi":true,"mod.gi":true,"edu.gi":true,"org.gi":true,"gl":true,"co.gl":true,"com.gl":true,"edu.gl":true,"net.gl":true,"org.gl":true,"gm":true,"gn":true,"ac.gn":true,"com.gn":true,"edu.gn":true,"gov.gn":true,"org.gn":true,"net.gn":true,"gov":true,"gp":true,"com.gp":true,"net.gp":true,"mobi.gp":true,"edu.gp":true,"org.gp":true,"asso.gp":true,"gq":true,"gr":true,"com.gr":true,"edu.gr":true,"net.gr":true,"org.gr":true,"gov.gr":true,"gs":true,"gt":true,"com.gt":true,"edu.gt":true,"gob.gt":true,"ind.gt":true,"mil.gt":true,"net.gt":true,"org.gt":true,"*.gu":true,"gw":true,"gy":true,"co.gy":true,"com.gy":true,"net.gy":true,"hk":true,"com.hk":true,"edu.hk":true,"gov.hk":true,"idv.hk":true,"net.hk":true,"org.hk":true,"xn--55qx5d.hk":true,"xn--wcvs22d.hk":true,"xn--lcvr32d.hk":true,"xn--mxtq1m.hk":true,"xn--gmqw5a.hk":true,"xn--ciqpn.hk":true,"xn--gmq050i.hk":true,"xn--zf0avx.hk":true,"xn--io0a7i.hk":true,"xn--mk0axi.hk":true,"xn--od0alg.hk":true,"xn--od0aq3b.hk":true,"xn--tn0ag.hk":true,"xn--uc0atv.hk":true,"xn--uc0ay4a.hk":true,"hm":true,"hn":true,"com.hn":true,"edu.hn":true,"org.hn":true,"net.hn":true,"mil.hn":true,"gob.hn":true,"hr":true,"iz.hr":true,"from.hr":true,"name.hr":true,"com.hr":true,"ht":true,"com.ht":true,"shop.ht":true,"firm.ht":true,"info.ht":true,"adult.ht":true,"net.ht":true,"pro.ht":true,"org.ht":true,"med.ht":true,"art.ht":true,"coop.ht":true,"pol.ht":true,"asso.ht":true,"edu.ht":true,"rel.ht":true,"gouv.ht":true,"perso.ht":true,"hu":true,"co.hu":true,"info.hu":true,"org.hu":true,"priv.hu":true,"sport.hu":true,"tm.hu":true,"2000.hu":true,"agrar.hu":true,"bolt.hu":true,"casino.hu":true,"city.hu":true,"erotica.hu":true,"erotika.hu":true,"film.hu":true,"forum.hu":true,"games.hu":true,"hotel.hu":true,"ingatlan.hu":true,"jogasz.hu":true,"konyvelo.hu":true,"lakas.hu":true,"media.hu":true,"news.hu":true,"reklam.hu":true,"sex.hu":true,"shop.hu":true,"suli.hu":true,"szex.hu":true,"tozsde.hu":true,"utazas.hu":true,"video.hu":true,"id":true,"ac.id":true,"biz.id":true,"co.id":true,"desa.id":true,"go.id":true,"mil.id":true,"my.id":true,"net.id":true,"or.id":true,"sch.id":true,"web.id":true,"ie":true,"gov.ie":true,"il":true,"ac.il":true,"co.il":true,"gov.il":true,"idf.il":true,"k12.il":true,"muni.il":true,"net.il":true,"org.il":true,"im":true,"ac.im":true,"co.im":true,"com.im":true,"ltd.co.im":true,"net.im":true,"org.im":true,"plc.co.im":true,"tt.im":true,"tv.im":true,"in":true,"co.in":true,"firm.in":true,"net.in":true,"org.in":true,"gen.in":true,"ind.in":true,"nic.in":true,"ac.in":true,"edu.in":true,"res.in":true,"gov.in":true,"mil.in":true,"info":true,"int":true,"eu.int":true,"io":true,"com.io":true,"iq":true,"gov.iq":true,"edu.iq":true,"mil.iq":true,"com.iq":true,"org.iq":true,"net.iq":true,"ir":true,"ac.ir":true,"co.ir":true,"gov.ir":true,"id.ir":true,"net.ir":true,"org.ir":true,"sch.ir":true,"xn--mgba3a4f16a.ir":true,"xn--mgba3a4fra.ir":true,"is":true,"net.is":true,"com.is":true,"edu.is":true,"gov.is":true,"org.is":true,"int.is":true,"it":true,"gov.it":true,"edu.it":true,"abr.it":true,"abruzzo.it":true,"aosta-valley.it":true,"aostavalley.it":true,"bas.it":true,"basilicata.it":true,"cal.it":true,"calabria.it":true,"cam.it":true,"campania.it":true,"emilia-romagna.it":true,"emiliaromagna.it":true,"emr.it":true,"friuli-v-giulia.it":true,"friuli-ve-giulia.it":true,"friuli-vegiulia.it":true,"friuli-venezia-giulia.it":true,"friuli-veneziagiulia.it":true,"friuli-vgiulia.it":true,"friuliv-giulia.it":true,"friulive-giulia.it":true,"friulivegiulia.it":true,"friulivenezia-giulia.it":true,"friuliveneziagiulia.it":true,"friulivgiulia.it":true,"fvg.it":true,"laz.it":true,"lazio.it":true,"lig.it":true,"liguria.it":true,"lom.it":true,"lombardia.it":true,"lombardy.it":true,"lucania.it":true,"mar.it":true,"marche.it":true,"mol.it":true,"molise.it":true,"piedmont.it":true,"piemonte.it":true,"pmn.it":true,"pug.it":true,"puglia.it":true,"sar.it":true,"sardegna.it":true,"sardinia.it":true,"sic.it":true,"sicilia.it":true,"sicily.it":true,"taa.it":true,"tos.it":true,"toscana.it":true,"trentino-a-adige.it":true,"trentino-aadige.it":true,"trentino-alto-adige.it":true,"trentino-altoadige.it":true,"trentino-s-tirol.it":true,"trentino-stirol.it":true,"trentino-sud-tirol.it":true,"trentino-sudtirol.it":true,"trentino-sued-tirol.it":true,"trentino-suedtirol.it":true,"trentinoa-adige.it":true,"trentinoaadige.it":true,"trentinoalto-adige.it":true,"trentinoaltoadige.it":true,"trentinos-tirol.it":true,"trentinostirol.it":true,"trentinosud-tirol.it":true,"trentinosudtirol.it":true,"trentinosued-tirol.it":true,"trentinosuedtirol.it":true,"tuscany.it":true,"umb.it":true,"umbria.it":true,"val-d-aosta.it":true,"val-daosta.it":true,"vald-aosta.it":true,"valdaosta.it":true,"valle-aosta.it":true,"valle-d-aosta.it":true,"valle-daosta.it":true,"valleaosta.it":true,"valled-aosta.it":true,"valledaosta.it":true,"vallee-aoste.it":true,"valleeaoste.it":true,"vao.it":true,"vda.it":true,"ven.it":true,"veneto.it":true,"ag.it":true,"agrigento.it":true,"al.it":true,"alessandria.it":true,"alto-adige.it":true,"altoadige.it":true,"an.it":true,"ancona.it":true,"andria-barletta-trani.it":true,"andria-trani-barletta.it":true,"andriabarlettatrani.it":true,"andriatranibarletta.it":true,"ao.it":true,"aosta.it":true,"aoste.it":true,"ap.it":true,"aq.it":true,"aquila.it":true,"ar.it":true,"arezzo.it":true,"ascoli-piceno.it":true,"ascolipiceno.it":true,"asti.it":true,"at.it":true,"av.it":true,"avellino.it":true,"ba.it":true,"balsan.it":true,"bari.it":true,"barletta-trani-andria.it":true,"barlettatraniandria.it":true,"belluno.it":true,"benevento.it":true,"bergamo.it":true,"bg.it":true,"bi.it":true,"biella.it":true,"bl.it":true,"bn.it":true,"bo.it":true,"bologna.it":true,"bolzano.it":true,"bozen.it":true,"br.it":true,"brescia.it":true,"brindisi.it":true,"bs.it":true,"bt.it":true,"bz.it":true,"ca.it":true,"cagliari.it":true,"caltanissetta.it":true,"campidano-medio.it":true,"campidanomedio.it":true,"campobasso.it":true,"carbonia-iglesias.it":true,"carboniaiglesias.it":true,"carrara-massa.it":true,"carraramassa.it":true,"caserta.it":true,"catania.it":true,"catanzaro.it":true,"cb.it":true,"ce.it":true,"cesena-forli.it":true,"cesenaforli.it":true,"ch.it":true,"chieti.it":true,"ci.it":true,"cl.it":true,"cn.it":true,"co.it":true,"como.it":true,"cosenza.it":true,"cr.it":true,"cremona.it":true,"crotone.it":true,"cs.it":true,"ct.it":true,"cuneo.it":true,"cz.it":true,"dell-ogliastra.it":true,"dellogliastra.it":true,"en.it":true,"enna.it":true,"fc.it":true,"fe.it":true,"fermo.it":true,"ferrara.it":true,"fg.it":true,"fi.it":true,"firenze.it":true,"florence.it":true,"fm.it":true,"foggia.it":true,"forli-cesena.it":true,"forlicesena.it":true,"fr.it":true,"frosinone.it":true,"ge.it":true,"genoa.it":true,"genova.it":true,"go.it":true,"gorizia.it":true,"gr.it":true,"grosseto.it":true,"iglesias-carbonia.it":true,"iglesiascarbonia.it":true,"im.it":true,"imperia.it":true,"is.it":true,"isernia.it":true,"kr.it":true,"la-spezia.it":true,"laquila.it":true,"laspezia.it":true,"latina.it":true,"lc.it":true,"le.it":true,"lecce.it":true,"lecco.it":true,"li.it":true,"livorno.it":true,"lo.it":true,"lodi.it":true,"lt.it":true,"lu.it":true,"lucca.it":true,"macerata.it":true,"mantova.it":true,"massa-carrara.it":true,"massacarrara.it":true,"matera.it":true,"mb.it":true,"mc.it":true,"me.it":true,"medio-campidano.it":true,"mediocampidano.it":true,"messina.it":true,"mi.it":true,"milan.it":true,"milano.it":true,"mn.it":true,"mo.it":true,"modena.it":true,"monza-brianza.it":true,"monza-e-della-brianza.it":true,"monza.it":true,"monzabrianza.it":true,"monzaebrianza.it":true,"monzaedellabrianza.it":true,"ms.it":true,"mt.it":true,"na.it":true,"naples.it":true,"napoli.it":true,"no.it":true,"novara.it":true,"nu.it":true,"nuoro.it":true,"og.it":true,"ogliastra.it":true,"olbia-tempio.it":true,"olbiatempio.it":true,"or.it":true,"oristano.it":true,"ot.it":true,"pa.it":true,"padova.it":true,"padua.it":true,"palermo.it":true,"parma.it":true,"pavia.it":true,"pc.it":true,"pd.it":true,"pe.it":true,"perugia.it":true,"pesaro-urbino.it":true,"pesarourbino.it":true,"pescara.it":true,"pg.it":true,"pi.it":true,"piacenza.it":true,"pisa.it":true,"pistoia.it":true,"pn.it":true,"po.it":true,"pordenone.it":true,"potenza.it":true,"pr.it":true,"prato.it":true,"pt.it":true,"pu.it":true,"pv.it":true,"pz.it":true,"ra.it":true,"ragusa.it":true,"ravenna.it":true,"rc.it":true,"re.it":true,"reggio-calabria.it":true,"reggio-emilia.it":true,"reggiocalabria.it":true,"reggioemilia.it":true,"rg.it":true,"ri.it":true,"rieti.it":true,"rimini.it":true,"rm.it":true,"rn.it":true,"ro.it":true,"roma.it":true,"rome.it":true,"rovigo.it":true,"sa.it":true,"salerno.it":true,"sassari.it":true,"savona.it":true,"si.it":true,"siena.it":true,"siracusa.it":true,"so.it":true,"sondrio.it":true,"sp.it":true,"sr.it":true,"ss.it":true,"suedtirol.it":true,"sv.it":true,"ta.it":true,"taranto.it":true,"te.it":true,"tempio-olbia.it":true,"tempioolbia.it":true,"teramo.it":true,"terni.it":true,"tn.it":true,"to.it":true,"torino.it":true,"tp.it":true,"tr.it":true,"trani-andria-barletta.it":true,"trani-barletta-andria.it":true,"traniandriabarletta.it":true,"tranibarlettaandria.it":true,"trapani.it":true,"trentino.it":true,"trento.it":true,"treviso.it":true,"trieste.it":true,"ts.it":true,"turin.it":true,"tv.it":true,"ud.it":true,"udine.it":true,"urbino-pesaro.it":true,"urbinopesaro.it":true,"va.it":true,"varese.it":true,"vb.it":true,"vc.it":true,"ve.it":true,"venezia.it":true,"venice.it":true,"verbania.it":true,"vercelli.it":true,"verona.it":true,"vi.it":true,"vibo-valentia.it":true,"vibovalentia.it":true,"vicenza.it":true,"viterbo.it":true,"vr.it":true,"vs.it":true,"vt.it":true,"vv.it":true,"je":true,"co.je":true,"net.je":true,"org.je":true,"*.jm":true,"jo":true,"com.jo":true,"org.jo":true,"net.jo":true,"edu.jo":true,"sch.jo":true,"gov.jo":true,"mil.jo":true,"name.jo":true,"jobs":true,"jp":true,"ac.jp":true,"ad.jp":true,"co.jp":true,"ed.jp":true,"go.jp":true,"gr.jp":true,"lg.jp":true,"ne.jp":true,"or.jp":true,"aichi.jp":true,"akita.jp":true,"aomori.jp":true,"chiba.jp":true,"ehime.jp":true,"fukui.jp":true,"fukuoka.jp":true,"fukushima.jp":true,"gifu.jp":true,"gunma.jp":true,"hiroshima.jp":true,"hokkaido.jp":true,"hyogo.jp":true,"ibaraki.jp":true,"ishikawa.jp":true,"iwate.jp":true,"kagawa.jp":true,"kagoshima.jp":true,"kanagawa.jp":true,"kochi.jp":true,"kumamoto.jp":true,"kyoto.jp":true,"mie.jp":true,"miyagi.jp":true,"miyazaki.jp":true,"nagano.jp":true,"nagasaki.jp":true,"nara.jp":true,"niigata.jp":true,"oita.jp":true,"okayama.jp":true,"okinawa.jp":true,"osaka.jp":true,"saga.jp":true,"saitama.jp":true,"shiga.jp":true,"shimane.jp":true,"shizuoka.jp":true,"tochigi.jp":true,"tokushima.jp":true,"tokyo.jp":true,"tottori.jp":true,"toyama.jp":true,"wakayama.jp":true,"yamagata.jp":true,"yamaguchi.jp":true,"yamanashi.jp":true,"xn--4pvxs.jp":true,"xn--vgu402c.jp":true,"xn--c3s14m.jp":true,"xn--f6qx53a.jp":true,"xn--8pvr4u.jp":true,"xn--uist22h.jp":true,"xn--djrs72d6uy.jp":true,"xn--mkru45i.jp":true,"xn--0trq7p7nn.jp":true,"xn--8ltr62k.jp":true,"xn--2m4a15e.jp":true,"xn--efvn9s.jp":true,"xn--32vp30h.jp":true,"xn--4it797k.jp":true,"xn--1lqs71d.jp":true,"xn--5rtp49c.jp":true,"xn--5js045d.jp":true,"xn--ehqz56n.jp":true,"xn--1lqs03n.jp":true,"xn--qqqt11m.jp":true,"xn--kbrq7o.jp":true,"xn--pssu33l.jp":true,"xn--ntsq17g.jp":true,"xn--uisz3g.jp":true,"xn--6btw5a.jp":true,"xn--1ctwo.jp":true,"xn--6orx2r.jp":true,"xn--rht61e.jp":true,"xn--rht27z.jp":true,"xn--djty4k.jp":true,"xn--nit225k.jp":true,"xn--rht3d.jp":true,"xn--klty5x.jp":true,"xn--kltx9a.jp":true,"xn--kltp7d.jp":true,"xn--uuwu58a.jp":true,"xn--zbx025d.jp":true,"xn--ntso0iqx3a.jp":true,"xn--elqq16h.jp":true,"xn--4it168d.jp":true,"xn--klt787d.jp":true,"xn--rny31h.jp":true,"xn--7t0a264c.jp":true,"xn--5rtq34k.jp":true,"xn--k7yn95e.jp":true,"xn--tor131o.jp":true,"xn--d5qv7z876c.jp":true,"*.kawasaki.jp":true,"*.kitakyushu.jp":true,"*.kobe.jp":true,"*.nagoya.jp":true,"*.sapporo.jp":true,"*.sendai.jp":true,"*.yokohama.jp":true,"city.kawasaki.jp":false,"city.kitakyushu.jp":false,"city.kobe.jp":false,"city.nagoya.jp":false,"city.sapporo.jp":false,"city.sendai.jp":false,"city.yokohama.jp":false,"aisai.aichi.jp":true,"ama.aichi.jp":true,"anjo.aichi.jp":true,"asuke.aichi.jp":true,"chiryu.aichi.jp":true,"chita.aichi.jp":true,"fuso.aichi.jp":true,"gamagori.aichi.jp":true,"handa.aichi.jp":true,"hazu.aichi.jp":true,"hekinan.aichi.jp":true,"higashiura.aichi.jp":true,"ichinomiya.aichi.jp":true,"inazawa.aichi.jp":true,"inuyama.aichi.jp":true,"isshiki.aichi.jp":true,"iwakura.aichi.jp":true,"kanie.aichi.jp":true,"kariya.aichi.jp":true,"kasugai.aichi.jp":true,"kira.aichi.jp":true,"kiyosu.aichi.jp":true,"komaki.aichi.jp":true,"konan.aichi.jp":true,"kota.aichi.jp":true,"mihama.aichi.jp":true,"miyoshi.aichi.jp":true,"nishio.aichi.jp":true,"nisshin.aichi.jp":true,"obu.aichi.jp":true,"oguchi.aichi.jp":true,"oharu.aichi.jp":true,"okazaki.aichi.jp":true,"owariasahi.aichi.jp":true,"seto.aichi.jp":true,"shikatsu.aichi.jp":true,"shinshiro.aichi.jp":true,"shitara.aichi.jp":true,"tahara.aichi.jp":true,"takahama.aichi.jp":true,"tobishima.aichi.jp":true,"toei.aichi.jp":true,"togo.aichi.jp":true,"tokai.aichi.jp":true,"tokoname.aichi.jp":true,"toyoake.aichi.jp":true,"toyohashi.aichi.jp":true,"toyokawa.aichi.jp":true,"toyone.aichi.jp":true,"toyota.aichi.jp":true,"tsushima.aichi.jp":true,"yatomi.aichi.jp":true,"akita.akita.jp":true,"daisen.akita.jp":true,"fujisato.akita.jp":true,"gojome.akita.jp":true,"hachirogata.akita.jp":true,"happou.akita.jp":true,"higashinaruse.akita.jp":true,"honjo.akita.jp":true,"honjyo.akita.jp":true,"ikawa.akita.jp":true,"kamikoani.akita.jp":true,"kamioka.akita.jp":true,"katagami.akita.jp":true,"kazuno.akita.jp":true,"kitaakita.akita.jp":true,"kosaka.akita.jp":true,"kyowa.akita.jp":true,"misato.akita.jp":true,"mitane.akita.jp":true,"moriyoshi.akita.jp":true,"nikaho.akita.jp":true,"noshiro.akita.jp":true,"odate.akita.jp":true,"oga.akita.jp":true,"ogata.akita.jp":true,"semboku.akita.jp":true,"yokote.akita.jp":true,"yurihonjo.akita.jp":true,"aomori.aomori.jp":true,"gonohe.aomori.jp":true,"hachinohe.aomori.jp":true,"hashikami.aomori.jp":true,"hiranai.aomori.jp":true,"hirosaki.aomori.jp":true,"itayanagi.aomori.jp":true,"kuroishi.aomori.jp":true,"misawa.aomori.jp":true,"mutsu.aomori.jp":true,"nakadomari.aomori.jp":true,"noheji.aomori.jp":true,"oirase.aomori.jp":true,"owani.aomori.jp":true,"rokunohe.aomori.jp":true,"sannohe.aomori.jp":true,"shichinohe.aomori.jp":true,"shingo.aomori.jp":true,"takko.aomori.jp":true,"towada.aomori.jp":true,"tsugaru.aomori.jp":true,"tsuruta.aomori.jp":true,"abiko.chiba.jp":true,"asahi.chiba.jp":true,"chonan.chiba.jp":true,"chosei.chiba.jp":true,"choshi.chiba.jp":true,"chuo.chiba.jp":true,"funabashi.chiba.jp":true,"futtsu.chiba.jp":true,"hanamigawa.chiba.jp":true,"ichihara.chiba.jp":true,"ichikawa.chiba.jp":true,"ichinomiya.chiba.jp":true,"inzai.chiba.jp":true,"isumi.chiba.jp":true,"kamagaya.chiba.jp":true,"kamogawa.chiba.jp":true,"kashiwa.chiba.jp":true,"katori.chiba.jp":true,"katsuura.chiba.jp":true,"kimitsu.chiba.jp":true,"kisarazu.chiba.jp":true,"kozaki.chiba.jp":true,"kujukuri.chiba.jp":true,"kyonan.chiba.jp":true,"matsudo.chiba.jp":true,"midori.chiba.jp":true,"mihama.chiba.jp":true,"minamiboso.chiba.jp":true,"mobara.chiba.jp":true,"mutsuzawa.chiba.jp":true,"nagara.chiba.jp":true,"nagareyama.chiba.jp":true,"narashino.chiba.jp":true,"narita.chiba.jp":true,"noda.chiba.jp":true,"oamishirasato.chiba.jp":true,"omigawa.chiba.jp":true,"onjuku.chiba.jp":true,"otaki.chiba.jp":true,"sakae.chiba.jp":true,"sakura.chiba.jp":true,"shimofusa.chiba.jp":true,"shirako.chiba.jp":true,"shiroi.chiba.jp":true,"shisui.chiba.jp":true,"sodegaura.chiba.jp":true,"sosa.chiba.jp":true,"tako.chiba.jp":true,"tateyama.chiba.jp":true,"togane.chiba.jp":true,"tohnosho.chiba.jp":true,"tomisato.chiba.jp":true,"urayasu.chiba.jp":true,"yachimata.chiba.jp":true,"yachiyo.chiba.jp":true,"yokaichiba.chiba.jp":true,"yokoshibahikari.chiba.jp":true,"yotsukaido.chiba.jp":true,"ainan.ehime.jp":true,"honai.ehime.jp":true,"ikata.ehime.jp":true,"imabari.ehime.jp":true,"iyo.ehime.jp":true,"kamijima.ehime.jp":true,"kihoku.ehime.jp":true,"kumakogen.ehime.jp":true,"masaki.ehime.jp":true,"matsuno.ehime.jp":true,"matsuyama.ehime.jp":true,"namikata.ehime.jp":true,"niihama.ehime.jp":true,"ozu.ehime.jp":true,"saijo.ehime.jp":true,"seiyo.ehime.jp":true,"shikokuchuo.ehime.jp":true,"tobe.ehime.jp":true,"toon.ehime.jp":true,"uchiko.ehime.jp":true,"uwajima.ehime.jp":true,"yawatahama.ehime.jp":true,"echizen.fukui.jp":true,"eiheiji.fukui.jp":true,"fukui.fukui.jp":true,"ikeda.fukui.jp":true,"katsuyama.fukui.jp":true,"mihama.fukui.jp":true,"minamiechizen.fukui.jp":true,"obama.fukui.jp":true,"ohi.fukui.jp":true,"ono.fukui.jp":true,"sabae.fukui.jp":true,"sakai.fukui.jp":true,"takahama.fukui.jp":true,"tsuruga.fukui.jp":true,"wakasa.fukui.jp":true,"ashiya.fukuoka.jp":true,"buzen.fukuoka.jp":true,"chikugo.fukuoka.jp":true,"chikuho.fukuoka.jp":true,"chikujo.fukuoka.jp":true,"chikushino.fukuoka.jp":true,"chikuzen.fukuoka.jp":true,"chuo.fukuoka.jp":true,"dazaifu.fukuoka.jp":true,"fukuchi.fukuoka.jp":true,"hakata.fukuoka.jp":true,"higashi.fukuoka.jp":true,"hirokawa.fukuoka.jp":true,"hisayama.fukuoka.jp":true,"iizuka.fukuoka.jp":true,"inatsuki.fukuoka.jp":true,"kaho.fukuoka.jp":true,"kasuga.fukuoka.jp":true,"kasuya.fukuoka.jp":true,"kawara.fukuoka.jp":true,"keisen.fukuoka.jp":true,"koga.fukuoka.jp":true,"kurate.fukuoka.jp":true,"kurogi.fukuoka.jp":true,"kurume.fukuoka.jp":true,"minami.fukuoka.jp":true,"miyako.fukuoka.jp":true,"miyama.fukuoka.jp":true,"miyawaka.fukuoka.jp":true,"mizumaki.fukuoka.jp":true,"munakata.fukuoka.jp":true,"nakagawa.fukuoka.jp":true,"nakama.fukuoka.jp":true,"nishi.fukuoka.jp":true,"nogata.fukuoka.jp":true,"ogori.fukuoka.jp":true,"okagaki.fukuoka.jp":true,"okawa.fukuoka.jp":true,"oki.fukuoka.jp":true,"omuta.fukuoka.jp":true,"onga.fukuoka.jp":true,"onojo.fukuoka.jp":true,"oto.fukuoka.jp":true,"saigawa.fukuoka.jp":true,"sasaguri.fukuoka.jp":true,"shingu.fukuoka.jp":true,"shinyoshitomi.fukuoka.jp":true,"shonai.fukuoka.jp":true,"soeda.fukuoka.jp":true,"sue.fukuoka.jp":true,"tachiarai.fukuoka.jp":true,"tagawa.fukuoka.jp":true,"takata.fukuoka.jp":true,"toho.fukuoka.jp":true,"toyotsu.fukuoka.jp":true,"tsuiki.fukuoka.jp":true,"ukiha.fukuoka.jp":true,"umi.fukuoka.jp":true,"usui.fukuoka.jp":true,"yamada.fukuoka.jp":true,"yame.fukuoka.jp":true,"yanagawa.fukuoka.jp":true,"yukuhashi.fukuoka.jp":true,"aizubange.fukushima.jp":true,"aizumisato.fukushima.jp":true,"aizuwakamatsu.fukushima.jp":true,"asakawa.fukushima.jp":true,"bandai.fukushima.jp":true,"date.fukushima.jp":true,"fukushima.fukushima.jp":true,"furudono.fukushima.jp":true,"futaba.fukushima.jp":true,"hanawa.fukushima.jp":true,"higashi.fukushima.jp":true,"hirata.fukushima.jp":true,"hirono.fukushima.jp":true,"iitate.fukushima.jp":true,"inawashiro.fukushima.jp":true,"ishikawa.fukushima.jp":true,"iwaki.fukushima.jp":true,"izumizaki.fukushima.jp":true,"kagamiishi.fukushima.jp":true,"kaneyama.fukushima.jp":true,"kawamata.fukushima.jp":true,"kitakata.fukushima.jp":true,"kitashiobara.fukushima.jp":true,"koori.fukushima.jp":true,"koriyama.fukushima.jp":true,"kunimi.fukushima.jp":true,"miharu.fukushima.jp":true,"mishima.fukushima.jp":true,"namie.fukushima.jp":true,"nango.fukushima.jp":true,"nishiaizu.fukushima.jp":true,"nishigo.fukushima.jp":true,"okuma.fukushima.jp":true,"omotego.fukushima.jp":true,"ono.fukushima.jp":true,"otama.fukushima.jp":true,"samegawa.fukushima.jp":true,"shimogo.fukushima.jp":true,"shirakawa.fukushima.jp":true,"showa.fukushima.jp":true,"soma.fukushima.jp":true,"sukagawa.fukushima.jp":true,"taishin.fukushima.jp":true,"tamakawa.fukushima.jp":true,"tanagura.fukushima.jp":true,"tenei.fukushima.jp":true,"yabuki.fukushima.jp":true,"yamato.fukushima.jp":true,"yamatsuri.fukushima.jp":true,"yanaizu.fukushima.jp":true,"yugawa.fukushima.jp":true,"anpachi.gifu.jp":true,"ena.gifu.jp":true,"gifu.gifu.jp":true,"ginan.gifu.jp":true,"godo.gifu.jp":true,"gujo.gifu.jp":true,"hashima.gifu.jp":true,"hichiso.gifu.jp":true,"hida.gifu.jp":true,"higashishirakawa.gifu.jp":true,"ibigawa.gifu.jp":true,"ikeda.gifu.jp":true,"kakamigahara.gifu.jp":true,"kani.gifu.jp":true,"kasahara.gifu.jp":true,"kasamatsu.gifu.jp":true,"kawaue.gifu.jp":true,"kitagata.gifu.jp":true,"mino.gifu.jp":true,"minokamo.gifu.jp":true,"mitake.gifu.jp":true,"mizunami.gifu.jp":true,"motosu.gifu.jp":true,"nakatsugawa.gifu.jp":true,"ogaki.gifu.jp":true,"sakahogi.gifu.jp":true,"seki.gifu.jp":true,"sekigahara.gifu.jp":true,"shirakawa.gifu.jp":true,"tajimi.gifu.jp":true,"takayama.gifu.jp":true,"tarui.gifu.jp":true,"toki.gifu.jp":true,"tomika.gifu.jp":true,"wanouchi.gifu.jp":true,"yamagata.gifu.jp":true,"yaotsu.gifu.jp":true,"yoro.gifu.jp":true,"annaka.gunma.jp":true,"chiyoda.gunma.jp":true,"fujioka.gunma.jp":true,"higashiagatsuma.gunma.jp":true,"isesaki.gunma.jp":true,"itakura.gunma.jp":true,"kanna.gunma.jp":true,"kanra.gunma.jp":true,"katashina.gunma.jp":true,"kawaba.gunma.jp":true,"kiryu.gunma.jp":true,"kusatsu.gunma.jp":true,"maebashi.gunma.jp":true,"meiwa.gunma.jp":true,"midori.gunma.jp":true,"minakami.gunma.jp":true,"naganohara.gunma.jp":true,"nakanojo.gunma.jp":true,"nanmoku.gunma.jp":true,"numata.gunma.jp":true,"oizumi.gunma.jp":true,"ora.gunma.jp":true,"ota.gunma.jp":true,"shibukawa.gunma.jp":true,"shimonita.gunma.jp":true,"shinto.gunma.jp":true,"showa.gunma.jp":true,"takasaki.gunma.jp":true,"takayama.gunma.jp":true,"tamamura.gunma.jp":true,"tatebayashi.gunma.jp":true,"tomioka.gunma.jp":true,"tsukiyono.gunma.jp":true,"tsumagoi.gunma.jp":true,"ueno.gunma.jp":true,"yoshioka.gunma.jp":true,"asaminami.hiroshima.jp":true,"daiwa.hiroshima.jp":true,"etajima.hiroshima.jp":true,"fuchu.hiroshima.jp":true,"fukuyama.hiroshima.jp":true,"hatsukaichi.hiroshima.jp":true,"higashihiroshima.hiroshima.jp":true,"hongo.hiroshima.jp":true,"jinsekikogen.hiroshima.jp":true,"kaita.hiroshima.jp":true,"kui.hiroshima.jp":true,"kumano.hiroshima.jp":true,"kure.hiroshima.jp":true,"mihara.hiroshima.jp":true,"miyoshi.hiroshima.jp":true,"naka.hiroshima.jp":true,"onomichi.hiroshima.jp":true,"osakikamijima.hiroshima.jp":true,"otake.hiroshima.jp":true,"saka.hiroshima.jp":true,"sera.hiroshima.jp":true,"seranishi.hiroshima.jp":true,"shinichi.hiroshima.jp":true,"shobara.hiroshima.jp":true,"takehara.hiroshima.jp":true,"abashiri.hokkaido.jp":true,"abira.hokkaido.jp":true,"aibetsu.hokkaido.jp":true,"akabira.hokkaido.jp":true,"akkeshi.hokkaido.jp":true,"asahikawa.hokkaido.jp":true,"ashibetsu.hokkaido.jp":true,"ashoro.hokkaido.jp":true,"assabu.hokkaido.jp":true,"atsuma.hokkaido.jp":true,"bibai.hokkaido.jp":true,"biei.hokkaido.jp":true,"bifuka.hokkaido.jp":true,"bihoro.hokkaido.jp":true,"biratori.hokkaido.jp":true,"chippubetsu.hokkaido.jp":true,"chitose.hokkaido.jp":true,"date.hokkaido.jp":true,"ebetsu.hokkaido.jp":true,"embetsu.hokkaido.jp":true,"eniwa.hokkaido.jp":true,"erimo.hokkaido.jp":true,"esan.hokkaido.jp":true,"esashi.hokkaido.jp":true,"fukagawa.hokkaido.jp":true,"fukushima.hokkaido.jp":true,"furano.hokkaido.jp":true,"furubira.hokkaido.jp":true,"haboro.hokkaido.jp":true,"hakodate.hokkaido.jp":true,"hamatonbetsu.hokkaido.jp":true,"hidaka.hokkaido.jp":true,"higashikagura.hokkaido.jp":true,"higashikawa.hokkaido.jp":true,"hiroo.hokkaido.jp":true,"hokuryu.hokkaido.jp":true,"hokuto.hokkaido.jp":true,"honbetsu.hokkaido.jp":true,"horokanai.hokkaido.jp":true,"horonobe.hokkaido.jp":true,"ikeda.hokkaido.jp":true,"imakane.hokkaido.jp":true,"ishikari.hokkaido.jp":true,"iwamizawa.hokkaido.jp":true,"iwanai.hokkaido.jp":true,"kamifurano.hokkaido.jp":true,"kamikawa.hokkaido.jp":true,"kamishihoro.hokkaido.jp":true,"kamisunagawa.hokkaido.jp":true,"kamoenai.hokkaido.jp":true,"kayabe.hokkaido.jp":true,"kembuchi.hokkaido.jp":true,"kikonai.hokkaido.jp":true,"kimobetsu.hokkaido.jp":true,"kitahiroshima.hokkaido.jp":true,"kitami.hokkaido.jp":true,"kiyosato.hokkaido.jp":true,"koshimizu.hokkaido.jp":true,"kunneppu.hokkaido.jp":true,"kuriyama.hokkaido.jp":true,"kuromatsunai.hokkaido.jp":true,"kushiro.hokkaido.jp":true,"kutchan.hokkaido.jp":true,"kyowa.hokkaido.jp":true,"mashike.hokkaido.jp":true,"matsumae.hokkaido.jp":true,"mikasa.hokkaido.jp":true,"minamifurano.hokkaido.jp":true,"mombetsu.hokkaido.jp":true,"moseushi.hokkaido.jp":true,"mukawa.hokkaido.jp":true,"muroran.hokkaido.jp":true,"naie.hokkaido.jp":true,"nakagawa.hokkaido.jp":true,"nakasatsunai.hokkaido.jp":true,"nakatombetsu.hokkaido.jp":true,"nanae.hokkaido.jp":true,"nanporo.hokkaido.jp":true,"nayoro.hokkaido.jp":true,"nemuro.hokkaido.jp":true,"niikappu.hokkaido.jp":true,"niki.hokkaido.jp":true,"nishiokoppe.hokkaido.jp":true,"noboribetsu.hokkaido.jp":true,"numata.hokkaido.jp":true,"obihiro.hokkaido.jp":true,"obira.hokkaido.jp":true,"oketo.hokkaido.jp":true,"okoppe.hokkaido.jp":true,"otaru.hokkaido.jp":true,"otobe.hokkaido.jp":true,"otofuke.hokkaido.jp":true,"otoineppu.hokkaido.jp":true,"oumu.hokkaido.jp":true,"ozora.hokkaido.jp":true,"pippu.hokkaido.jp":true,"rankoshi.hokkaido.jp":true,"rebun.hokkaido.jp":true,"rikubetsu.hokkaido.jp":true,"rishiri.hokkaido.jp":true,"rishirifuji.hokkaido.jp":true,"saroma.hokkaido.jp":true,"sarufutsu.hokkaido.jp":true,"shakotan.hokkaido.jp":true,"shari.hokkaido.jp":true,"shibecha.hokkaido.jp":true,"shibetsu.hokkaido.jp":true,"shikabe.hokkaido.jp":true,"shikaoi.hokkaido.jp":true,"shimamaki.hokkaido.jp":true,"shimizu.hokkaido.jp":true,"shimokawa.hokkaido.jp":true,"shinshinotsu.hokkaido.jp":true,"shintoku.hokkaido.jp":true,"shiranuka.hokkaido.jp":true,"shiraoi.hokkaido.jp":true,"shiriuchi.hokkaido.jp":true,"sobetsu.hokkaido.jp":true,"sunagawa.hokkaido.jp":true,"taiki.hokkaido.jp":true,"takasu.hokkaido.jp":true,"takikawa.hokkaido.jp":true,"takinoue.hokkaido.jp":true,"teshikaga.hokkaido.jp":true,"tobetsu.hokkaido.jp":true,"tohma.hokkaido.jp":true,"tomakomai.hokkaido.jp":true,"tomari.hokkaido.jp":true,"toya.hokkaido.jp":true,"toyako.hokkaido.jp":true,"toyotomi.hokkaido.jp":true,"toyoura.hokkaido.jp":true,"tsubetsu.hokkaido.jp":true,"tsukigata.hokkaido.jp":true,"urakawa.hokkaido.jp":true,"urausu.hokkaido.jp":true,"uryu.hokkaido.jp":true,"utashinai.hokkaido.jp":true,"wakkanai.hokkaido.jp":true,"wassamu.hokkaido.jp":true,"yakumo.hokkaido.jp":true,"yoichi.hokkaido.jp":true,"aioi.hyogo.jp":true,"akashi.hyogo.jp":true,"ako.hyogo.jp":true,"amagasaki.hyogo.jp":true,"aogaki.hyogo.jp":true,"asago.hyogo.jp":true,"ashiya.hyogo.jp":true,"awaji.hyogo.jp":true,"fukusaki.hyogo.jp":true,"goshiki.hyogo.jp":true,"harima.hyogo.jp":true,"himeji.hyogo.jp":true,"ichikawa.hyogo.jp":true,"inagawa.hyogo.jp":true,"itami.hyogo.jp":true,"kakogawa.hyogo.jp":true,"kamigori.hyogo.jp":true,"kamikawa.hyogo.jp":true,"kasai.hyogo.jp":true,"kasuga.hyogo.jp":true,"kawanishi.hyogo.jp":true,"miki.hyogo.jp":true,"minamiawaji.hyogo.jp":true,"nishinomiya.hyogo.jp":true,"nishiwaki.hyogo.jp":true,"ono.hyogo.jp":true,"sanda.hyogo.jp":true,"sannan.hyogo.jp":true,"sasayama.hyogo.jp":true,"sayo.hyogo.jp":true,"shingu.hyogo.jp":true,"shinonsen.hyogo.jp":true,"shiso.hyogo.jp":true,"sumoto.hyogo.jp":true,"taishi.hyogo.jp":true,"taka.hyogo.jp":true,"takarazuka.hyogo.jp":true,"takasago.hyogo.jp":true,"takino.hyogo.jp":true,"tamba.hyogo.jp":true,"tatsuno.hyogo.jp":true,"toyooka.hyogo.jp":true,"yabu.hyogo.jp":true,"yashiro.hyogo.jp":true,"yoka.hyogo.jp":true,"yokawa.hyogo.jp":true,"ami.ibaraki.jp":true,"asahi.ibaraki.jp":true,"bando.ibaraki.jp":true,"chikusei.ibaraki.jp":true,"daigo.ibaraki.jp":true,"fujishiro.ibaraki.jp":true,"hitachi.ibaraki.jp":true,"hitachinaka.ibaraki.jp":true,"hitachiomiya.ibaraki.jp":true,"hitachiota.ibaraki.jp":true,"ibaraki.ibaraki.jp":true,"ina.ibaraki.jp":true,"inashiki.ibaraki.jp":true,"itako.ibaraki.jp":true,"iwama.ibaraki.jp":true,"joso.ibaraki.jp":true,"kamisu.ibaraki.jp":true,"kasama.ibaraki.jp":true,"kashima.ibaraki.jp":true,"kasumigaura.ibaraki.jp":true,"koga.ibaraki.jp":true,"miho.ibaraki.jp":true,"mito.ibaraki.jp":true,"moriya.ibaraki.jp":true,"naka.ibaraki.jp":true,"namegata.ibaraki.jp":true,"oarai.ibaraki.jp":true,"ogawa.ibaraki.jp":true,"omitama.ibaraki.jp":true,"ryugasaki.ibaraki.jp":true,"sakai.ibaraki.jp":true,"sakuragawa.ibaraki.jp":true,"shimodate.ibaraki.jp":true,"shimotsuma.ibaraki.jp":true,"shirosato.ibaraki.jp":true,"sowa.ibaraki.jp":true,"suifu.ibaraki.jp":true,"takahagi.ibaraki.jp":true,"tamatsukuri.ibaraki.jp":true,"tokai.ibaraki.jp":true,"tomobe.ibaraki.jp":true,"tone.ibaraki.jp":true,"toride.ibaraki.jp":true,"tsuchiura.ibaraki.jp":true,"tsukuba.ibaraki.jp":true,"uchihara.ibaraki.jp":true,"ushiku.ibaraki.jp":true,"yachiyo.ibaraki.jp":true,"yamagata.ibaraki.jp":true,"yawara.ibaraki.jp":true,"yuki.ibaraki.jp":true,"anamizu.ishikawa.jp":true,"hakui.ishikawa.jp":true,"hakusan.ishikawa.jp":true,"kaga.ishikawa.jp":true,"kahoku.ishikawa.jp":true,"kanazawa.ishikawa.jp":true,"kawakita.ishikawa.jp":true,"komatsu.ishikawa.jp":true,"nakanoto.ishikawa.jp":true,"nanao.ishikawa.jp":true,"nomi.ishikawa.jp":true,"nonoichi.ishikawa.jp":true,"noto.ishikawa.jp":true,"shika.ishikawa.jp":true,"suzu.ishikawa.jp":true,"tsubata.ishikawa.jp":true,"tsurugi.ishikawa.jp":true,"uchinada.ishikawa.jp":true,"wajima.ishikawa.jp":true,"fudai.iwate.jp":true,"fujisawa.iwate.jp":true,"hanamaki.iwate.jp":true,"hiraizumi.iwate.jp":true,"hirono.iwate.jp":true,"ichinohe.iwate.jp":true,"ichinoseki.iwate.jp":true,"iwaizumi.iwate.jp":true,"iwate.iwate.jp":true,"joboji.iwate.jp":true,"kamaishi.iwate.jp":true,"kanegasaki.iwate.jp":true,"karumai.iwate.jp":true,"kawai.iwate.jp":true,"kitakami.iwate.jp":true,"kuji.iwate.jp":true,"kunohe.iwate.jp":true,"kuzumaki.iwate.jp":true,"miyako.iwate.jp":true,"mizusawa.iwate.jp":true,"morioka.iwate.jp":true,"ninohe.iwate.jp":true,"noda.iwate.jp":true,"ofunato.iwate.jp":true,"oshu.iwate.jp":true,"otsuchi.iwate.jp":true,"rikuzentakata.iwate.jp":true,"shiwa.iwate.jp":true,"shizukuishi.iwate.jp":true,"sumita.iwate.jp":true,"tanohata.iwate.jp":true,"tono.iwate.jp":true,"yahaba.iwate.jp":true,"yamada.iwate.jp":true,"ayagawa.kagawa.jp":true,"higashikagawa.kagawa.jp":true,"kanonji.kagawa.jp":true,"kotohira.kagawa.jp":true,"manno.kagawa.jp":true,"marugame.kagawa.jp":true,"mitoyo.kagawa.jp":true,"naoshima.kagawa.jp":true,"sanuki.kagawa.jp":true,"tadotsu.kagawa.jp":true,"takamatsu.kagawa.jp":true,"tonosho.kagawa.jp":true,"uchinomi.kagawa.jp":true,"utazu.kagawa.jp":true,"zentsuji.kagawa.jp":true,"akune.kagoshima.jp":true,"amami.kagoshima.jp":true,"hioki.kagoshima.jp":true,"isa.kagoshima.jp":true,"isen.kagoshima.jp":true,"izumi.kagoshima.jp":true,"kagoshima.kagoshima.jp":true,"kanoya.kagoshima.jp":true,"kawanabe.kagoshima.jp":true,"kinko.kagoshima.jp":true,"kouyama.kagoshima.jp":true,"makurazaki.kagoshima.jp":true,"matsumoto.kagoshima.jp":true,"minamitane.kagoshima.jp":true,"nakatane.kagoshima.jp":true,"nishinoomote.kagoshima.jp":true,"satsumasendai.kagoshima.jp":true,"soo.kagoshima.jp":true,"tarumizu.kagoshima.jp":true,"yusui.kagoshima.jp":true,"aikawa.kanagawa.jp":true,"atsugi.kanagawa.jp":true,"ayase.kanagawa.jp":true,"chigasaki.kanagawa.jp":true,"ebina.kanagawa.jp":true,"fujisawa.kanagawa.jp":true,"hadano.kanagawa.jp":true,"hakone.kanagawa.jp":true,"hiratsuka.kanagawa.jp":true,"isehara.kanagawa.jp":true,"kaisei.kanagawa.jp":true,"kamakura.kanagawa.jp":true,"kiyokawa.kanagawa.jp":true,"matsuda.kanagawa.jp":true,"minamiashigara.kanagawa.jp":true,"miura.kanagawa.jp":true,"nakai.kanagawa.jp":true,"ninomiya.kanagawa.jp":true,"odawara.kanagawa.jp":true,"oi.kanagawa.jp":true,"oiso.kanagawa.jp":true,"sagamihara.kanagawa.jp":true,"samukawa.kanagawa.jp":true,"tsukui.kanagawa.jp":true,"yamakita.kanagawa.jp":true,"yamato.kanagawa.jp":true,"yokosuka.kanagawa.jp":true,"yugawara.kanagawa.jp":true,"zama.kanagawa.jp":true,"zushi.kanagawa.jp":true,"aki.kochi.jp":true,"geisei.kochi.jp":true,"hidaka.kochi.jp":true,"higashitsuno.kochi.jp":true,"ino.kochi.jp":true,"kagami.kochi.jp":true,"kami.kochi.jp":true,"kitagawa.kochi.jp":true,"kochi.kochi.jp":true,"mihara.kochi.jp":true,"motoyama.kochi.jp":true,"muroto.kochi.jp":true,"nahari.kochi.jp":true,"nakamura.kochi.jp":true,"nankoku.kochi.jp":true,"nishitosa.kochi.jp":true,"niyodogawa.kochi.jp":true,"ochi.kochi.jp":true,"okawa.kochi.jp":true,"otoyo.kochi.jp":true,"otsuki.kochi.jp":true,"sakawa.kochi.jp":true,"sukumo.kochi.jp":true,"susaki.kochi.jp":true,"tosa.kochi.jp":true,"tosashimizu.kochi.jp":true,"toyo.kochi.jp":true,"tsuno.kochi.jp":true,"umaji.kochi.jp":true,"yasuda.kochi.jp":true,"yusuhara.kochi.jp":true,"amakusa.kumamoto.jp":true,"arao.kumamoto.jp":true,"aso.kumamoto.jp":true,"choyo.kumamoto.jp":true,"gyokuto.kumamoto.jp":true,"hitoyoshi.kumamoto.jp":true,"kamiamakusa.kumamoto.jp":true,"kashima.kumamoto.jp":true,"kikuchi.kumamoto.jp":true,"kosa.kumamoto.jp":true,"kumamoto.kumamoto.jp":true,"mashiki.kumamoto.jp":true,"mifune.kumamoto.jp":true,"minamata.kumamoto.jp":true,"minamioguni.kumamoto.jp":true,"nagasu.kumamoto.jp":true,"nishihara.kumamoto.jp":true,"oguni.kumamoto.jp":true,"ozu.kumamoto.jp":true,"sumoto.kumamoto.jp":true,"takamori.kumamoto.jp":true,"uki.kumamoto.jp":true,"uto.kumamoto.jp":true,"yamaga.kumamoto.jp":true,"yamato.kumamoto.jp":true,"yatsushiro.kumamoto.jp":true,"ayabe.kyoto.jp":true,"fukuchiyama.kyoto.jp":true,"higashiyama.kyoto.jp":true,"ide.kyoto.jp":true,"ine.kyoto.jp":true,"joyo.kyoto.jp":true,"kameoka.kyoto.jp":true,"kamo.kyoto.jp":true,"kita.kyoto.jp":true,"kizu.kyoto.jp":true,"kumiyama.kyoto.jp":true,"kyotamba.kyoto.jp":true,"kyotanabe.kyoto.jp":true,"kyotango.kyoto.jp":true,"maizuru.kyoto.jp":true,"minami.kyoto.jp":true,"minamiyamashiro.kyoto.jp":true,"miyazu.kyoto.jp":true,"muko.kyoto.jp":true,"nagaokakyo.kyoto.jp":true,"nakagyo.kyoto.jp":true,"nantan.kyoto.jp":true,"oyamazaki.kyoto.jp":true,"sakyo.kyoto.jp":true,"seika.kyoto.jp":true,"tanabe.kyoto.jp":true,"uji.kyoto.jp":true,"ujitawara.kyoto.jp":true,"wazuka.kyoto.jp":true,"yamashina.kyoto.jp":true,"yawata.kyoto.jp":true,"asahi.mie.jp":true,"inabe.mie.jp":true,"ise.mie.jp":true,"kameyama.mie.jp":true,"kawagoe.mie.jp":true,"kiho.mie.jp":true,"kisosaki.mie.jp":true,"kiwa.mie.jp":true,"komono.mie.jp":true,"kumano.mie.jp":true,"kuwana.mie.jp":true,"matsusaka.mie.jp":true,"meiwa.mie.jp":true,"mihama.mie.jp":true,"minamiise.mie.jp":true,"misugi.mie.jp":true,"miyama.mie.jp":true,"nabari.mie.jp":true,"shima.mie.jp":true,"suzuka.mie.jp":true,"tado.mie.jp":true,"taiki.mie.jp":true,"taki.mie.jp":true,"tamaki.mie.jp":true,"toba.mie.jp":true,"tsu.mie.jp":true,"udono.mie.jp":true,"ureshino.mie.jp":true,"watarai.mie.jp":true,"yokkaichi.mie.jp":true,"furukawa.miyagi.jp":true,"higashimatsushima.miyagi.jp":true,"ishinomaki.miyagi.jp":true,"iwanuma.miyagi.jp":true,"kakuda.miyagi.jp":true,"kami.miyagi.jp":true,"kawasaki.miyagi.jp":true,"kesennuma.miyagi.jp":true,"marumori.miyagi.jp":true,"matsushima.miyagi.jp":true,"minamisanriku.miyagi.jp":true,"misato.miyagi.jp":true,"murata.miyagi.jp":true,"natori.miyagi.jp":true,"ogawara.miyagi.jp":true,"ohira.miyagi.jp":true,"onagawa.miyagi.jp":true,"osaki.miyagi.jp":true,"rifu.miyagi.jp":true,"semine.miyagi.jp":true,"shibata.miyagi.jp":true,"shichikashuku.miyagi.jp":true,"shikama.miyagi.jp":true,"shiogama.miyagi.jp":true,"shiroishi.miyagi.jp":true,"tagajo.miyagi.jp":true,"taiwa.miyagi.jp":true,"tome.miyagi.jp":true,"tomiya.miyagi.jp":true,"wakuya.miyagi.jp":true,"watari.miyagi.jp":true,"yamamoto.miyagi.jp":true,"zao.miyagi.jp":true,"aya.miyazaki.jp":true,"ebino.miyazaki.jp":true,"gokase.miyazaki.jp":true,"hyuga.miyazaki.jp":true,"kadogawa.miyazaki.jp":true,"kawaminami.miyazaki.jp":true,"kijo.miyazaki.jp":true,"kitagawa.miyazaki.jp":true,"kitakata.miyazaki.jp":true,"kitaura.miyazaki.jp":true,"kobayashi.miyazaki.jp":true,"kunitomi.miyazaki.jp":true,"kushima.miyazaki.jp":true,"mimata.miyazaki.jp":true,"miyakonojo.miyazaki.jp":true,"miyazaki.miyazaki.jp":true,"morotsuka.miyazaki.jp":true,"nichinan.miyazaki.jp":true,"nishimera.miyazaki.jp":true,"nobeoka.miyazaki.jp":true,"saito.miyazaki.jp":true,"shiiba.miyazaki.jp":true,"shintomi.miyazaki.jp":true,"takaharu.miyazaki.jp":true,"takanabe.miyazaki.jp":true,"takazaki.miyazaki.jp":true,"tsuno.miyazaki.jp":true,"achi.nagano.jp":true,"agematsu.nagano.jp":true,"anan.nagano.jp":true,"aoki.nagano.jp":true,"asahi.nagano.jp":true,"azumino.nagano.jp":true,"chikuhoku.nagano.jp":true,"chikuma.nagano.jp":true,"chino.nagano.jp":true,"fujimi.nagano.jp":true,"hakuba.nagano.jp":true,"hara.nagano.jp":true,"hiraya.nagano.jp":true,"iida.nagano.jp":true,"iijima.nagano.jp":true,"iiyama.nagano.jp":true,"iizuna.nagano.jp":true,"ikeda.nagano.jp":true,"ikusaka.nagano.jp":true,"ina.nagano.jp":true,"karuizawa.nagano.jp":true,"kawakami.nagano.jp":true,"kiso.nagano.jp":true,"kisofukushima.nagano.jp":true,"kitaaiki.nagano.jp":true,"komagane.nagano.jp":true,"komoro.nagano.jp":true,"matsukawa.nagano.jp":true,"matsumoto.nagano.jp":true,"miasa.nagano.jp":true,"minamiaiki.nagano.jp":true,"minamimaki.nagano.jp":true,"minamiminowa.nagano.jp":true,"minowa.nagano.jp":true,"miyada.nagano.jp":true,"miyota.nagano.jp":true,"mochizuki.nagano.jp":true,"nagano.nagano.jp":true,"nagawa.nagano.jp":true,"nagiso.nagano.jp":true,"nakagawa.nagano.jp":true,"nakano.nagano.jp":true,"nozawaonsen.nagano.jp":true,"obuse.nagano.jp":true,"ogawa.nagano.jp":true,"okaya.nagano.jp":true,"omachi.nagano.jp":true,"omi.nagano.jp":true,"ookuwa.nagano.jp":true,"ooshika.nagano.jp":true,"otaki.nagano.jp":true,"otari.nagano.jp":true,"sakae.nagano.jp":true,"sakaki.nagano.jp":true,"saku.nagano.jp":true,"sakuho.nagano.jp":true,"shimosuwa.nagano.jp":true,"shinanomachi.nagano.jp":true,"shiojiri.nagano.jp":true,"suwa.nagano.jp":true,"suzaka.nagano.jp":true,"takagi.nagano.jp":true,"takamori.nagano.jp":true,"takayama.nagano.jp":true,"tateshina.nagano.jp":true,"tatsuno.nagano.jp":true,"togakushi.nagano.jp":true,"togura.nagano.jp":true,"tomi.nagano.jp":true,"ueda.nagano.jp":true,"wada.nagano.jp":true,"yamagata.nagano.jp":true,"yamanouchi.nagano.jp":true,"yasaka.nagano.jp":true,"yasuoka.nagano.jp":true,"chijiwa.nagasaki.jp":true,"futsu.nagasaki.jp":true,"goto.nagasaki.jp":true,"hasami.nagasaki.jp":true,"hirado.nagasaki.jp":true,"iki.nagasaki.jp":true,"isahaya.nagasaki.jp":true,"kawatana.nagasaki.jp":true,"kuchinotsu.nagasaki.jp":true,"matsuura.nagasaki.jp":true,"nagasaki.nagasaki.jp":true,"obama.nagasaki.jp":true,"omura.nagasaki.jp":true,"oseto.nagasaki.jp":true,"saikai.nagasaki.jp":true,"sasebo.nagasaki.jp":true,"seihi.nagasaki.jp":true,"shimabara.nagasaki.jp":true,"shinkamigoto.nagasaki.jp":true,"togitsu.nagasaki.jp":true,"tsushima.nagasaki.jp":true,"unzen.nagasaki.jp":true,"ando.nara.jp":true,"gose.nara.jp":true,"heguri.nara.jp":true,"higashiyoshino.nara.jp":true,"ikaruga.nara.jp":true,"ikoma.nara.jp":true,"kamikitayama.nara.jp":true,"kanmaki.nara.jp":true,"kashiba.nara.jp":true,"kashihara.nara.jp":true,"katsuragi.nara.jp":true,"kawai.nara.jp":true,"kawakami.nara.jp":true,"kawanishi.nara.jp":true,"koryo.nara.jp":true,"kurotaki.nara.jp":true,"mitsue.nara.jp":true,"miyake.nara.jp":true,"nara.nara.jp":true,"nosegawa.nara.jp":true,"oji.nara.jp":true,"ouda.nara.jp":true,"oyodo.nara.jp":true,"sakurai.nara.jp":true,"sango.nara.jp":true,"shimoichi.nara.jp":true,"shimokitayama.nara.jp":true,"shinjo.nara.jp":true,"soni.nara.jp":true,"takatori.nara.jp":true,"tawaramoto.nara.jp":true,"tenkawa.nara.jp":true,"tenri.nara.jp":true,"uda.nara.jp":true,"yamatokoriyama.nara.jp":true,"yamatotakada.nara.jp":true,"yamazoe.nara.jp":true,"yoshino.nara.jp":true,"aga.niigata.jp":true,"agano.niigata.jp":true,"gosen.niigata.jp":true,"itoigawa.niigata.jp":true,"izumozaki.niigata.jp":true,"joetsu.niigata.jp":true,"kamo.niigata.jp":true,"kariwa.niigata.jp":true,"kashiwazaki.niigata.jp":true,"minamiuonuma.niigata.jp":true,"mitsuke.niigata.jp":true,"muika.niigata.jp":true,"murakami.niigata.jp":true,"myoko.niigata.jp":true,"nagaoka.niigata.jp":true,"niigata.niigata.jp":true,"ojiya.niigata.jp":true,"omi.niigata.jp":true,"sado.niigata.jp":true,"sanjo.niigata.jp":true,"seiro.niigata.jp":true,"seirou.niigata.jp":true,"sekikawa.niigata.jp":true,"shibata.niigata.jp":true,"tagami.niigata.jp":true,"tainai.niigata.jp":true,"tochio.niigata.jp":true,"tokamachi.niigata.jp":true,"tsubame.niigata.jp":true,"tsunan.niigata.jp":true,"uonuma.niigata.jp":true,"yahiko.niigata.jp":true,"yoita.niigata.jp":true,"yuzawa.niigata.jp":true,"beppu.oita.jp":true,"bungoono.oita.jp":true,"bungotakada.oita.jp":true,"hasama.oita.jp":true,"hiji.oita.jp":true,"himeshima.oita.jp":true,"hita.oita.jp":true,"kamitsue.oita.jp":true,"kokonoe.oita.jp":true,"kuju.oita.jp":true,"kunisaki.oita.jp":true,"kusu.oita.jp":true,"oita.oita.jp":true,"saiki.oita.jp":true,"taketa.oita.jp":true,"tsukumi.oita.jp":true,"usa.oita.jp":true,"usuki.oita.jp":true,"yufu.oita.jp":true,"akaiwa.okayama.jp":true,"asakuchi.okayama.jp":true,"bizen.okayama.jp":true,"hayashima.okayama.jp":true,"ibara.okayama.jp":true,"kagamino.okayama.jp":true,"kasaoka.okayama.jp":true,"kibichuo.okayama.jp":true,"kumenan.okayama.jp":true,"kurashiki.okayama.jp":true,"maniwa.okayama.jp":true,"misaki.okayama.jp":true,"nagi.okayama.jp":true,"niimi.okayama.jp":true,"nishiawakura.okayama.jp":true,"okayama.okayama.jp":true,"satosho.okayama.jp":true,"setouchi.okayama.jp":true,"shinjo.okayama.jp":true,"shoo.okayama.jp":true,"soja.okayama.jp":true,"takahashi.okayama.jp":true,"tamano.okayama.jp":true,"tsuyama.okayama.jp":true,"wake.okayama.jp":true,"yakage.okayama.jp":true,"aguni.okinawa.jp":true,"ginowan.okinawa.jp":true,"ginoza.okinawa.jp":true,"gushikami.okinawa.jp":true,"haebaru.okinawa.jp":true,"higashi.okinawa.jp":true,"hirara.okinawa.jp":true,"iheya.okinawa.jp":true,"ishigaki.okinawa.jp":true,"ishikawa.okinawa.jp":true,"itoman.okinawa.jp":true,"izena.okinawa.jp":true,"kadena.okinawa.jp":true,"kin.okinawa.jp":true,"kitadaito.okinawa.jp":true,"kitanakagusuku.okinawa.jp":true,"kumejima.okinawa.jp":true,"kunigami.okinawa.jp":true,"minamidaito.okinawa.jp":true,"motobu.okinawa.jp":true,"nago.okinawa.jp":true,"naha.okinawa.jp":true,"nakagusuku.okinawa.jp":true,"nakijin.okinawa.jp":true,"nanjo.okinawa.jp":true,"nishihara.okinawa.jp":true,"ogimi.okinawa.jp":true,"okinawa.okinawa.jp":true,"onna.okinawa.jp":true,"shimoji.okinawa.jp":true,"taketomi.okinawa.jp":true,"tarama.okinawa.jp":true,"tokashiki.okinawa.jp":true,"tomigusuku.okinawa.jp":true,"tonaki.okinawa.jp":true,"urasoe.okinawa.jp":true,"uruma.okinawa.jp":true,"yaese.okinawa.jp":true,"yomitan.okinawa.jp":true,"yonabaru.okinawa.jp":true,"yonaguni.okinawa.jp":true,"zamami.okinawa.jp":true,"abeno.osaka.jp":true,"chihayaakasaka.osaka.jp":true,"chuo.osaka.jp":true,"daito.osaka.jp":true,"fujiidera.osaka.jp":true,"habikino.osaka.jp":true,"hannan.osaka.jp":true,"higashiosaka.osaka.jp":true,"higashisumiyoshi.osaka.jp":true,"higashiyodogawa.osaka.jp":true,"hirakata.osaka.jp":true,"ibaraki.osaka.jp":true,"ikeda.osaka.jp":true,"izumi.osaka.jp":true,"izumiotsu.osaka.jp":true,"izumisano.osaka.jp":true,"kadoma.osaka.jp":true,"kaizuka.osaka.jp":true,"kanan.osaka.jp":true,"kashiwara.osaka.jp":true,"katano.osaka.jp":true,"kawachinagano.osaka.jp":true,"kishiwada.osaka.jp":true,"kita.osaka.jp":true,"kumatori.osaka.jp":true,"matsubara.osaka.jp":true,"minato.osaka.jp":true,"minoh.osaka.jp":true,"misaki.osaka.jp":true,"moriguchi.osaka.jp":true,"neyagawa.osaka.jp":true,"nishi.osaka.jp":true,"nose.osaka.jp":true,"osakasayama.osaka.jp":true,"sakai.osaka.jp":true,"sayama.osaka.jp":true,"sennan.osaka.jp":true,"settsu.osaka.jp":true,"shijonawate.osaka.jp":true,"shimamoto.osaka.jp":true,"suita.osaka.jp":true,"tadaoka.osaka.jp":true,"taishi.osaka.jp":true,"tajiri.osaka.jp":true,"takaishi.osaka.jp":true,"takatsuki.osaka.jp":true,"tondabayashi.osaka.jp":true,"toyonaka.osaka.jp":true,"toyono.osaka.jp":true,"yao.osaka.jp":true,"ariake.saga.jp":true,"arita.saga.jp":true,"fukudomi.saga.jp":true,"genkai.saga.jp":true,"hamatama.saga.jp":true,"hizen.saga.jp":true,"imari.saga.jp":true,"kamimine.saga.jp":true,"kanzaki.saga.jp":true,"karatsu.saga.jp":true,"kashima.saga.jp":true,"kitagata.saga.jp":true,"kitahata.saga.jp":true,"kiyama.saga.jp":true,"kouhoku.saga.jp":true,"kyuragi.saga.jp":true,"nishiarita.saga.jp":true,"ogi.saga.jp":true,"omachi.saga.jp":true,"ouchi.saga.jp":true,"saga.saga.jp":true,"shiroishi.saga.jp":true,"taku.saga.jp":true,"tara.saga.jp":true,"tosu.saga.jp":true,"yoshinogari.saga.jp":true,"arakawa.saitama.jp":true,"asaka.saitama.jp":true,"chichibu.saitama.jp":true,"fujimi.saitama.jp":true,"fujimino.saitama.jp":true,"fukaya.saitama.jp":true,"hanno.saitama.jp":true,"hanyu.saitama.jp":true,"hasuda.saitama.jp":true,"hatogaya.saitama.jp":true,"hatoyama.saitama.jp":true,"hidaka.saitama.jp":true,"higashichichibu.saitama.jp":true,"higashimatsuyama.saitama.jp":true,"honjo.saitama.jp":true,"ina.saitama.jp":true,"iruma.saitama.jp":true,"iwatsuki.saitama.jp":true,"kamiizumi.saitama.jp":true,"kamikawa.saitama.jp":true,"kamisato.saitama.jp":true,"kasukabe.saitama.jp":true,"kawagoe.saitama.jp":true,"kawaguchi.saitama.jp":true,"kawajima.saitama.jp":true,"kazo.saitama.jp":true,"kitamoto.saitama.jp":true,"koshigaya.saitama.jp":true,"kounosu.saitama.jp":true,"kuki.saitama.jp":true,"kumagaya.saitama.jp":true,"matsubushi.saitama.jp":true,"minano.saitama.jp":true,"misato.saitama.jp":true,"miyashiro.saitama.jp":true,"miyoshi.saitama.jp":true,"moroyama.saitama.jp":true,"nagatoro.saitama.jp":true,"namegawa.saitama.jp":true,"niiza.saitama.jp":true,"ogano.saitama.jp":true,"ogawa.saitama.jp":true,"ogose.saitama.jp":true,"okegawa.saitama.jp":true,"omiya.saitama.jp":true,"otaki.saitama.jp":true,"ranzan.saitama.jp":true,"ryokami.saitama.jp":true,"saitama.saitama.jp":true,"sakado.saitama.jp":true,"satte.saitama.jp":true,"sayama.saitama.jp":true,"shiki.saitama.jp":true,"shiraoka.saitama.jp":true,"soka.saitama.jp":true,"sugito.saitama.jp":true,"toda.saitama.jp":true,"tokigawa.saitama.jp":true,"tokorozawa.saitama.jp":true,"tsurugashima.saitama.jp":true,"urawa.saitama.jp":true,"warabi.saitama.jp":true,"yashio.saitama.jp":true,"yokoze.saitama.jp":true,"yono.saitama.jp":true,"yorii.saitama.jp":true,"yoshida.saitama.jp":true,"yoshikawa.saitama.jp":true,"yoshimi.saitama.jp":true,"aisho.shiga.jp":true,"gamo.shiga.jp":true,"higashiomi.shiga.jp":true,"hikone.shiga.jp":true,"koka.shiga.jp":true,"konan.shiga.jp":true,"kosei.shiga.jp":true,"koto.shiga.jp":true,"kusatsu.shiga.jp":true,"maibara.shiga.jp":true,"moriyama.shiga.jp":true,"nagahama.shiga.jp":true,"nishiazai.shiga.jp":true,"notogawa.shiga.jp":true,"omihachiman.shiga.jp":true,"otsu.shiga.jp":true,"ritto.shiga.jp":true,"ryuoh.shiga.jp":true,"takashima.shiga.jp":true,"takatsuki.shiga.jp":true,"torahime.shiga.jp":true,"toyosato.shiga.jp":true,"yasu.shiga.jp":true,"akagi.shimane.jp":true,"ama.shimane.jp":true,"gotsu.shimane.jp":true,"hamada.shimane.jp":true,"higashiizumo.shimane.jp":true,"hikawa.shimane.jp":true,"hikimi.shimane.jp":true,"izumo.shimane.jp":true,"kakinoki.shimane.jp":true,"masuda.shimane.jp":true,"matsue.shimane.jp":true,"misato.shimane.jp":true,"nishinoshima.shimane.jp":true,"ohda.shimane.jp":true,"okinoshima.shimane.jp":true,"okuizumo.shimane.jp":true,"shimane.shimane.jp":true,"tamayu.shimane.jp":true,"tsuwano.shimane.jp":true,"unnan.shimane.jp":true,"yakumo.shimane.jp":true,"yasugi.shimane.jp":true,"yatsuka.shimane.jp":true,"arai.shizuoka.jp":true,"atami.shizuoka.jp":true,"fuji.shizuoka.jp":true,"fujieda.shizuoka.jp":true,"fujikawa.shizuoka.jp":true,"fujinomiya.shizuoka.jp":true,"fukuroi.shizuoka.jp":true,"gotemba.shizuoka.jp":true,"haibara.shizuoka.jp":true,"hamamatsu.shizuoka.jp":true,"higashiizu.shizuoka.jp":true,"ito.shizuoka.jp":true,"iwata.shizuoka.jp":true,"izu.shizuoka.jp":true,"izunokuni.shizuoka.jp":true,"kakegawa.shizuoka.jp":true,"kannami.shizuoka.jp":true,"kawanehon.shizuoka.jp":true,"kawazu.shizuoka.jp":true,"kikugawa.shizuoka.jp":true,"kosai.shizuoka.jp":true,"makinohara.shizuoka.jp":true,"matsuzaki.shizuoka.jp":true,"minamiizu.shizuoka.jp":true,"mishima.shizuoka.jp":true,"morimachi.shizuoka.jp":true,"nishiizu.shizuoka.jp":true,"numazu.shizuoka.jp":true,"omaezaki.shizuoka.jp":true,"shimada.shizuoka.jp":true,"shimizu.shizuoka.jp":true,"shimoda.shizuoka.jp":true,"shizuoka.shizuoka.jp":true,"susono.shizuoka.jp":true,"yaizu.shizuoka.jp":true,"yoshida.shizuoka.jp":true,"ashikaga.tochigi.jp":true,"bato.tochigi.jp":true,"haga.tochigi.jp":true,"ichikai.tochigi.jp":true,"iwafune.tochigi.jp":true,"kaminokawa.tochigi.jp":true,"kanuma.tochigi.jp":true,"karasuyama.tochigi.jp":true,"kuroiso.tochigi.jp":true,"mashiko.tochigi.jp":true,"mibu.tochigi.jp":true,"moka.tochigi.jp":true,"motegi.tochigi.jp":true,"nasu.tochigi.jp":true,"nasushiobara.tochigi.jp":true,"nikko.tochigi.jp":true,"nishikata.tochigi.jp":true,"nogi.tochigi.jp":true,"ohira.tochigi.jp":true,"ohtawara.tochigi.jp":true,"oyama.tochigi.jp":true,"sakura.tochigi.jp":true,"sano.tochigi.jp":true,"shimotsuke.tochigi.jp":true,"shioya.tochigi.jp":true,"takanezawa.tochigi.jp":true,"tochigi.tochigi.jp":true,"tsuga.tochigi.jp":true,"ujiie.tochigi.jp":true,"utsunomiya.tochigi.jp":true,"yaita.tochigi.jp":true,"aizumi.tokushima.jp":true,"anan.tokushima.jp":true,"ichiba.tokushima.jp":true,"itano.tokushima.jp":true,"kainan.tokushima.jp":true,"komatsushima.tokushima.jp":true,"matsushige.tokushima.jp":true,"mima.tokushima.jp":true,"minami.tokushima.jp":true,"miyoshi.tokushima.jp":true,"mugi.tokushima.jp":true,"nakagawa.tokushima.jp":true,"naruto.tokushima.jp":true,"sanagochi.tokushima.jp":true,"shishikui.tokushima.jp":true,"tokushima.tokushima.jp":true,"wajiki.tokushima.jp":true,"adachi.tokyo.jp":true,"akiruno.tokyo.jp":true,"akishima.tokyo.jp":true,"aogashima.tokyo.jp":true,"arakawa.tokyo.jp":true,"bunkyo.tokyo.jp":true,"chiyoda.tokyo.jp":true,"chofu.tokyo.jp":true,"chuo.tokyo.jp":true,"edogawa.tokyo.jp":true,"fuchu.tokyo.jp":true,"fussa.tokyo.jp":true,"hachijo.tokyo.jp":true,"hachioji.tokyo.jp":true,"hamura.tokyo.jp":true,"higashikurume.tokyo.jp":true,"higashimurayama.tokyo.jp":true,"higashiyamato.tokyo.jp":true,"hino.tokyo.jp":true,"hinode.tokyo.jp":true,"hinohara.tokyo.jp":true,"inagi.tokyo.jp":true,"itabashi.tokyo.jp":true,"katsushika.tokyo.jp":true,"kita.tokyo.jp":true,"kiyose.tokyo.jp":true,"kodaira.tokyo.jp":true,"koganei.tokyo.jp":true,"kokubunji.tokyo.jp":true,"komae.tokyo.jp":true,"koto.tokyo.jp":true,"kouzushima.tokyo.jp":true,"kunitachi.tokyo.jp":true,"machida.tokyo.jp":true,"meguro.tokyo.jp":true,"minato.tokyo.jp":true,"mitaka.tokyo.jp":true,"mizuho.tokyo.jp":true,"musashimurayama.tokyo.jp":true,"musashino.tokyo.jp":true,"nakano.tokyo.jp":true,"nerima.tokyo.jp":true,"ogasawara.tokyo.jp":true,"okutama.tokyo.jp":true,"ome.tokyo.jp":true,"oshima.tokyo.jp":true,"ota.tokyo.jp":true,"setagaya.tokyo.jp":true,"shibuya.tokyo.jp":true,"shinagawa.tokyo.jp":true,"shinjuku.tokyo.jp":true,"suginami.tokyo.jp":true,"sumida.tokyo.jp":true,"tachikawa.tokyo.jp":true,"taito.tokyo.jp":true,"tama.tokyo.jp":true,"toshima.tokyo.jp":true,"chizu.tottori.jp":true,"hino.tottori.jp":true,"kawahara.tottori.jp":true,"koge.tottori.jp":true,"kotoura.tottori.jp":true,"misasa.tottori.jp":true,"nanbu.tottori.jp":true,"nichinan.tottori.jp":true,"sakaiminato.tottori.jp":true,"tottori.tottori.jp":true,"wakasa.tottori.jp":true,"yazu.tottori.jp":true,"yonago.tottori.jp":true,"asahi.toyama.jp":true,"fuchu.toyama.jp":true,"fukumitsu.toyama.jp":true,"funahashi.toyama.jp":true,"himi.toyama.jp":true,"imizu.toyama.jp":true,"inami.toyama.jp":true,"johana.toyama.jp":true,"kamiichi.toyama.jp":true,"kurobe.toyama.jp":true,"nakaniikawa.toyama.jp":true,"namerikawa.toyama.jp":true,"nanto.toyama.jp":true,"nyuzen.toyama.jp":true,"oyabe.toyama.jp":true,"taira.toyama.jp":true,"takaoka.toyama.jp":true,"tateyama.toyama.jp":true,"toga.toyama.jp":true,"tonami.toyama.jp":true,"toyama.toyama.jp":true,"unazuki.toyama.jp":true,"uozu.toyama.jp":true,"yamada.toyama.jp":true,"arida.wakayama.jp":true,"aridagawa.wakayama.jp":true,"gobo.wakayama.jp":true,"hashimoto.wakayama.jp":true,"hidaka.wakayama.jp":true,"hirogawa.wakayama.jp":true,"inami.wakayama.jp":true,"iwade.wakayama.jp":true,"kainan.wakayama.jp":true,"kamitonda.wakayama.jp":true,"katsuragi.wakayama.jp":true,"kimino.wakayama.jp":true,"kinokawa.wakayama.jp":true,"kitayama.wakayama.jp":true,"koya.wakayama.jp":true,"koza.wakayama.jp":true,"kozagawa.wakayama.jp":true,"kudoyama.wakayama.jp":true,"kushimoto.wakayama.jp":true,"mihama.wakayama.jp":true,"misato.wakayama.jp":true,"nachikatsuura.wakayama.jp":true,"shingu.wakayama.jp":true,"shirahama.wakayama.jp":true,"taiji.wakayama.jp":true,"tanabe.wakayama.jp":true,"wakayama.wakayama.jp":true,"yuasa.wakayama.jp":true,"yura.wakayama.jp":true,"asahi.yamagata.jp":true,"funagata.yamagata.jp":true,"higashine.yamagata.jp":true,"iide.yamagata.jp":true,"kahoku.yamagata.jp":true,"kaminoyama.yamagata.jp":true,"kaneyama.yamagata.jp":true,"kawanishi.yamagata.jp":true,"mamurogawa.yamagata.jp":true,"mikawa.yamagata.jp":true,"murayama.yamagata.jp":true,"nagai.yamagata.jp":true,"nakayama.yamagata.jp":true,"nanyo.yamagata.jp":true,"nishikawa.yamagata.jp":true,"obanazawa.yamagata.jp":true,"oe.yamagata.jp":true,"oguni.yamagata.jp":true,"ohkura.yamagata.jp":true,"oishida.yamagata.jp":true,"sagae.yamagata.jp":true,"sakata.yamagata.jp":true,"sakegawa.yamagata.jp":true,"shinjo.yamagata.jp":true,"shirataka.yamagata.jp":true,"shonai.yamagata.jp":true,"takahata.yamagata.jp":true,"tendo.yamagata.jp":true,"tozawa.yamagata.jp":true,"tsuruoka.yamagata.jp":true,"yamagata.yamagata.jp":true,"yamanobe.yamagata.jp":true,"yonezawa.yamagata.jp":true,"yuza.yamagata.jp":true,"abu.yamaguchi.jp":true,"hagi.yamaguchi.jp":true,"hikari.yamaguchi.jp":true,"hofu.yamaguchi.jp":true,"iwakuni.yamaguchi.jp":true,"kudamatsu.yamaguchi.jp":true,"mitou.yamaguchi.jp":true,"nagato.yamaguchi.jp":true,"oshima.yamaguchi.jp":true,"shimonoseki.yamaguchi.jp":true,"shunan.yamaguchi.jp":true,"tabuse.yamaguchi.jp":true,"tokuyama.yamaguchi.jp":true,"toyota.yamaguchi.jp":true,"ube.yamaguchi.jp":true,"yuu.yamaguchi.jp":true,"chuo.yamanashi.jp":true,"doshi.yamanashi.jp":true,"fuefuki.yamanashi.jp":true,"fujikawa.yamanashi.jp":true,"fujikawaguchiko.yamanashi.jp":true,"fujiyoshida.yamanashi.jp":true,"hayakawa.yamanashi.jp":true,"hokuto.yamanashi.jp":true,"ichikawamisato.yamanashi.jp":true,"kai.yamanashi.jp":true,"kofu.yamanashi.jp":true,"koshu.yamanashi.jp":true,"kosuge.yamanashi.jp":true,"minami-alps.yamanashi.jp":true,"minobu.yamanashi.jp":true,"nakamichi.yamanashi.jp":true,"nanbu.yamanashi.jp":true,"narusawa.yamanashi.jp":true,"nirasaki.yamanashi.jp":true,"nishikatsura.yamanashi.jp":true,"oshino.yamanashi.jp":true,"otsuki.yamanashi.jp":true,"showa.yamanashi.jp":true,"tabayama.yamanashi.jp":true,"tsuru.yamanashi.jp":true,"uenohara.yamanashi.jp":true,"yamanakako.yamanashi.jp":true,"yamanashi.yamanashi.jp":true,"*.ke":true,"kg":true,"org.kg":true,"net.kg":true,"com.kg":true,"edu.kg":true,"gov.kg":true,"mil.kg":true,"*.kh":true,"ki":true,"edu.ki":true,"biz.ki":true,"net.ki":true,"org.ki":true,"gov.ki":true,"info.ki":true,"com.ki":true,"km":true,"org.km":true,"nom.km":true,"gov.km":true,"prd.km":true,"tm.km":true,"edu.km":true,"mil.km":true,"ass.km":true,"com.km":true,"coop.km":true,"asso.km":true,"presse.km":true,"medecin.km":true,"notaires.km":true,"pharmaciens.km":true,"veterinaire.km":true,"gouv.km":true,"kn":true,"net.kn":true,"org.kn":true,"edu.kn":true,"gov.kn":true,"kp":true,"com.kp":true,"edu.kp":true,"gov.kp":true,"org.kp":true,"rep.kp":true,"tra.kp":true,"kr":true,"ac.kr":true,"co.kr":true,"es.kr":true,"go.kr":true,"hs.kr":true,"kg.kr":true,"mil.kr":true,"ms.kr":true,"ne.kr":true,"or.kr":true,"pe.kr":true,"re.kr":true,"sc.kr":true,"busan.kr":true,"chungbuk.kr":true,"chungnam.kr":true,"daegu.kr":true,"daejeon.kr":true,"gangwon.kr":true,"gwangju.kr":true,"gyeongbuk.kr":true,"gyeonggi.kr":true,"gyeongnam.kr":true,"incheon.kr":true,"jeju.kr":true,"jeonbuk.kr":true,"jeonnam.kr":true,"seoul.kr":true,"ulsan.kr":true,"*.kw":true,"ky":true,"edu.ky":true,"gov.ky":true,"com.ky":true,"org.ky":true,"net.ky":true,"kz":true,"org.kz":true,"edu.kz":true,"net.kz":true,"gov.kz":true,"mil.kz":true,"com.kz":true,"la":true,"int.la":true,"net.la":true,"info.la":true,"edu.la":true,"gov.la":true,"per.la":true,"com.la":true,"org.la":true,"lb":true,"com.lb":true,"edu.lb":true,"gov.lb":true,"net.lb":true,"org.lb":true,"lc":true,"com.lc":true,"net.lc":true,"co.lc":true,"org.lc":true,"edu.lc":true,"gov.lc":true,"li":true,"lk":true,"gov.lk":true,"sch.lk":true,"net.lk":true,"int.lk":true,"com.lk":true,"org.lk":true,"edu.lk":true,"ngo.lk":true,"soc.lk":true,"web.lk":true,"ltd.lk":true,"assn.lk":true,"grp.lk":true,"hotel.lk":true,"ac.lk":true,"lr":true,"com.lr":true,"edu.lr":true,"gov.lr":true,"org.lr":true,"net.lr":true,"ls":true,"co.ls":true,"org.ls":true,"lt":true,"gov.lt":true,"lu":true,"lv":true,"com.lv":true,"edu.lv":true,"gov.lv":true,"org.lv":true,"mil.lv":true,"id.lv":true,"net.lv":true,"asn.lv":true,"conf.lv":true,"ly":true,"com.ly":true,"net.ly":true,"gov.ly":true,"plc.ly":true,"edu.ly":true,"sch.ly":true,"med.ly":true,"org.ly":true,"id.ly":true,"ma":true,"co.ma":true,"net.ma":true,"gov.ma":true,"org.ma":true,"ac.ma":true,"press.ma":true,"mc":true,"tm.mc":true,"asso.mc":true,"md":true,"me":true,"co.me":true,"net.me":true,"org.me":true,"edu.me":true,"ac.me":true,"gov.me":true,"its.me":true,"priv.me":true,"mg":true,"org.mg":true,"nom.mg":true,"gov.mg":true,"prd.mg":true,"tm.mg":true,"edu.mg":true,"mil.mg":true,"com.mg":true,"co.mg":true,"mh":true,"mil":true,"mk":true,"com.mk":true,"org.mk":true,"net.mk":true,"edu.mk":true,"gov.mk":true,"inf.mk":true,"name.mk":true,"ml":true,"com.ml":true,"edu.ml":true,"gouv.ml":true,"gov.ml":true,"net.ml":true,"org.ml":true,"presse.ml":true,"*.mm":true,"mn":true,"gov.mn":true,"edu.mn":true,"org.mn":true,"mo":true,"com.mo":true,"net.mo":true,"org.mo":true,"edu.mo":true,"gov.mo":true,"mobi":true,"mp":true,"mq":true,"mr":true,"gov.mr":true,"ms":true,"com.ms":true,"edu.ms":true,"gov.ms":true,"net.ms":true,"org.ms":true,"mt":true,"com.mt":true,"edu.mt":true,"net.mt":true,"org.mt":true,"mu":true,"com.mu":true,"net.mu":true,"org.mu":true,"gov.mu":true,"ac.mu":true,"co.mu":true,"or.mu":true,"museum":true,"academy.museum":true,"agriculture.museum":true,"air.museum":true,"airguard.museum":true,"alabama.museum":true,"alaska.museum":true,"amber.museum":true,"ambulance.museum":true,"american.museum":true,"americana.museum":true,"americanantiques.museum":true,"americanart.museum":true,"amsterdam.museum":true,"and.museum":true,"annefrank.museum":true,"anthro.museum":true,"anthropology.museum":true,"antiques.museum":true,"aquarium.museum":true,"arboretum.museum":true,"archaeological.museum":true,"archaeology.museum":true,"architecture.museum":true,"art.museum":true,"artanddesign.museum":true,"artcenter.museum":true,"artdeco.museum":true,"arteducation.museum":true,"artgallery.museum":true,"arts.museum":true,"artsandcrafts.museum":true,"asmatart.museum":true,"assassination.museum":true,"assisi.museum":true,"association.museum":true,"astronomy.museum":true,"atlanta.museum":true,"austin.museum":true,"australia.museum":true,"automotive.museum":true,"aviation.museum":true,"axis.museum":true,"badajoz.museum":true,"baghdad.museum":true,"bahn.museum":true,"bale.museum":true,"baltimore.museum":true,"barcelona.museum":true,"baseball.museum":true,"basel.museum":true,"baths.museum":true,"bauern.museum":true,"beauxarts.museum":true,"beeldengeluid.museum":true,"bellevue.museum":true,"bergbau.museum":true,"berkeley.museum":true,"berlin.museum":true,"bern.museum":true,"bible.museum":true,"bilbao.museum":true,"bill.museum":true,"birdart.museum":true,"birthplace.museum":true,"bonn.museum":true,"boston.museum":true,"botanical.museum":true,"botanicalgarden.museum":true,"botanicgarden.museum":true,"botany.museum":true,"brandywinevalley.museum":true,"brasil.museum":true,"bristol.museum":true,"british.museum":true,"britishcolumbia.museum":true,"broadcast.museum":true,"brunel.museum":true,"brussel.museum":true,"brussels.museum":true,"bruxelles.museum":true,"building.museum":true,"burghof.museum":true,"bus.museum":true,"bushey.museum":true,"cadaques.museum":true,"california.museum":true,"cambridge.museum":true,"can.museum":true,"canada.museum":true,"capebreton.museum":true,"carrier.museum":true,"cartoonart.museum":true,"casadelamoneda.museum":true,"castle.museum":true,"castres.museum":true,"celtic.museum":true,"center.museum":true,"chattanooga.museum":true,"cheltenham.museum":true,"chesapeakebay.museum":true,"chicago.museum":true,"children.museum":true,"childrens.museum":true,"childrensgarden.museum":true,"chiropractic.museum":true,"chocolate.museum":true,"christiansburg.museum":true,"cincinnati.museum":true,"cinema.museum":true,"circus.museum":true,"civilisation.museum":true,"civilization.museum":true,"civilwar.museum":true,"clinton.museum":true,"clock.museum":true,"coal.museum":true,"coastaldefence.museum":true,"cody.museum":true,"coldwar.museum":true,"collection.museum":true,"colonialwilliamsburg.museum":true,"coloradoplateau.museum":true,"columbia.museum":true,"columbus.museum":true,"communication.museum":true,"communications.museum":true,"community.museum":true,"computer.museum":true,"computerhistory.museum":true,"xn--comunicaes-v6a2o.museum":true,"contemporary.museum":true,"contemporaryart.museum":true,"convent.museum":true,"copenhagen.museum":true,"corporation.museum":true,"xn--correios-e-telecomunicaes-ghc29a.museum":true,"corvette.museum":true,"costume.museum":true,"countryestate.museum":true,"county.museum":true,"crafts.museum":true,"cranbrook.museum":true,"creation.museum":true,"cultural.museum":true,"culturalcenter.museum":true,"culture.museum":true,"cyber.museum":true,"cymru.museum":true,"dali.museum":true,"dallas.museum":true,"database.museum":true,"ddr.museum":true,"decorativearts.museum":true,"delaware.museum":true,"delmenhorst.museum":true,"denmark.museum":true,"depot.museum":true,"design.museum":true,"detroit.museum":true,"dinosaur.museum":true,"discovery.museum":true,"dolls.museum":true,"donostia.museum":true,"durham.museum":true,"eastafrica.museum":true,"eastcoast.museum":true,"education.museum":true,"educational.museum":true,"egyptian.museum":true,"eisenbahn.museum":true,"elburg.museum":true,"elvendrell.museum":true,"embroidery.museum":true,"encyclopedic.museum":true,"england.museum":true,"entomology.museum":true,"environment.museum":true,"environmentalconservation.museum":true,"epilepsy.museum":true,"essex.museum":true,"estate.museum":true,"ethnology.museum":true,"exeter.museum":true,"exhibition.museum":true,"family.museum":true,"farm.museum":true,"farmequipment.museum":true,"farmers.museum":true,"farmstead.museum":true,"field.museum":true,"figueres.museum":true,"filatelia.museum":true,"film.museum":true,"fineart.museum":true,"finearts.museum":true,"finland.museum":true,"flanders.museum":true,"florida.museum":true,"force.museum":true,"fortmissoula.museum":true,"fortworth.museum":true,"foundation.museum":true,"francaise.museum":true,"frankfurt.museum":true,"franziskaner.museum":true,"freemasonry.museum":true,"freiburg.museum":true,"fribourg.museum":true,"frog.museum":true,"fundacio.museum":true,"furniture.museum":true,"gallery.museum":true,"garden.museum":true,"gateway.museum":true,"geelvinck.museum":true,"gemological.museum":true,"geology.museum":true,"georgia.museum":true,"giessen.museum":true,"glas.museum":true,"glass.museum":true,"gorge.museum":true,"grandrapids.museum":true,"graz.museum":true,"guernsey.museum":true,"halloffame.museum":true,"hamburg.museum":true,"handson.museum":true,"harvestcelebration.museum":true,"hawaii.museum":true,"health.museum":true,"heimatunduhren.museum":true,"hellas.museum":true,"helsinki.museum":true,"hembygdsforbund.museum":true,"heritage.museum":true,"histoire.museum":true,"historical.museum":true,"historicalsociety.museum":true,"historichouses.museum":true,"historisch.museum":true,"historisches.museum":true,"history.museum":true,"historyofscience.museum":true,"horology.museum":true,"house.museum":true,"humanities.museum":true,"illustration.museum":true,"imageandsound.museum":true,"indian.museum":true,"indiana.museum":true,"indianapolis.museum":true,"indianmarket.museum":true,"intelligence.museum":true,"interactive.museum":true,"iraq.museum":true,"iron.museum":true,"isleofman.museum":true,"jamison.museum":true,"jefferson.museum":true,"jerusalem.museum":true,"jewelry.museum":true,"jewish.museum":true,"jewishart.museum":true,"jfk.museum":true,"journalism.museum":true,"judaica.museum":true,"judygarland.museum":true,"juedisches.museum":true,"juif.museum":true,"karate.museum":true,"karikatur.museum":true,"kids.museum":true,"koebenhavn.museum":true,"koeln.museum":true,"kunst.museum":true,"kunstsammlung.museum":true,"kunstunddesign.museum":true,"labor.museum":true,"labour.museum":true,"lajolla.museum":true,"lancashire.museum":true,"landes.museum":true,"lans.museum":true,"xn--lns-qla.museum":true,"larsson.museum":true,"lewismiller.museum":true,"lincoln.museum":true,"linz.museum":true,"living.museum":true,"livinghistory.museum":true,"localhistory.museum":true,"london.museum":true,"losangeles.museum":true,"louvre.museum":true,"loyalist.museum":true,"lucerne.museum":true,"luxembourg.museum":true,"luzern.museum":true,"mad.museum":true,"madrid.museum":true,"mallorca.museum":true,"manchester.museum":true,"mansion.museum":true,"mansions.museum":true,"manx.museum":true,"marburg.museum":true,"maritime.museum":true,"maritimo.museum":true,"maryland.museum":true,"marylhurst.museum":true,"media.museum":true,"medical.museum":true,"medizinhistorisches.museum":true,"meeres.museum":true,"memorial.museum":true,"mesaverde.museum":true,"michigan.museum":true,"midatlantic.museum":true,"military.museum":true,"mill.museum":true,"miners.museum":true,"mining.museum":true,"minnesota.museum":true,"missile.museum":true,"missoula.museum":true,"modern.museum":true,"moma.museum":true,"money.museum":true,"monmouth.museum":true,"monticello.museum":true,"montreal.museum":true,"moscow.museum":true,"motorcycle.museum":true,"muenchen.museum":true,"muenster.museum":true,"mulhouse.museum":true,"muncie.museum":true,"museet.museum":true,"museumcenter.museum":true,"museumvereniging.museum":true,"music.museum":true,"national.museum":true,"nationalfirearms.museum":true,"nationalheritage.museum":true,"nativeamerican.museum":true,"naturalhistory.museum":true,"naturalhistorymuseum.museum":true,"naturalsciences.museum":true,"nature.museum":true,"naturhistorisches.museum":true,"natuurwetenschappen.museum":true,"naumburg.museum":true,"naval.museum":true,"nebraska.museum":true,"neues.museum":true,"newhampshire.museum":true,"newjersey.museum":true,"newmexico.museum":true,"newport.museum":true,"newspaper.museum":true,"newyork.museum":true,"niepce.museum":true,"norfolk.museum":true,"north.museum":true,"nrw.museum":true,"nuernberg.museum":true,"nuremberg.museum":true,"nyc.museum":true,"nyny.museum":true,"oceanographic.museum":true,"oceanographique.museum":true,"omaha.museum":true,"online.museum":true,"ontario.museum":true,"openair.museum":true,"oregon.museum":true,"oregontrail.museum":true,"otago.museum":true,"oxford.museum":true,"pacific.museum":true,"paderborn.museum":true,"palace.museum":true,"paleo.museum":true,"palmsprings.museum":true,"panama.museum":true,"paris.museum":true,"pasadena.museum":true,"pharmacy.museum":true,"philadelphia.museum":true,"philadelphiaarea.museum":true,"philately.museum":true,"phoenix.museum":true,"photography.museum":true,"pilots.museum":true,"pittsburgh.museum":true,"planetarium.museum":true,"plantation.museum":true,"plants.museum":true,"plaza.museum":true,"portal.museum":true,"portland.museum":true,"portlligat.museum":true,"posts-and-telecommunications.museum":true,"preservation.museum":true,"presidio.museum":true,"press.museum":true,"project.museum":true,"public.museum":true,"pubol.museum":true,"quebec.museum":true,"railroad.museum":true,"railway.museum":true,"research.museum":true,"resistance.museum":true,"riodejaneiro.museum":true,"rochester.museum":true,"rockart.museum":true,"roma.museum":true,"russia.museum":true,"saintlouis.museum":true,"salem.museum":true,"salvadordali.museum":true,"salzburg.museum":true,"sandiego.museum":true,"sanfrancisco.museum":true,"santabarbara.museum":true,"santacruz.museum":true,"santafe.museum":true,"saskatchewan.museum":true,"satx.museum":true,"savannahga.museum":true,"schlesisches.museum":true,"schoenbrunn.museum":true,"schokoladen.museum":true,"school.museum":true,"schweiz.museum":true,"science.museum":true,"scienceandhistory.museum":true,"scienceandindustry.museum":true,"sciencecenter.museum":true,"sciencecenters.museum":true,"science-fiction.museum":true,"sciencehistory.museum":true,"sciences.museum":true,"sciencesnaturelles.museum":true,"scotland.museum":true,"seaport.museum":true,"settlement.museum":true,"settlers.museum":true,"shell.museum":true,"sherbrooke.museum":true,"sibenik.museum":true,"silk.museum":true,"ski.museum":true,"skole.museum":true,"society.museum":true,"sologne.museum":true,"soundandvision.museum":true,"southcarolina.museum":true,"southwest.museum":true,"space.museum":true,"spy.museum":true,"square.museum":true,"stadt.museum":true,"stalbans.museum":true,"starnberg.museum":true,"state.museum":true,"stateofdelaware.museum":true,"station.museum":true,"steam.museum":true,"steiermark.museum":true,"stjohn.museum":true,"stockholm.museum":true,"stpetersburg.museum":true,"stuttgart.museum":true,"suisse.museum":true,"surgeonshall.museum":true,"surrey.museum":true,"svizzera.museum":true,"sweden.museum":true,"sydney.museum":true,"tank.museum":true,"tcm.museum":true,"technology.museum":true,"telekommunikation.museum":true,"television.museum":true,"texas.museum":true,"textile.museum":true,"theater.museum":true,"time.museum":true,"timekeeping.museum":true,"topology.museum":true,"torino.museum":true,"touch.museum":true,"town.museum":true,"transport.museum":true,"tree.museum":true,"trolley.museum":true,"trust.museum":true,"trustee.museum":true,"uhren.museum":true,"ulm.museum":true,"undersea.museum":true,"university.museum":true,"usa.museum":true,"usantiques.museum":true,"usarts.museum":true,"uscountryestate.museum":true,"usculture.museum":true,"usdecorativearts.museum":true,"usgarden.museum":true,"ushistory.museum":true,"ushuaia.museum":true,"uslivinghistory.museum":true,"utah.museum":true,"uvic.museum":true,"valley.museum":true,"vantaa.museum":true,"versailles.museum":true,"viking.museum":true,"village.museum":true,"virginia.museum":true,"virtual.museum":true,"virtuel.museum":true,"vlaanderen.museum":true,"volkenkunde.museum":true,"wales.museum":true,"wallonie.museum":true,"war.museum":true,"washingtondc.museum":true,"watchandclock.museum":true,"watch-and-clock.museum":true,"western.museum":true,"westfalen.museum":true,"whaling.museum":true,"wildlife.museum":true,"williamsburg.museum":true,"windmill.museum":true,"workshop.museum":true,"york.museum":true,"yorkshire.museum":true,"yosemite.museum":true,"youth.museum":true,"zoological.museum":true,"zoology.museum":true,"xn--9dbhblg6di.museum":true,"xn--h1aegh.museum":true,"mv":true,"aero.mv":true,"biz.mv":true,"com.mv":true,"coop.mv":true,"edu.mv":true,"gov.mv":true,"info.mv":true,"int.mv":true,"mil.mv":true,"museum.mv":true,"name.mv":true,"net.mv":true,"org.mv":true,"pro.mv":true,"mw":true,"ac.mw":true,"biz.mw":true,"co.mw":true,"com.mw":true,"coop.mw":true,"edu.mw":true,"gov.mw":true,"int.mw":true,"museum.mw":true,"net.mw":true,"org.mw":true,"mx":true,"com.mx":true,"org.mx":true,"gob.mx":true,"edu.mx":true,"net.mx":true,"my":true,"com.my":true,"net.my":true,"org.my":true,"gov.my":true,"edu.my":true,"mil.my":true,"name.my":true,"*.mz":true,"teledata.mz":false,"na":true,"info.na":true,"pro.na":true,"name.na":true,"school.na":true,"or.na":true,"dr.na":true,"us.na":true,"mx.na":true,"ca.na":true,"in.na":true,"cc.na":true,"tv.na":true,"ws.na":true,"mobi.na":true,"co.na":true,"com.na":true,"org.na":true,"name":true,"nc":true,"asso.nc":true,"ne":true,"net":true,"nf":true,"com.nf":true,"net.nf":true,"per.nf":true,"rec.nf":true,"web.nf":true,"arts.nf":true,"firm.nf":true,"info.nf":true,"other.nf":true,"store.nf":true,"ng":true,"com.ng":true,"edu.ng":true,"name.ng":true,"net.ng":true,"org.ng":true,"sch.ng":true,"gov.ng":true,"mil.ng":true,"mobi.ng":true,"*.ni":true,"nl":true,"bv.nl":true,"no":true,"fhs.no":true,"vgs.no":true,"fylkesbibl.no":true,"folkebibl.no":true,"museum.no":true,"idrett.no":true,"priv.no":true,"mil.no":true,"stat.no":true,"dep.no":true,"kommune.no":true,"herad.no":true,"aa.no":true,"ah.no":true,"bu.no":true,"fm.no":true,"hl.no":true,"hm.no":true,"jan-mayen.no":true,"mr.no":true,"nl.no":true,"nt.no":true,"of.no":true,"ol.no":true,"oslo.no":true,"rl.no":true,"sf.no":true,"st.no":true,"svalbard.no":true,"tm.no":true,"tr.no":true,"va.no":true,"vf.no":true,"gs.aa.no":true,"gs.ah.no":true,"gs.bu.no":true,"gs.fm.no":true,"gs.hl.no":true,"gs.hm.no":true,"gs.jan-mayen.no":true,"gs.mr.no":true,"gs.nl.no":true,"gs.nt.no":true,"gs.of.no":true,"gs.ol.no":true,"gs.oslo.no":true,"gs.rl.no":true,"gs.sf.no":true,"gs.st.no":true,"gs.svalbard.no":true,"gs.tm.no":true,"gs.tr.no":true,"gs.va.no":true,"gs.vf.no":true,"akrehamn.no":true,"xn--krehamn-dxa.no":true,"algard.no":true,"xn--lgrd-poac.no":true,"arna.no":true,"brumunddal.no":true,"bryne.no":true,"bronnoysund.no":true,"xn--brnnysund-m8ac.no":true,"drobak.no":true,"xn--drbak-wua.no":true,"egersund.no":true,"fetsund.no":true,"floro.no":true,"xn--flor-jra.no":true,"fredrikstad.no":true,"hokksund.no":true,"honefoss.no":true,"xn--hnefoss-q1a.no":true,"jessheim.no":true,"jorpeland.no":true,"xn--jrpeland-54a.no":true,"kirkenes.no":true,"kopervik.no":true,"krokstadelva.no":true,"langevag.no":true,"xn--langevg-jxa.no":true,"leirvik.no":true,"mjondalen.no":true,"xn--mjndalen-64a.no":true,"mo-i-rana.no":true,"mosjoen.no":true,"xn--mosjen-eya.no":true,"nesoddtangen.no":true,"orkanger.no":true,"osoyro.no":true,"xn--osyro-wua.no":true,"raholt.no":true,"xn--rholt-mra.no":true,"sandnessjoen.no":true,"xn--sandnessjen-ogb.no":true,"skedsmokorset.no":true,"slattum.no":true,"spjelkavik.no":true,"stathelle.no":true,"stavern.no":true,"stjordalshalsen.no":true,"xn--stjrdalshalsen-sqb.no":true,"tananger.no":true,"tranby.no":true,"vossevangen.no":true,"afjord.no":true,"xn--fjord-lra.no":true,"agdenes.no":true,"al.no":true,"xn--l-1fa.no":true,"alesund.no":true,"xn--lesund-hua.no":true,"alstahaug.no":true,"alta.no":true,"xn--lt-liac.no":true,"alaheadju.no":true,"xn--laheadju-7ya.no":true,"alvdal.no":true,"amli.no":true,"xn--mli-tla.no":true,"amot.no":true,"xn--mot-tla.no":true,"andebu.no":true,"andoy.no":true,"xn--andy-ira.no":true,"andasuolo.no":true,"ardal.no":true,"xn--rdal-poa.no":true,"aremark.no":true,"arendal.no":true,"xn--s-1fa.no":true,"aseral.no":true,"xn--seral-lra.no":true,"asker.no":true,"askim.no":true,"askvoll.no":true,"askoy.no":true,"xn--asky-ira.no":true,"asnes.no":true,"xn--snes-poa.no":true,"audnedaln.no":true,"aukra.no":true,"aure.no":true,"aurland.no":true,"aurskog-holand.no":true,"xn--aurskog-hland-jnb.no":true,"austevoll.no":true,"austrheim.no":true,"averoy.no":true,"xn--avery-yua.no":true,"balestrand.no":true,"ballangen.no":true,"balat.no":true,"xn--blt-elab.no":true,"balsfjord.no":true,"bahccavuotna.no":true,"xn--bhccavuotna-k7a.no":true,"bamble.no":true,"bardu.no":true,"beardu.no":true,"beiarn.no":true,"bajddar.no":true,"xn--bjddar-pta.no":true,"baidar.no":true,"xn--bidr-5nac.no":true,"berg.no":true,"bergen.no":true,"berlevag.no":true,"xn--berlevg-jxa.no":true,"bearalvahki.no":true,"xn--bearalvhki-y4a.no":true,"bindal.no":true,"birkenes.no":true,"bjarkoy.no":true,"xn--bjarky-fya.no":true,"bjerkreim.no":true,"bjugn.no":true,"bodo.no":true,"xn--bod-2na.no":true,"badaddja.no":true,"xn--bdddj-mrabd.no":true,"budejju.no":true,"bokn.no":true,"bremanger.no":true,"bronnoy.no":true,"xn--brnny-wuac.no":true,"bygland.no":true,"bykle.no":true,"barum.no":true,"xn--brum-voa.no":true,"bo.telemark.no":true,"xn--b-5ga.telemark.no":true,"bo.nordland.no":true,"xn--b-5ga.nordland.no":true,"bievat.no":true,"xn--bievt-0qa.no":true,"bomlo.no":true,"xn--bmlo-gra.no":true,"batsfjord.no":true,"xn--btsfjord-9za.no":true,"bahcavuotna.no":true,"xn--bhcavuotna-s4a.no":true,"dovre.no":true,"drammen.no":true,"drangedal.no":true,"dyroy.no":true,"xn--dyry-ira.no":true,"donna.no":true,"xn--dnna-gra.no":true,"eid.no":true,"eidfjord.no":true,"eidsberg.no":true,"eidskog.no":true,"eidsvoll.no":true,"eigersund.no":true,"elverum.no":true,"enebakk.no":true,"engerdal.no":true,"etne.no":true,"etnedal.no":true,"evenes.no":true,"evenassi.no":true,"xn--eveni-0qa01ga.no":true,"evje-og-hornnes.no":true,"farsund.no":true,"fauske.no":true,"fuossko.no":true,"fuoisku.no":true,"fedje.no":true,"fet.no":true,"finnoy.no":true,"xn--finny-yua.no":true,"fitjar.no":true,"fjaler.no":true,"fjell.no":true,"flakstad.no":true,"flatanger.no":true,"flekkefjord.no":true,"flesberg.no":true,"flora.no":true,"fla.no":true,"xn--fl-zia.no":true,"folldal.no":true,"forsand.no":true,"fosnes.no":true,"frei.no":true,"frogn.no":true,"froland.no":true,"frosta.no":true,"frana.no":true,"xn--frna-woa.no":true,"froya.no":true,"xn--frya-hra.no":true,"fusa.no":true,"fyresdal.no":true,"forde.no":true,"xn--frde-gra.no":true,"gamvik.no":true,"gangaviika.no":true,"xn--ggaviika-8ya47h.no":true,"gaular.no":true,"gausdal.no":true,"gildeskal.no":true,"xn--gildeskl-g0a.no":true,"giske.no":true,"gjemnes.no":true,"gjerdrum.no":true,"gjerstad.no":true,"gjesdal.no":true,"gjovik.no":true,"xn--gjvik-wua.no":true,"gloppen.no":true,"gol.no":true,"gran.no":true,"grane.no":true,"granvin.no":true,"gratangen.no":true,"grimstad.no":true,"grong.no":true,"kraanghke.no":true,"xn--kranghke-b0a.no":true,"grue.no":true,"gulen.no":true,"hadsel.no":true,"halden.no":true,"halsa.no":true,"hamar.no":true,"hamaroy.no":true,"habmer.no":true,"xn--hbmer-xqa.no":true,"hapmir.no":true,"xn--hpmir-xqa.no":true,"hammerfest.no":true,"hammarfeasta.no":true,"xn--hmmrfeasta-s4ac.no":true,"haram.no":true,"hareid.no":true,"harstad.no":true,"hasvik.no":true,"aknoluokta.no":true,"xn--koluokta-7ya57h.no":true,"hattfjelldal.no":true,"aarborte.no":true,"haugesund.no":true,"hemne.no":true,"hemnes.no":true,"hemsedal.no":true,"heroy.more-og-romsdal.no":true,"xn--hery-ira.xn--mre-og-romsdal-qqb.no":true,"heroy.nordland.no":true,"xn--hery-ira.nordland.no":true,"hitra.no":true,"hjartdal.no":true,"hjelmeland.no":true,"hobol.no":true,"xn--hobl-ira.no":true,"hof.no":true,"hol.no":true,"hole.no":true,"holmestrand.no":true,"holtalen.no":true,"xn--holtlen-hxa.no":true,"hornindal.no":true,"horten.no":true,"hurdal.no":true,"hurum.no":true,"hvaler.no":true,"hyllestad.no":true,"hagebostad.no":true,"xn--hgebostad-g3a.no":true,"hoyanger.no":true,"xn--hyanger-q1a.no":true,"hoylandet.no":true,"xn--hylandet-54a.no":true,"ha.no":true,"xn--h-2fa.no":true,"ibestad.no":true,"inderoy.no":true,"xn--indery-fya.no":true,"iveland.no":true,"jevnaker.no":true,"jondal.no":true,"jolster.no":true,"xn--jlster-bya.no":true,"karasjok.no":true,"karasjohka.no":true,"xn--krjohka-hwab49j.no":true,"karlsoy.no":true,"galsa.no":true,"xn--gls-elac.no":true,"karmoy.no":true,"xn--karmy-yua.no":true,"kautokeino.no":true,"guovdageaidnu.no":true,"klepp.no":true,"klabu.no":true,"xn--klbu-woa.no":true,"kongsberg.no":true,"kongsvinger.no":true,"kragero.no":true,"xn--krager-gya.no":true,"kristiansand.no":true,"kristiansund.no":true,"krodsherad.no":true,"xn--krdsherad-m8a.no":true,"kvalsund.no":true,"rahkkeravju.no":true,"xn--rhkkervju-01af.no":true,"kvam.no":true,"kvinesdal.no":true,"kvinnherad.no":true,"kviteseid.no":true,"kvitsoy.no":true,"xn--kvitsy-fya.no":true,"kvafjord.no":true,"xn--kvfjord-nxa.no":true,"giehtavuoatna.no":true,"kvanangen.no":true,"xn--kvnangen-k0a.no":true,"navuotna.no":true,"xn--nvuotna-hwa.no":true,"kafjord.no":true,"xn--kfjord-iua.no":true,"gaivuotna.no":true,"xn--givuotna-8ya.no":true,"larvik.no":true,"lavangen.no":true,"lavagis.no":true,"loabat.no":true,"xn--loabt-0qa.no":true,"lebesby.no":true,"davvesiida.no":true,"leikanger.no":true,"leirfjord.no":true,"leka.no":true,"leksvik.no":true,"lenvik.no":true,"leangaviika.no":true,"xn--leagaviika-52b.no":true,"lesja.no":true,"levanger.no":true,"lier.no":true,"lierne.no":true,"lillehammer.no":true,"lillesand.no":true,"lindesnes.no":true,"lindas.no":true,"xn--linds-pra.no":true,"lom.no":true,"loppa.no":true,"lahppi.no":true,"xn--lhppi-xqa.no":true,"lund.no":true,"lunner.no":true,"luroy.no":true,"xn--lury-ira.no":true,"luster.no":true,"lyngdal.no":true,"lyngen.no":true,"ivgu.no":true,"lardal.no":true,"lerdal.no":true,"xn--lrdal-sra.no":true,"lodingen.no":true,"xn--ldingen-q1a.no":true,"lorenskog.no":true,"xn--lrenskog-54a.no":true,"loten.no":true,"xn--lten-gra.no":true,"malvik.no":true,"masoy.no":true,"xn--msy-ula0h.no":true,"muosat.no":true,"xn--muost-0qa.no":true,"mandal.no":true,"marker.no":true,"marnardal.no":true,"masfjorden.no":true,"meland.no":true,"meldal.no":true,"melhus.no":true,"meloy.no":true,"xn--mely-ira.no":true,"meraker.no":true,"xn--merker-kua.no":true,"moareke.no":true,"xn--moreke-jua.no":true,"midsund.no":true,"midtre-gauldal.no":true,"modalen.no":true,"modum.no":true,"molde.no":true,"moskenes.no":true,"moss.no":true,"mosvik.no":true,"malselv.no":true,"xn--mlselv-iua.no":true,"malatvuopmi.no":true,"xn--mlatvuopmi-s4a.no":true,"namdalseid.no":true,"aejrie.no":true,"namsos.no":true,"namsskogan.no":true,"naamesjevuemie.no":true,"xn--nmesjevuemie-tcba.no":true,"laakesvuemie.no":true,"nannestad.no":true,"narvik.no":true,"narviika.no":true,"naustdal.no":true,"nedre-eiker.no":true,"nes.akershus.no":true,"nes.buskerud.no":true,"nesna.no":true,"nesodden.no":true,"nesseby.no":true,"unjarga.no":true,"xn--unjrga-rta.no":true,"nesset.no":true,"nissedal.no":true,"nittedal.no":true,"nord-aurdal.no":true,"nord-fron.no":true,"nord-odal.no":true,"norddal.no":true,"nordkapp.no":true,"davvenjarga.no":true,"xn--davvenjrga-y4a.no":true,"nordre-land.no":true,"nordreisa.no":true,"raisa.no":true,"xn--risa-5na.no":true,"nore-og-uvdal.no":true,"notodden.no":true,"naroy.no":true,"xn--nry-yla5g.no":true,"notteroy.no":true,"xn--nttery-byae.no":true,"odda.no":true,"oksnes.no":true,"xn--ksnes-uua.no":true,"oppdal.no":true,"oppegard.no":true,"xn--oppegrd-ixa.no":true,"orkdal.no":true,"orland.no":true,"xn--rland-uua.no":true,"orskog.no":true,"xn--rskog-uua.no":true,"orsta.no":true,"xn--rsta-fra.no":true,"os.hedmark.no":true,"os.hordaland.no":true,"osen.no":true,"osteroy.no":true,"xn--ostery-fya.no":true,"ostre-toten.no":true,"xn--stre-toten-zcb.no":true,"overhalla.no":true,"ovre-eiker.no":true,"xn--vre-eiker-k8a.no":true,"oyer.no":true,"xn--yer-zna.no":true,"oygarden.no":true,"xn--ygarden-p1a.no":true,"oystre-slidre.no":true,"xn--ystre-slidre-ujb.no":true,"porsanger.no":true,"porsangu.no":true,"xn--porsgu-sta26f.no":true,"porsgrunn.no":true,"radoy.no":true,"xn--rady-ira.no":true,"rakkestad.no":true,"rana.no":true,"ruovat.no":true,"randaberg.no":true,"rauma.no":true,"rendalen.no":true,"rennebu.no":true,"rennesoy.no":true,"xn--rennesy-v1a.no":true,"rindal.no":true,"ringebu.no":true,"ringerike.no":true,"ringsaker.no":true,"rissa.no":true,"risor.no":true,"xn--risr-ira.no":true,"roan.no":true,"rollag.no":true,"rygge.no":true,"ralingen.no":true,"xn--rlingen-mxa.no":true,"rodoy.no":true,"xn--rdy-0nab.no":true,"romskog.no":true,"xn--rmskog-bya.no":true,"roros.no":true,"xn--rros-gra.no":true,"rost.no":true,"xn--rst-0na.no":true,"royken.no":true,"xn--ryken-vua.no":true,"royrvik.no":true,"xn--ryrvik-bya.no":true,"rade.no":true,"xn--rde-ula.no":true,"salangen.no":true,"siellak.no":true,"saltdal.no":true,"salat.no":true,"xn--slt-elab.no":true,"xn--slat-5na.no":true,"samnanger.no":true,"sande.more-og-romsdal.no":true,"sande.xn--mre-og-romsdal-qqb.no":true,"sande.vestfold.no":true,"sandefjord.no":true,"sandnes.no":true,"sandoy.no":true,"xn--sandy-yua.no":true,"sarpsborg.no":true,"sauda.no":true,"sauherad.no":true,"sel.no":true,"selbu.no":true,"selje.no":true,"seljord.no":true,"sigdal.no":true,"siljan.no":true,"sirdal.no":true,"skaun.no":true,"skedsmo.no":true,"ski.no":true,"skien.no":true,"skiptvet.no":true,"skjervoy.no":true,"xn--skjervy-v1a.no":true,"skierva.no":true,"xn--skierv-uta.no":true,"skjak.no":true,"xn--skjk-soa.no":true,"skodje.no":true,"skanland.no":true,"xn--sknland-fxa.no":true,"skanit.no":true,"xn--sknit-yqa.no":true,"smola.no":true,"xn--smla-hra.no":true,"snillfjord.no":true,"snasa.no":true,"xn--snsa-roa.no":true,"snoasa.no":true,"snaase.no":true,"xn--snase-nra.no":true,"sogndal.no":true,"sokndal.no":true,"sola.no":true,"solund.no":true,"songdalen.no":true,"sortland.no":true,"spydeberg.no":true,"stange.no":true,"stavanger.no":true,"steigen.no":true,"steinkjer.no":true,"stjordal.no":true,"xn--stjrdal-s1a.no":true,"stokke.no":true,"stor-elvdal.no":true,"stord.no":true,"stordal.no":true,"storfjord.no":true,"omasvuotna.no":true,"strand.no":true,"stranda.no":true,"stryn.no":true,"sula.no":true,"suldal.no":true,"sund.no":true,"sunndal.no":true,"surnadal.no":true,"sveio.no":true,"svelvik.no":true,"sykkylven.no":true,"sogne.no":true,"xn--sgne-gra.no":true,"somna.no":true,"xn--smna-gra.no":true,"sondre-land.no":true,"xn--sndre-land-0cb.no":true,"sor-aurdal.no":true,"xn--sr-aurdal-l8a.no":true,"sor-fron.no":true,"xn--sr-fron-q1a.no":true,"sor-odal.no":true,"xn--sr-odal-q1a.no":true,"sor-varanger.no":true,"xn--sr-varanger-ggb.no":true,"matta-varjjat.no":true,"xn--mtta-vrjjat-k7af.no":true,"sorfold.no":true,"xn--srfold-bya.no":true,"sorreisa.no":true,"xn--srreisa-q1a.no":true,"sorum.no":true,"xn--srum-gra.no":true,"tana.no":true,"deatnu.no":true,"time.no":true,"tingvoll.no":true,"tinn.no":true,"tjeldsund.no":true,"dielddanuorri.no":true,"tjome.no":true,"xn--tjme-hra.no":true,"tokke.no":true,"tolga.no":true,"torsken.no":true,"tranoy.no":true,"xn--trany-yua.no":true,"tromso.no":true,"xn--troms-zua.no":true,"tromsa.no":true,"romsa.no":true,"trondheim.no":true,"troandin.no":true,"trysil.no":true,"trana.no":true,"xn--trna-woa.no":true,"trogstad.no":true,"xn--trgstad-r1a.no":true,"tvedestrand.no":true,"tydal.no":true,"tynset.no":true,"tysfjord.no":true,"divtasvuodna.no":true,"divttasvuotna.no":true,"tysnes.no":true,"tysvar.no":true,"xn--tysvr-vra.no":true,"tonsberg.no":true,"xn--tnsberg-q1a.no":true,"ullensaker.no":true,"ullensvang.no":true,"ulvik.no":true,"utsira.no":true,"vadso.no":true,"xn--vads-jra.no":true,"cahcesuolo.no":true,"xn--hcesuolo-7ya35b.no":true,"vaksdal.no":true,"valle.no":true,"vang.no":true,"vanylven.no":true,"vardo.no":true,"xn--vard-jra.no":true,"varggat.no":true,"xn--vrggt-xqad.no":true,"vefsn.no":true,"vaapste.no":true,"vega.no":true,"vegarshei.no":true,"xn--vegrshei-c0a.no":true,"vennesla.no":true,"verdal.no":true,"verran.no":true,"vestby.no":true,"vestnes.no":true,"vestre-slidre.no":true,"vestre-toten.no":true,"vestvagoy.no":true,"xn--vestvgy-ixa6o.no":true,"vevelstad.no":true,"vik.no":true,"vikna.no":true,"vindafjord.no":true,"volda.no":true,"voss.no":true,"varoy.no":true,"xn--vry-yla5g.no":true,"vagan.no":true,"xn--vgan-qoa.no":true,"voagat.no":true,"vagsoy.no":true,"xn--vgsy-qoa0j.no":true,"vaga.no":true,"xn--vg-yiab.no":true,"valer.ostfold.no":true,"xn--vler-qoa.xn--stfold-9xa.no":true,"valer.hedmark.no":true,"xn--vler-qoa.hedmark.no":true,"*.np":true,"nr":true,"biz.nr":true,"info.nr":true,"gov.nr":true,"edu.nr":true,"org.nr":true,"net.nr":true,"com.nr":true,"nu":true,"nz":true,"ac.nz":true,"co.nz":true,"cri.nz":true,"geek.nz":true,"gen.nz":true,"govt.nz":true,"health.nz":true,"iwi.nz":true,"kiwi.nz":true,"maori.nz":true,"mil.nz":true,"xn--mori-qsa.nz":true,"net.nz":true,"org.nz":true,"parliament.nz":true,"school.nz":true,"om":true,"co.om":true,"com.om":true,"edu.om":true,"gov.om":true,"med.om":true,"museum.om":true,"net.om":true,"org.om":true,"pro.om":true,"org":true,"pa":true,"ac.pa":true,"gob.pa":true,"com.pa":true,"org.pa":true,"sld.pa":true,"edu.pa":true,"net.pa":true,"ing.pa":true,"abo.pa":true,"med.pa":true,"nom.pa":true,"pe":true,"edu.pe":true,"gob.pe":true,"nom.pe":true,"mil.pe":true,"org.pe":true,"com.pe":true,"net.pe":true,"pf":true,"com.pf":true,"org.pf":true,"edu.pf":true,"*.pg":true,"ph":true,"com.ph":true,"net.ph":true,"org.ph":true,"gov.ph":true,"edu.ph":true,"ngo.ph":true,"mil.ph":true,"i.ph":true,"pk":true,"com.pk":true,"net.pk":true,"edu.pk":true,"org.pk":true,"fam.pk":true,"biz.pk":true,"web.pk":true,"gov.pk":true,"gob.pk":true,"gok.pk":true,"gon.pk":true,"gop.pk":true,"gos.pk":true,"info.pk":true,"pl":true,"com.pl":true,"net.pl":true,"org.pl":true,"aid.pl":true,"agro.pl":true,"atm.pl":true,"auto.pl":true,"biz.pl":true,"edu.pl":true,"gmina.pl":true,"gsm.pl":true,"info.pl":true,"mail.pl":true,"miasta.pl":true,"media.pl":true,"mil.pl":true,"nieruchomosci.pl":true,"nom.pl":true,"pc.pl":true,"powiat.pl":true,"priv.pl":true,"realestate.pl":true,"rel.pl":true,"sex.pl":true,"shop.pl":true,"sklep.pl":true,"sos.pl":true,"szkola.pl":true,"targi.pl":true,"tm.pl":true,"tourism.pl":true,"travel.pl":true,"turystyka.pl":true,"gov.pl":true,"ap.gov.pl":true,"ic.gov.pl":true,"is.gov.pl":true,"us.gov.pl":true,"kmpsp.gov.pl":true,"kppsp.gov.pl":true,"kwpsp.gov.pl":true,"psp.gov.pl":true,"wskr.gov.pl":true,"kwp.gov.pl":true,"mw.gov.pl":true,"ug.gov.pl":true,"um.gov.pl":true,"umig.gov.pl":true,"ugim.gov.pl":true,"upow.gov.pl":true,"uw.gov.pl":true,"starostwo.gov.pl":true,"pa.gov.pl":true,"po.gov.pl":true,"psse.gov.pl":true,"pup.gov.pl":true,"rzgw.gov.pl":true,"sa.gov.pl":true,"so.gov.pl":true,"sr.gov.pl":true,"wsa.gov.pl":true,"sko.gov.pl":true,"uzs.gov.pl":true,"wiih.gov.pl":true,"winb.gov.pl":true,"pinb.gov.pl":true,"wios.gov.pl":true,"witd.gov.pl":true,"wzmiuw.gov.pl":true,"piw.gov.pl":true,"wiw.gov.pl":true,"griw.gov.pl":true,"wif.gov.pl":true,"oum.gov.pl":true,"sdn.gov.pl":true,"zp.gov.pl":true,"uppo.gov.pl":true,"mup.gov.pl":true,"wuoz.gov.pl":true,"konsulat.gov.pl":true,"oirm.gov.pl":true,"augustow.pl":true,"babia-gora.pl":true,"bedzin.pl":true,"beskidy.pl":true,"bialowieza.pl":true,"bialystok.pl":true,"bielawa.pl":true,"bieszczady.pl":true,"boleslawiec.pl":true,"bydgoszcz.pl":true,"bytom.pl":true,"cieszyn.pl":true,"czeladz.pl":true,"czest.pl":true,"dlugoleka.pl":true,"elblag.pl":true,"elk.pl":true,"glogow.pl":true,"gniezno.pl":true,"gorlice.pl":true,"grajewo.pl":true,"ilawa.pl":true,"jaworzno.pl":true,"jelenia-gora.pl":true,"jgora.pl":true,"kalisz.pl":true,"kazimierz-dolny.pl":true,"karpacz.pl":true,"kartuzy.pl":true,"kaszuby.pl":true,"katowice.pl":true,"kepno.pl":true,"ketrzyn.pl":true,"klodzko.pl":true,"kobierzyce.pl":true,"kolobrzeg.pl":true,"konin.pl":true,"konskowola.pl":true,"kutno.pl":true,"lapy.pl":true,"lebork.pl":true,"legnica.pl":true,"lezajsk.pl":true,"limanowa.pl":true,"lomza.pl":true,"lowicz.pl":true,"lubin.pl":true,"lukow.pl":true,"malbork.pl":true,"malopolska.pl":true,"mazowsze.pl":true,"mazury.pl":true,"mielec.pl":true,"mielno.pl":true,"mragowo.pl":true,"naklo.pl":true,"nowaruda.pl":true,"nysa.pl":true,"olawa.pl":true,"olecko.pl":true,"olkusz.pl":true,"olsztyn.pl":true,"opoczno.pl":true,"opole.pl":true,"ostroda.pl":true,"ostroleka.pl":true,"ostrowiec.pl":true,"ostrowwlkp.pl":true,"pila.pl":true,"pisz.pl":true,"podhale.pl":true,"podlasie.pl":true,"polkowice.pl":true,"pomorze.pl":true,"pomorskie.pl":true,"prochowice.pl":true,"pruszkow.pl":true,"przeworsk.pl":true,"pulawy.pl":true,"radom.pl":true,"rawa-maz.pl":true,"rybnik.pl":true,"rzeszow.pl":true,"sanok.pl":true,"sejny.pl":true,"slask.pl":true,"slupsk.pl":true,"sosnowiec.pl":true,"stalowa-wola.pl":true,"skoczow.pl":true,"starachowice.pl":true,"stargard.pl":true,"suwalki.pl":true,"swidnica.pl":true,"swiebodzin.pl":true,"swinoujscie.pl":true,"szczecin.pl":true,"szczytno.pl":true,"tarnobrzeg.pl":true,"tgory.pl":true,"turek.pl":true,"tychy.pl":true,"ustka.pl":true,"walbrzych.pl":true,"warmia.pl":true,"warszawa.pl":true,"waw.pl":true,"wegrow.pl":true,"wielun.pl":true,"wlocl.pl":true,"wloclawek.pl":true,"wodzislaw.pl":true,"wolomin.pl":true,"wroclaw.pl":true,"zachpomor.pl":true,"zagan.pl":true,"zarow.pl":true,"zgora.pl":true,"zgorzelec.pl":true,"pm":true,"pn":true,"gov.pn":true,"co.pn":true,"org.pn":true,"edu.pn":true,"net.pn":true,"post":true,"pr":true,"com.pr":true,"net.pr":true,"org.pr":true,"gov.pr":true,"edu.pr":true,"isla.pr":true,"pro.pr":true,"biz.pr":true,"info.pr":true,"name.pr":true,"est.pr":true,"prof.pr":true,"ac.pr":true,"pro":true,"aca.pro":true,"bar.pro":true,"cpa.pro":true,"jur.pro":true,"law.pro":true,"med.pro":true,"eng.pro":true,"ps":true,"edu.ps":true,"gov.ps":true,"sec.ps":true,"plo.ps":true,"com.ps":true,"org.ps":true,"net.ps":true,"pt":true,"net.pt":true,"gov.pt":true,"org.pt":true,"edu.pt":true,"int.pt":true,"publ.pt":true,"com.pt":true,"nome.pt":true,"pw":true,"co.pw":true,"ne.pw":true,"or.pw":true,"ed.pw":true,"go.pw":true,"belau.pw":true,"py":true,"com.py":true,"coop.py":true,"edu.py":true,"gov.py":true,"mil.py":true,"net.py":true,"org.py":true,"qa":true,"com.qa":true,"edu.qa":true,"gov.qa":true,"mil.qa":true,"name.qa":true,"net.qa":true,"org.qa":true,"sch.qa":true,"re":true,"com.re":true,"asso.re":true,"nom.re":true,"ro":true,"com.ro":true,"org.ro":true,"tm.ro":true,"nt.ro":true,"nom.ro":true,"info.ro":true,"rec.ro":true,"arts.ro":true,"firm.ro":true,"store.ro":true,"www.ro":true,"rs":true,"co.rs":true,"org.rs":true,"edu.rs":true,"ac.rs":true,"gov.rs":true,"in.rs":true,"ru":true,"ac.ru":true,"com.ru":true,"edu.ru":true,"int.ru":true,"net.ru":true,"org.ru":true,"pp.ru":true,"adygeya.ru":true,"altai.ru":true,"amur.ru":true,"arkhangelsk.ru":true,"astrakhan.ru":true,"bashkiria.ru":true,"belgorod.ru":true,"bir.ru":true,"bryansk.ru":true,"buryatia.ru":true,"cbg.ru":true,"chel.ru":true,"chelyabinsk.ru":true,"chita.ru":true,"chukotka.ru":true,"chuvashia.ru":true,"dagestan.ru":true,"dudinka.ru":true,"e-burg.ru":true,"grozny.ru":true,"irkutsk.ru":true,"ivanovo.ru":true,"izhevsk.ru":true,"jar.ru":true,"joshkar-ola.ru":true,"kalmykia.ru":true,"kaluga.ru":true,"kamchatka.ru":true,"karelia.ru":true,"kazan.ru":true,"kchr.ru":true,"kemerovo.ru":true,"khabarovsk.ru":true,"khakassia.ru":true,"khv.ru":true,"kirov.ru":true,"koenig.ru":true,"komi.ru":true,"kostroma.ru":true,"krasnoyarsk.ru":true,"kuban.ru":true,"kurgan.ru":true,"kursk.ru":true,"lipetsk.ru":true,"magadan.ru":true,"mari.ru":true,"mari-el.ru":true,"marine.ru":true,"mordovia.ru":true,"msk.ru":true,"murmansk.ru":true,"nalchik.ru":true,"nnov.ru":true,"nov.ru":true,"novosibirsk.ru":true,"nsk.ru":true,"omsk.ru":true,"orenburg.ru":true,"oryol.ru":true,"palana.ru":true,"penza.ru":true,"perm.ru":true,"ptz.ru":true,"rnd.ru":true,"ryazan.ru":true,"sakhalin.ru":true,"samara.ru":true,"saratov.ru":true,"simbirsk.ru":true,"smolensk.ru":true,"spb.ru":true,"stavropol.ru":true,"stv.ru":true,"surgut.ru":true,"tambov.ru":true,"tatarstan.ru":true,"tom.ru":true,"tomsk.ru":true,"tsaritsyn.ru":true,"tsk.ru":true,"tula.ru":true,"tuva.ru":true,"tver.ru":true,"tyumen.ru":true,"udm.ru":true,"udmurtia.ru":true,"ulan-ude.ru":true,"vladikavkaz.ru":true,"vladimir.ru":true,"vladivostok.ru":true,"volgograd.ru":true,"vologda.ru":true,"voronezh.ru":true,"vrn.ru":true,"vyatka.ru":true,"yakutia.ru":true,"yamal.ru":true,"yaroslavl.ru":true,"yekaterinburg.ru":true,"yuzhno-sakhalinsk.ru":true,"amursk.ru":true,"baikal.ru":true,"cmw.ru":true,"fareast.ru":true,"jamal.ru":true,"kms.ru":true,"k-uralsk.ru":true,"kustanai.ru":true,"kuzbass.ru":true,"magnitka.ru":true,"mytis.ru":true,"nakhodka.ru":true,"nkz.ru":true,"norilsk.ru":true,"oskol.ru":true,"pyatigorsk.ru":true,"rubtsovsk.ru":true,"snz.ru":true,"syzran.ru":true,"vdonsk.ru":true,"zgrad.ru":true,"gov.ru":true,"mil.ru":true,"test.ru":true,"rw":true,"gov.rw":true,"net.rw":true,"edu.rw":true,"ac.rw":true,"com.rw":true,"co.rw":true,"int.rw":true,"mil.rw":true,"gouv.rw":true,"sa":true,"com.sa":true,"net.sa":true,"org.sa":true,"gov.sa":true,"med.sa":true,"pub.sa":true,"edu.sa":true,"sch.sa":true,"sb":true,"com.sb":true,"edu.sb":true,"gov.sb":true,"net.sb":true,"org.sb":true,"sc":true,"com.sc":true,"gov.sc":true,"net.sc":true,"org.sc":true,"edu.sc":true,"sd":true,"com.sd":true,"net.sd":true,"org.sd":true,"edu.sd":true,"med.sd":true,"tv.sd":true,"gov.sd":true,"info.sd":true,"se":true,"a.se":true,"ac.se":true,"b.se":true,"bd.se":true,"brand.se":true,"c.se":true,"d.se":true,"e.se":true,"f.se":true,"fh.se":true,"fhsk.se":true,"fhv.se":true,"g.se":true,"h.se":true,"i.se":true,"k.se":true,"komforb.se":true,"kommunalforbund.se":true,"komvux.se":true,"l.se":true,"lanbib.se":true,"m.se":true,"n.se":true,"naturbruksgymn.se":true,"o.se":true,"org.se":true,"p.se":true,"parti.se":true,"pp.se":true,"press.se":true,"r.se":true,"s.se":true,"t.se":true,"tm.se":true,"u.se":true,"w.se":true,"x.se":true,"y.se":true,"z.se":true,"sg":true,"com.sg":true,"net.sg":true,"org.sg":true,"gov.sg":true,"edu.sg":true,"per.sg":true,"sh":true,"com.sh":true,"net.sh":true,"gov.sh":true,"org.sh":true,"mil.sh":true,"si":true,"sj":true,"sk":true,"sl":true,"com.sl":true,"net.sl":true,"edu.sl":true,"gov.sl":true,"org.sl":true,"sm":true,"sn":true,"art.sn":true,"com.sn":true,"edu.sn":true,"gouv.sn":true,"org.sn":true,"perso.sn":true,"univ.sn":true,"so":true,"com.so":true,"net.so":true,"org.so":true,"sr":true,"st":true,"co.st":true,"com.st":true,"consulado.st":true,"edu.st":true,"embaixada.st":true,"gov.st":true,"mil.st":true,"net.st":true,"org.st":true,"principe.st":true,"saotome.st":true,"store.st":true,"su":true,"adygeya.su":true,"arkhangelsk.su":true,"balashov.su":true,"bashkiria.su":true,"bryansk.su":true,"dagestan.su":true,"grozny.su":true,"ivanovo.su":true,"kalmykia.su":true,"kaluga.su":true,"karelia.su":true,"khakassia.su":true,"krasnodar.su":true,"kurgan.su":true,"lenug.su":true,"mordovia.su":true,"msk.su":true,"murmansk.su":true,"nalchik.su":true,"nov.su":true,"obninsk.su":true,"penza.su":true,"pokrovsk.su":true,"sochi.su":true,"spb.su":true,"togliatti.su":true,"troitsk.su":true,"tula.su":true,"tuva.su":true,"vladikavkaz.su":true,"vladimir.su":true,"vologda.su":true,"sv":true,"com.sv":true,"edu.sv":true,"gob.sv":true,"org.sv":true,"red.sv":true,"sx":true,"gov.sx":true,"sy":true,"edu.sy":true,"gov.sy":true,"net.sy":true,"mil.sy":true,"com.sy":true,"org.sy":true,"sz":true,"co.sz":true,"ac.sz":true,"org.sz":true,"tc":true,"td":true,"tel":true,"tf":true,"tg":true,"th":true,"ac.th":true,"co.th":true,"go.th":true,"in.th":true,"mi.th":true,"net.th":true,"or.th":true,"tj":true,"ac.tj":true,"biz.tj":true,"co.tj":true,"com.tj":true,"edu.tj":true,"go.tj":true,"gov.tj":true,"int.tj":true,"mil.tj":true,"name.tj":true,"net.tj":true,"nic.tj":true,"org.tj":true,"test.tj":true,"web.tj":true,"tk":true,"tl":true,"gov.tl":true,"tm":true,"com.tm":true,"co.tm":true,"org.tm":true,"net.tm":true,"nom.tm":true,"gov.tm":true,"mil.tm":true,"edu.tm":true,"tn":true,"com.tn":true,"ens.tn":true,"fin.tn":true,"gov.tn":true,"ind.tn":true,"intl.tn":true,"nat.tn":true,"net.tn":true,"org.tn":true,"info.tn":true,"perso.tn":true,"tourism.tn":true,"edunet.tn":true,"rnrt.tn":true,"rns.tn":true,"rnu.tn":true,"mincom.tn":true,"agrinet.tn":true,"defense.tn":true,"turen.tn":true,"to":true,"com.to":true,"gov.to":true,"net.to":true,"org.to":true,"edu.to":true,"mil.to":true,"tp":true,"tr":true,"com.tr":true,"info.tr":true,"biz.tr":true,"net.tr":true,"org.tr":true,"web.tr":true,"gen.tr":true,"tv.tr":true,"av.tr":true,"dr.tr":true,"bbs.tr":true,"name.tr":true,"tel.tr":true,"gov.tr":true,"bel.tr":true,"pol.tr":true,"mil.tr":true,"k12.tr":true,"edu.tr":true,"kep.tr":true,"nc.tr":true,"gov.nc.tr":true,"travel":true,"tt":true,"co.tt":true,"com.tt":true,"org.tt":true,"net.tt":true,"biz.tt":true,"info.tt":true,"pro.tt":true,"int.tt":true,"coop.tt":true,"jobs.tt":true,"mobi.tt":true,"travel.tt":true,"museum.tt":true,"aero.tt":true,"name.tt":true,"gov.tt":true,"edu.tt":true,"tv":true,"tw":true,"edu.tw":true,"gov.tw":true,"mil.tw":true,"com.tw":true,"net.tw":true,"org.tw":true,"idv.tw":true,"game.tw":true,"ebiz.tw":true,"club.tw":true,"xn--zf0ao64a.tw":true,"xn--uc0atv.tw":true,"xn--czrw28b.tw":true,"tz":true,"ac.tz":true,"co.tz":true,"go.tz":true,"hotel.tz":true,"info.tz":true,"me.tz":true,"mil.tz":true,"mobi.tz":true,"ne.tz":true,"or.tz":true,"sc.tz":true,"tv.tz":true,"ua":true,"com.ua":true,"edu.ua":true,"gov.ua":true,"in.ua":true,"net.ua":true,"org.ua":true,"cherkassy.ua":true,"cherkasy.ua":true,"chernigov.ua":true,"chernihiv.ua":true,"chernivtsi.ua":true,"chernovtsy.ua":true,"ck.ua":true,"cn.ua":true,"cr.ua":true,"crimea.ua":true,"cv.ua":true,"dn.ua":true,"dnepropetrovsk.ua":true,"dnipropetrovsk.ua":true,"dominic.ua":true,"donetsk.ua":true,"dp.ua":true,"if.ua":true,"ivano-frankivsk.ua":true,"kh.ua":true,"kharkiv.ua":true,"kharkov.ua":true,"kherson.ua":true,"khmelnitskiy.ua":true,"khmelnytskyi.ua":true,"kiev.ua":true,"kirovograd.ua":true,"km.ua":true,"kr.ua":true,"krym.ua":true,"ks.ua":true,"kv.ua":true,"kyiv.ua":true,"lg.ua":true,"lt.ua":true,"lugansk.ua":true,"lutsk.ua":true,"lv.ua":true,"lviv.ua":true,"mk.ua":true,"mykolaiv.ua":true,"nikolaev.ua":true,"od.ua":true,"odesa.ua":true,"odessa.ua":true,"pl.ua":true,"poltava.ua":true,"rivne.ua":true,"rovno.ua":true,"rv.ua":true,"sb.ua":true,"sebastopol.ua":true,"sevastopol.ua":true,"sm.ua":true,"sumy.ua":true,"te.ua":true,"ternopil.ua":true,"uz.ua":true,"uzhgorod.ua":true,"vinnica.ua":true,"vinnytsia.ua":true,"vn.ua":true,"volyn.ua":true,"yalta.ua":true,"zaporizhzhe.ua":true,"zaporizhzhia.ua":true,"zhitomir.ua":true,"zhytomyr.ua":true,"zp.ua":true,"zt.ua":true,"ug":true,"co.ug":true,"or.ug":true,"ac.ug":true,"sc.ug":true,"go.ug":true,"ne.ug":true,"com.ug":true,"org.ug":true,"uk":true,"ac.uk":true,"co.uk":true,"gov.uk":true,"ltd.uk":true,"me.uk":true,"net.uk":true,"nhs.uk":true,"org.uk":true,"plc.uk":true,"police.uk":true,"*.sch.uk":true,"us":true,"dni.us":true,"fed.us":true,"isa.us":true,"kids.us":true,"nsn.us":true,"ak.us":true,"al.us":true,"ar.us":true,"as.us":true,"az.us":true,"ca.us":true,"co.us":true,"ct.us":true,"dc.us":true,"de.us":true,"fl.us":true,"ga.us":true,"gu.us":true,"hi.us":true,"ia.us":true,"id.us":true,"il.us":true,"in.us":true,"ks.us":true,"ky.us":true,"la.us":true,"ma.us":true,"md.us":true,"me.us":true,"mi.us":true,"mn.us":true,"mo.us":true,"ms.us":true,"mt.us":true,"nc.us":true,"nd.us":true,"ne.us":true,"nh.us":true,"nj.us":true,"nm.us":true,"nv.us":true,"ny.us":true,"oh.us":true,"ok.us":true,"or.us":true,"pa.us":true,"pr.us":true,"ri.us":true,"sc.us":true,"sd.us":true,"tn.us":true,"tx.us":true,"ut.us":true,"vi.us":true,"vt.us":true,"va.us":true,"wa.us":true,"wi.us":true,"wv.us":true,"wy.us":true,"k12.ak.us":true,"k12.al.us":true,"k12.ar.us":true,"k12.as.us":true,"k12.az.us":true,"k12.ca.us":true,"k12.co.us":true,"k12.ct.us":true,"k12.dc.us":true,"k12.de.us":true,"k12.fl.us":true,"k12.ga.us":true,"k12.gu.us":true,"k12.ia.us":true,"k12.id.us":true,"k12.il.us":true,"k12.in.us":true,"k12.ks.us":true,"k12.ky.us":true,"k12.la.us":true,"k12.ma.us":true,"k12.md.us":true,"k12.me.us":true,"k12.mi.us":true,"k12.mn.us":true,"k12.mo.us":true,"k12.ms.us":true,"k12.mt.us":true,"k12.nc.us":true,"k12.ne.us":true,"k12.nh.us":true,"k12.nj.us":true,"k12.nm.us":true,"k12.nv.us":true,"k12.ny.us":true,"k12.oh.us":true,"k12.ok.us":true,"k12.or.us":true,"k12.pa.us":true,"k12.pr.us":true,"k12.ri.us":true,"k12.sc.us":true,"k12.tn.us":true,"k12.tx.us":true,"k12.ut.us":true,"k12.vi.us":true,"k12.vt.us":true,"k12.va.us":true,"k12.wa.us":true,"k12.wi.us":true,"k12.wy.us":true,"cc.ak.us":true,"cc.al.us":true,"cc.ar.us":true,"cc.as.us":true,"cc.az.us":true,"cc.ca.us":true,"cc.co.us":true,"cc.ct.us":true,"cc.dc.us":true,"cc.de.us":true,"cc.fl.us":true,"cc.ga.us":true,"cc.gu.us":true,"cc.hi.us":true,"cc.ia.us":true,"cc.id.us":true,"cc.il.us":true,"cc.in.us":true,"cc.ks.us":true,"cc.ky.us":true,"cc.la.us":true,"cc.ma.us":true,"cc.md.us":true,"cc.me.us":true,"cc.mi.us":true,"cc.mn.us":true,"cc.mo.us":true,"cc.ms.us":true,"cc.mt.us":true,"cc.nc.us":true,"cc.nd.us":true,"cc.ne.us":true,"cc.nh.us":true,"cc.nj.us":true,"cc.nm.us":true,"cc.nv.us":true,"cc.ny.us":true,"cc.oh.us":true,"cc.ok.us":true,"cc.or.us":true,"cc.pa.us":true,"cc.pr.us":true,"cc.ri.us":true,"cc.sc.us":true,"cc.sd.us":true,"cc.tn.us":true,"cc.tx.us":true,"cc.ut.us":true,"cc.vi.us":true,"cc.vt.us":true,"cc.va.us":true,"cc.wa.us":true,"cc.wi.us":true,"cc.wv.us":true,"cc.wy.us":true,"lib.ak.us":true,"lib.al.us":true,"lib.ar.us":true,"lib.as.us":true,"lib.az.us":true,"lib.ca.us":true,"lib.co.us":true,"lib.ct.us":true,"lib.dc.us":true,"lib.de.us":true,"lib.fl.us":true,"lib.ga.us":true,"lib.gu.us":true,"lib.hi.us":true,"lib.ia.us":true,"lib.id.us":true,"lib.il.us":true,"lib.in.us":true,"lib.ks.us":true,"lib.ky.us":true,"lib.la.us":true,"lib.ma.us":true,"lib.md.us":true,"lib.me.us":true,"lib.mi.us":true,"lib.mn.us":true,"lib.mo.us":true,"lib.ms.us":true,"lib.mt.us":true,"lib.nc.us":true,"lib.nd.us":true,"lib.ne.us":true,"lib.nh.us":true,"lib.nj.us":true,"lib.nm.us":true,"lib.nv.us":true,"lib.ny.us":true,"lib.oh.us":true,"lib.ok.us":true,"lib.or.us":true,"lib.pa.us":true,"lib.pr.us":true,"lib.ri.us":true,"lib.sc.us":true,"lib.sd.us":true,"lib.tn.us":true,"lib.tx.us":true,"lib.ut.us":true,"lib.vi.us":true,"lib.vt.us":true,"lib.va.us":true,"lib.wa.us":true,"lib.wi.us":true,"lib.wy.us":true,"pvt.k12.ma.us":true,"chtr.k12.ma.us":true,"paroch.k12.ma.us":true,"uy":true,"com.uy":true,"edu.uy":true,"gub.uy":true,"mil.uy":true,"net.uy":true,"org.uy":true,"uz":true,"co.uz":true,"com.uz":true,"net.uz":true,"org.uz":true,"va":true,"vc":true,"com.vc":true,"net.vc":true,"org.vc":true,"gov.vc":true,"mil.vc":true,"edu.vc":true,"ve":true,"arts.ve":true,"co.ve":true,"com.ve":true,"e12.ve":true,"edu.ve":true,"firm.ve":true,"gob.ve":true,"gov.ve":true,"info.ve":true,"int.ve":true,"mil.ve":true,"net.ve":true,"org.ve":true,"rec.ve":true,"store.ve":true,"tec.ve":true,"web.ve":true,"vg":true,"vi":true,"co.vi":true,"com.vi":true,"k12.vi":true,"net.vi":true,"org.vi":true,"vn":true,"com.vn":true,"net.vn":true,"org.vn":true,"edu.vn":true,"gov.vn":true,"int.vn":true,"ac.vn":true,"biz.vn":true,"info.vn":true,"name.vn":true,"pro.vn":true,"health.vn":true,"vu":true,"com.vu":true,"edu.vu":true,"net.vu":true,"org.vu":true,"wf":true,"ws":true,"com.ws":true,"net.ws":true,"org.ws":true,"gov.ws":true,"edu.ws":true,"yt":true,"xn--mgbaam7a8h":true,"xn--y9a3aq":true,"xn--54b7fta0cc":true,"xn--90ais":true,"xn--fiqs8s":true,"xn--fiqz9s":true,"xn--lgbbat1ad8j":true,"xn--wgbh1c":true,"xn--node":true,"xn--qxam":true,"xn--j6w193g":true,"xn--h2brj9c":true,"xn--mgbbh1a71e":true,"xn--fpcrj9c3d":true,"xn--gecrj9c":true,"xn--s9brj9c":true,"xn--45brj9c":true,"xn--xkc2dl3a5ee0h":true,"xn--mgba3a4f16a":true,"xn--mgba3a4fra":true,"xn--mgbtx2b":true,"xn--mgbayh7gpa":true,"xn--3e0b707e":true,"xn--80ao21a":true,"xn--fzc2c9e2c":true,"xn--xkc2al3hye2a":true,"xn--mgbc0a9azcg":true,"xn--d1alf":true,"xn--l1acc":true,"xn--mix891f":true,"xn--mix082f":true,"xn--mgbx4cd0ab":true,"xn--mgb9awbf":true,"xn--mgbai9azgqp6j":true,"xn--mgbai9a5eva00b":true,"xn--ygbi2ammx":true,"xn--90a3ac":true,"xn--o1ac.xn--90a3ac":true,"xn--c1avg.xn--90a3ac":true,"xn--90azh.xn--90a3ac":true,"xn--d1at.xn--90a3ac":true,"xn--o1ach.xn--90a3ac":true,"xn--80au.xn--90a3ac":true,"xn--p1ai":true,"xn--wgbl6a":true,"xn--mgberp4a5d4ar":true,"xn--mgberp4a5d4a87g":true,"xn--mgbqly7c0a67fbc":true,"xn--mgbqly7cvafr":true,"xn--mgbpl2fh":true,"xn--yfro4i67o":true,"xn--clchc0ea0b2g2a9gcd":true,"xn--ogbpf8fl":true,"xn--mgbtf8fl":true,"xn--o3cw4h":true,"xn--pgbs0dh":true,"xn--kpry57d":true,"xn--kprw13d":true,"xn--nnx388a":true,"xn--j1amh":true,"xn--mgb2ddes":true,"xxx":true,"*.ye":true,"ac.za":true,"agrica.za":true,"alt.za":true,"co.za":true,"edu.za":true,"gov.za":true,"grondar.za":true,"law.za":true,"mil.za":true,"net.za":true,"ngo.za":true,"nis.za":true,"nom.za":true,"org.za":true,"school.za":true,"tm.za":true,"web.za":true,"*.zm":true,"*.zw":true,"aaa":true,"aarp":true,"abarth":true,"abb":true,"abbott":true,"abbvie":true,"abc":true,"able":true,"abogado":true,"abudhabi":true,"academy":true,"accenture":true,"accountant":true,"accountants":true,"aco":true,"active":true,"actor":true,"adac":true,"ads":true,"adult":true,"aeg":true,"aetna":true,"afamilycompany":true,"afl":true,"africa":true,"africamagic":true,"agakhan":true,"agency":true,"aig":true,"aigo":true,"airbus":true,"airforce":true,"airtel":true,"akdn":true,"alfaromeo":true,"alibaba":true,"alipay":true,"allfinanz":true,"allstate":true,"ally":true,"alsace":true,"alstom":true,"americanexpress":true,"americanfamily":true,"amex":true,"amfam":true,"amica":true,"amsterdam":true,"analytics":true,"android":true,"anquan":true,"anz":true,"aol":true,"apartments":true,"app":true,"apple":true,"aquarelle":true,"aramco":true,"archi":true,"army":true,"arte":true,"asda":true,"associates":true,"athleta":true,"attorney":true,"auction":true,"audi":true,"audible":true,"audio":true,"auspost":true,"author":true,"auto":true,"autos":true,"avianca":true,"aws":true,"axa":true,"azure":true,"baby":true,"baidu":true,"banamex":true,"bananarepublic":true,"band":true,"bank":true,"bar":true,"barcelona":true,"barclaycard":true,"barclays":true,"barefoot":true,"bargains":true,"basketball":true,"bauhaus":true,"bayern":true,"bbc":true,"bbt":true,"bbva":true,"bcg":true,"bcn":true,"beats":true,"beer":true,"bentley":true,"berlin":true,"best":true,"bestbuy":true,"bet":true,"bharti":true,"bible":true,"bid":true,"bike":true,"bing":true,"bingo":true,"bio":true,"black":true,"blackfriday":true,"blanco":true,"blockbuster":true,"blog":true,"bloomberg":true,"blue":true,"bms":true,"bmw":true,"bnl":true,"bnpparibas":true,"boats":true,"boehringer":true,"bofa":true,"bom":true,"bond":true,"boo":true,"book":true,"booking":true,"boots":true,"bosch":true,"bostik":true,"bot":true,"boutique":true,"bradesco":true,"bridgestone":true,"broadway":true,"broker":true,"brother":true,"brussels":true,"budapest":true,"bugatti":true,"build":true,"builders":true,"business":true,"buy":true,"buzz":true,"bzh":true,"cab":true,"cafe":true,"cal":true,"call":true,"calvinklein":true,"camera":true,"camp":true,"cancerresearch":true,"canon":true,"capetown":true,"capital":true,"capitalone":true,"car":true,"caravan":true,"cards":true,"care":true,"career":true,"careers":true,"cars":true,"cartier":true,"casa":true,"case":true,"caseih":true,"cash":true,"casino":true,"catering":true,"cba":true,"cbn":true,"cbre":true,"cbs":true,"ceb":true,"center":true,"ceo":true,"cern":true,"cfa":true,"cfd":true,"chanel":true,"channel":true,"chase":true,"chat":true,"cheap":true,"chintai":true,"chloe":true,"christmas":true,"chrome":true,"chrysler":true,"church":true,"cipriani":true,"circle":true,"cisco":true,"citadel":true,"citi":true,"citic":true,"city":true,"cityeats":true,"claims":true,"cleaning":true,"click":true,"clinic":true,"clothing":true,"cloud":true,"club":true,"clubmed":true,"coach":true,"codes":true,"coffee":true,"college":true,"cologne":true,"comcast":true,"commbank":true,"community":true,"company":true,"computer":true,"comsec":true,"condos":true,"construction":true,"consulting":true,"contact":true,"contractors":true,"cooking":true,"cookingchannel":true,"cool":true,"corsica":true,"country":true,"coupon":true,"coupons":true,"courses":true,"credit":true,"creditcard":true,"creditunion":true,"cricket":true,"crown":true,"crs":true,"cruises":true,"csc":true,"cuisinella":true,"cymru":true,"cyou":true,"dabur":true,"dad":true,"dance":true,"date":true,"dating":true,"datsun":true,"day":true,"dclk":true,"dds":true,"deal":true,"dealer":true,"deals":true,"degree":true,"delivery":true,"dell":true,"deloitte":true,"delta":true,"democrat":true,"dental":true,"dentist":true,"desi":true,"design":true,"dev":true,"dhl":true,"diamonds":true,"diet":true,"digital":true,"direct":true,"directory":true,"discount":true,"discover":true,"dish":true,"dnp":true,"docs":true,"dodge":true,"dog":true,"doha":true,"domains":true,"doosan":true,"dot":true,"download":true,"drive":true,"dstv":true,"dtv":true,"dubai":true,"duck":true,"dunlop":true,"duns":true,"dupont":true,"durban":true,"dvag":true,"dwg":true,"earth":true,"eat":true,"edeka":true,"education":true,"email":true,"emerck":true,"emerson":true,"energy":true,"engineer":true,"engineering":true,"enterprises":true,"epost":true,"epson":true,"equipment":true,"ericsson":true,"erni":true,"esq":true,"estate":true,"esurance":true,"etisalat":true,"eurovision":true,"eus":true,"events":true,"everbank":true,"exchange":true,"expert":true,"exposed":true,"express":true,"extraspace":true,"fage":true,"fail":true,"fairwinds":true,"faith":true,"family":true,"fan":true,"fans":true,"farm":true,"farmers":true,"fashion":true,"fast":true,"fedex":true,"feedback":true,"ferrari":true,"ferrero":true,"fiat":true,"fidelity":true,"fido":true,"film":true,"final":true,"finance":true,"financial":true,"fire":true,"firestone":true,"firmdale":true,"fish":true,"fishing":true,"fit":true,"fitness":true,"flickr":true,"flights":true,"flir":true,"florist":true,"flowers":true,"flsmidth":true,"fly":true,"foo":true,"foodnetwork":true,"football":true,"ford":true,"forex":true,"forsale":true,"forum":true,"foundation":true,"fox":true,"fresenius":true,"frl":true,"frogans":true,"frontdoor":true,"frontier":true,"ftr":true,"fujitsu":true,"fujixerox":true,"fund":true,"furniture":true,"futbol":true,"fyi":true,"gal":true,"gallery":true,"gallo":true,"gallup":true,"game":true,"games":true,"gap":true,"garden":true,"gbiz":true,"gdn":true,"gea":true,"gent":true,"genting":true,"george":true,"ggee":true,"gift":true,"gifts":true,"gives":true,"giving":true,"glade":true,"glass":true,"gle":true,"global":true,"globo":true,"gmail":true,"gmo":true,"gmx":true,"godaddy":true,"gold":true,"goldpoint":true,"golf":true,"goo":true,"goodhands":true,"goodyear":true,"goog":true,"google":true,"gop":true,"got":true,"gotv":true,"grainger":true,"graphics":true,"gratis":true,"green":true,"gripe":true,"group":true,"guardian":true,"gucci":true,"guge":true,"guide":true,"guitars":true,"guru":true,"hamburg":true,"hangout":true,"haus":true,"hbo":true,"hdfc":true,"hdfcbank":true,"health":true,"healthcare":true,"help":true,"helsinki":true,"here":true,"hermes":true,"hgtv":true,"hiphop":true,"hisamitsu":true,"hitachi":true,"hiv":true,"hkt":true,"hockey":true,"holdings":true,"holiday":true,"homedepot":true,"homegoods":true,"homes":true,"homesense":true,"honda":true,"honeywell":true,"horse":true,"host":true,"hosting":true,"hot":true,"hoteles":true,"hotmail":true,"house":true,"how":true,"hsbc":true,"htc":true,"hughes":true,"hyatt":true,"hyundai":true,"ibm":true,"icbc":true,"ice":true,"icu":true,"ieee":true,"ifm":true,"iinet":true,"ikano":true,"imamat":true,"imdb":true,"immo":true,"immobilien":true,"industries":true,"infiniti":true,"ing":true,"ink":true,"institute":true,"insurance":true,"insure":true,"intel":true,"international":true,"intuit":true,"investments":true,"ipiranga":true,"irish":true,"iselect":true,"ismaili":true,"ist":true,"istanbul":true,"itau":true,"itv":true,"iveco":true,"iwc":true,"jaguar":true,"java":true,"jcb":true,"jcp":true,"jeep":true,"jetzt":true,"jewelry":true,"jio":true,"jlc":true,"jll":true,"jmp":true,"jnj":true,"joburg":true,"jot":true,"joy":true,"jpmorgan":true,"jprs":true,"juegos":true,"juniper":true,"kaufen":true,"kddi":true,"kerryhotels":true,"kerrylogistics":true,"kerryproperties":true,"kfh":true,"kia":true,"kim":true,"kinder":true,"kindle":true,"kitchen":true,"kiwi":true,"koeln":true,"komatsu":true,"kosher":true,"kpmg":true,"kpn":true,"krd":true,"kred":true,"kuokgroup":true,"kyknet":true,"kyoto":true,"lacaixa":true,"ladbrokes":true,"lamborghini":true,"lancaster":true,"lancia":true,"lancome":true,"land":true,"landrover":true,"lanxess":true,"lasalle":true,"lat":true,"latino":true,"latrobe":true,"law":true,"lawyer":true,"lds":true,"lease":true,"leclerc":true,"lefrak":true,"legal":true,"lego":true,"lexus":true,"lgbt":true,"liaison":true,"lidl":true,"life":true,"lifeinsurance":true,"lifestyle":true,"lighting":true,"like":true,"lilly":true,"limited":true,"limo":true,"lincoln":true,"linde":true,"link":true,"lipsy":true,"live":true,"living":true,"lixil":true,"loan":true,"loans":true,"locker":true,"locus":true,"loft":true,"lol":true,"london":true,"lotte":true,"lotto":true,"love":true,"lpl":true,"lplfinancial":true,"ltd":true,"ltda":true,"lundbeck":true,"lupin":true,"luxe":true,"luxury":true,"macys":true,"madrid":true,"maif":true,"maison":true,"makeup":true,"man":true,"management":true,"mango":true,"market":true,"marketing":true,"markets":true,"marriott":true,"marshalls":true,"maserati":true,"mattel":true,"mba":true,"mcd":true,"mcdonalds":true,"mckinsey":true,"med":true,"media":true,"meet":true,"melbourne":true,"meme":true,"memorial":true,"men":true,"menu":true,"meo":true,"metlife":true,"miami":true,"microsoft":true,"mini":true,"mint":true,"mit":true,"mitsubishi":true,"mlb":true,"mls":true,"mma":true,"mnet":true,"mobily":true,"moda":true,"moe":true,"moi":true,"mom":true,"monash":true,"money":true,"monster":true,"montblanc":true,"mopar":true,"mormon":true,"mortgage":true,"moscow":true,"moto":true,"motorcycles":true,"mov":true,"movie":true,"movistar":true,"msd":true,"mtn":true,"mtpc":true,"mtr":true,"multichoice":true,"mutual":true,"mutuelle":true,"mzansimagic":true,"nab":true,"nadex":true,"nagoya":true,"naspers":true,"nationwide":true,"natura":true,"navy":true,"nba":true,"nec":true,"netbank":true,"netflix":true,"network":true,"neustar":true,"new":true,"newholland":true,"news":true,"next":true,"nextdirect":true,"nexus":true,"nfl":true,"ngo":true,"nhk":true,"nico":true,"nike":true,"nikon":true,"ninja":true,"nissan":true,"nokia":true,"northwesternmutual":true,"norton":true,"now":true,"nowruz":true,"nowtv":true,"nra":true,"nrw":true,"ntt":true,"nyc":true,"obi":true,"observer":true,"off":true,"office":true,"okinawa":true,"olayan":true,"olayangroup":true,"oldnavy":true,"ollo":true,"omega":true,"one":true,"ong":true,"onl":true,"online":true,"onyourside":true,"ooo":true,"open":true,"oracle":true,"orange":true,"organic":true,"orientexpress":true,"osaka":true,"otsuka":true,"ott":true,"ovh":true,"page":true,"pamperedchef":true,"panasonic":true,"panerai":true,"paris":true,"pars":true,"partners":true,"parts":true,"party":true,"passagens":true,"pay":true,"payu":true,"pccw":true,"pet":true,"pfizer":true,"pharmacy":true,"philips":true,"photo":true,"photography":true,"photos":true,"physio":true,"piaget":true,"pics":true,"pictet":true,"pictures":true,"pid":true,"pin":true,"ping":true,"pink":true,"pioneer":true,"pizza":true,"place":true,"play":true,"playstation":true,"plumbing":true,"plus":true,"pnc":true,"pohl":true,"poker":true,"politie":true,"porn":true,"pramerica":true,"praxi":true,"press":true,"prime":true,"prod":true,"productions":true,"prof":true,"progressive":true,"promo":true,"properties":true,"property":true,"protection":true,"pru":true,"prudential":true,"pub":true,"qpon":true,"quebec":true,"quest":true,"qvc":true,"racing":true,"raid":true,"read":true,"realestate":true,"realtor":true,"realty":true,"recipes":true,"red":true,"redstone":true,"redumbrella":true,"rehab":true,"reise":true,"reisen":true,"reit":true,"reliance":true,"ren":true,"rent":true,"rentals":true,"repair":true,"report":true,"republican":true,"rest":true,"restaurant":true,"review":true,"reviews":true,"rexroth":true,"rich":true,"richardli":true,"ricoh":true,"rightathome":true,"ril":true,"rio":true,"rip":true,"rocher":true,"rocks":true,"rodeo":true,"rogers":true,"room":true,"rsvp":true,"ruhr":true,"run":true,"rwe":true,"ryukyu":true,"saarland":true,"safe":true,"safety":true,"sakura":true,"sale":true,"salon":true,"samsclub":true,"samsung":true,"sandvik":true,"sandvikcoromant":true,"sanofi":true,"sap":true,"sapo":true,"sarl":true,"sas":true,"save":true,"saxo":true,"sbi":true,"sbs":true,"sca":true,"scb":true,"schaeffler":true,"schmidt":true,"scholarships":true,"school":true,"schule":true,"schwarz":true,"science":true,"scjohnson":true,"scor":true,"scot":true,"seat":true,"secure":true,"security":true,"seek":true,"sener":true,"services":true,"ses":true,"seven":true,"sew":true,"sex":true,"sexy":true,"sfr":true,"shangrila":true,"sharp":true,"shaw":true,"shell":true,"shia":true,"shiksha":true,"shoes":true,"shouji":true,"show":true,"showtime":true,"shriram":true,"silk":true,"sina":true,"singles":true,"site":true,"ski":true,"skin":true,"sky":true,"skype":true,"sling":true,"smart":true,"smile":true,"sncf":true,"soccer":true,"social":true,"softbank":true,"software":true,"sohu":true,"solar":true,"solutions":true,"song":true,"sony":true,"soy":true,"space":true,"spiegel":true,"spot":true,"spreadbetting":true,"srl":true,"srt":true,"stada":true,"staples":true,"star":true,"starhub":true,"statebank":true,"statefarm":true,"statoil":true,"stc":true,"stcgroup":true,"stockholm":true,"storage":true,"store":true,"studio":true,"study":true,"style":true,"sucks":true,"supersport":true,"supplies":true,"supply":true,"support":true,"surf":true,"surgery":true,"suzuki":true,"swatch":true,"swiftcover":true,"swiss":true,"sydney":true,"symantec":true,"systems":true,"tab":true,"taipei":true,"talk":true,"taobao":true,"target":true,"tatamotors":true,"tatar":true,"tattoo":true,"tax":true,"taxi":true,"tci":true,"tdk":true,"team":true,"tech":true,"technology":true,"telecity":true,"telefonica":true,"temasek":true,"tennis":true,"teva":true,"thd":true,"theater":true,"theatre":true,"theguardian":true,"tiaa":true,"tickets":true,"tienda":true,"tiffany":true,"tips":true,"tires":true,"tirol":true,"tjmaxx":true,"tjx":true,"tkmaxx":true,"tmall":true,"today":true,"tokyo":true,"tools":true,"top":true,"toray":true,"toshiba":true,"total":true,"tours":true,"town":true,"toyota":true,"toys":true,"trade":true,"trading":true,"training":true,"travelchannel":true,"travelers":true,"travelersinsurance":true,"trust":true,"trv":true,"tube":true,"tui":true,"tunes":true,"tushu":true,"tvs":true,"ubank":true,"ubs":true,"uconnect":true,"university":true,"uno":true,"uol":true,"ups":true,"vacations":true,"vana":true,"vanguard":true,"vegas":true,"ventures":true,"verisign":true,"versicherung":true,"vet":true,"viajes":true,"video":true,"vig":true,"viking":true,"villas":true,"vin":true,"vip":true,"virgin":true,"visa":true,"vision":true,"vista":true,"vistaprint":true,"viva":true,"vivo":true,"vlaanderen":true,"vodka":true,"volkswagen":true,"vote":true,"voting":true,"voto":true,"voyage":true,"vuelos":true,"wales":true,"walmart":true,"walter":true,"wang":true,"wanggou":true,"warman":true,"watch":true,"watches":true,"weather":true,"weatherchannel":true,"webcam":true,"weber":true,"website":true,"wed":true,"wedding":true,"weibo":true,"weir":true,"whoswho":true,"wien":true,"wiki":true,"williamhill":true,"win":true,"windows":true,"wine":true,"winners":true,"wme":true,"wolterskluwer":true,"woodside":true,"work":true,"works":true,"world":true,"wtc":true,"wtf":true,"xbox":true,"xerox":true,"xfinity":true,"xihuan":true,"xin":true,"xn--11b4c3d":true,"xn--1ck2e1b":true,"xn--1qqw23a":true,"xn--30rr7y":true,"xn--3bst00m":true,"xn--3ds443g":true,"xn--3oq18vl8pn36a":true,"xn--3pxu8k":true,"xn--42c2d9a":true,"xn--45q11c":true,"xn--4gbrim":true,"xn--4gq48lf9j":true,"xn--55qw42g":true,"xn--55qx5d":true,"xn--5su34j936bgsg":true,"xn--5tzm5g":true,"xn--6frz82g":true,"xn--6qq986b3xl":true,"xn--80adxhks":true,"xn--80asehdb":true,"xn--80aswg":true,"xn--8y0a063a":true,"xn--9dbq2a":true,"xn--9et52u":true,"xn--9krt00a":true,"xn--b4w605ferd":true,"xn--bck1b9a5dre4c":true,"xn--c1avg":true,"xn--c2br7g":true,"xn--cck2b3b":true,"xn--cg4bki":true,"xn--czr694b":true,"xn--czrs0t":true,"xn--czru2d":true,"xn--d1acj3b":true,"xn--eckvdtc9d":true,"xn--efvy88h":true,"xn--estv75g":true,"xn--fct429k":true,"xn--fhbei":true,"xn--fiq228c5hs":true,"xn--fiq64b":true,"xn--fjq720a":true,"xn--flw351e":true,"xn--fzys8d69uvgm":true,"xn--g2xx48c":true,"xn--gckr3f0f":true,"xn--hxt814e":true,"xn--i1b6b1a6a2e":true,"xn--imr513n":true,"xn--io0a7i":true,"xn--j1aef":true,"xn--jlq61u9w7b":true,"xn--jvr189m":true,"xn--kcrx77d1x4a":true,"xn--kpu716f":true,"xn--kput3i":true,"xn--mgba3a3ejt":true,"xn--mgba7c0bbn0a":true,"xn--mgbaakc7dvf":true,"xn--mgbab2bd":true,"xn--mgbb9fbpob":true,"xn--mgbca7dzdo":true,"xn--mgbt3dhd":true,"xn--mk1bu44c":true,"xn--mxtq1m":true,"xn--ngbc5azd":true,"xn--ngbe9e0a":true,"xn--nqv7f":true,"xn--nqv7fs00ema":true,"xn--nyqy26a":true,"xn--p1acf":true,"xn--pbt977c":true,"xn--pssy2u":true,"xn--q9jyb4c":true,"xn--qcka1pmc":true,"xn--rhqv96g":true,"xn--rovu88b":true,"xn--ses554g":true,"xn--t60b56a":true,"xn--tckwe":true,"xn--unup4y":true,"xn--vermgensberater-ctb":true,"xn--vermgensberatung-pwb":true,"xn--vhquv":true,"xn--vuq861b":true,"xn--w4r85el8fhu5dnra":true,"xn--w4rs40l":true,"xn--xhq521b":true,"xn--zfr164b":true,"xperia":true,"xyz":true,"yachts":true,"yahoo":true,"yamaxun":true,"yandex":true,"yodobashi":true,"yoga":true,"yokohama":true,"you":true,"youtube":true,"yun":true,"zappos":true,"zara":true,"zero":true,"zip":true,"zippo":true,"zone":true,"zuerich":true,"cloudfront.net":true,"ap-northeast-1.compute.amazonaws.com":true,"ap-southeast-1.compute.amazonaws.com":true,"ap-southeast-2.compute.amazonaws.com":true,"cn-north-1.compute.amazonaws.cn":true,"compute.amazonaws.cn":true,"compute.amazonaws.com":true,"compute-1.amazonaws.com":true,"eu-west-1.compute.amazonaws.com":true,"eu-central-1.compute.amazonaws.com":true,"sa-east-1.compute.amazonaws.com":true,"us-east-1.amazonaws.com":true,"us-gov-west-1.compute.amazonaws.com":true,"us-west-1.compute.amazonaws.com":true,"us-west-2.compute.amazonaws.com":true,"z-1.compute-1.amazonaws.com":true,"z-2.compute-1.amazonaws.com":true,"elasticbeanstalk.com":true,"elb.amazonaws.com":true,"s3.amazonaws.com":true,"s3-ap-northeast-1.amazonaws.com":true,"s3-ap-southeast-1.amazonaws.com":true,"s3-ap-southeast-2.amazonaws.com":true,"s3-external-1.amazonaws.com":true,"s3-external-2.amazonaws.com":true,"s3-fips-us-gov-west-1.amazonaws.com":true,"s3-eu-central-1.amazonaws.com":true,"s3-eu-west-1.amazonaws.com":true,"s3-sa-east-1.amazonaws.com":true,"s3-us-gov-west-1.amazonaws.com":true,"s3-us-west-1.amazonaws.com":true,"s3-us-west-2.amazonaws.com":true,"s3.cn-north-1.amazonaws.com.cn":true,"s3.eu-central-1.amazonaws.com":true,"betainabox.com":true,"ae.org":true,"ar.com":true,"br.com":true,"cn.com":true,"com.de":true,"com.se":true,"de.com":true,"eu.com":true,"gb.com":true,"gb.net":true,"hu.com":true,"hu.net":true,"jp.net":true,"jpn.com":true,"kr.com":true,"mex.com":true,"no.com":true,"qc.com":true,"ru.com":true,"sa.com":true,"se.com":true,"se.net":true,"uk.com":true,"uk.net":true,"us.com":true,"uy.com":true,"za.bz":true,"za.com":true,"africa.com":true,"gr.com":true,"in.net":true,"us.org":true,"co.com":true,"c.la":true,"cloudcontrolled.com":true,"cloudcontrolapp.com":true,"co.ca":true,"c.cdn77.org":true,"cdn77-ssl.net":true,"r.cdn77.net":true,"rsc.cdn77.org":true,"ssl.origin.cdn77-secure.org":true,"co.nl":true,"co.no":true,"*.platform.sh":true,"cupcake.is":true,"dreamhosters.com":true,"duckdns.org":true,"dyndns-at-home.com":true,"dyndns-at-work.com":true,"dyndns-blog.com":true,"dyndns-free.com":true,"dyndns-home.com":true,"dyndns-ip.com":true,"dyndns-mail.com":true,"dyndns-office.com":true,"dyndns-pics.com":true,"dyndns-remote.com":true,"dyndns-server.com":true,"dyndns-web.com":true,"dyndns-wiki.com":true,"dyndns-work.com":true,"dyndns.biz":true,"dyndns.info":true,"dyndns.org":true,"dyndns.tv":true,"at-band-camp.net":true,"ath.cx":true,"barrel-of-knowledge.info":true,"barrell-of-knowledge.info":true,"better-than.tv":true,"blogdns.com":true,"blogdns.net":true,"blogdns.org":true,"blogsite.org":true,"boldlygoingnowhere.org":true,"broke-it.net":true,"buyshouses.net":true,"cechire.com":true,"dnsalias.com":true,"dnsalias.net":true,"dnsalias.org":true,"dnsdojo.com":true,"dnsdojo.net":true,"dnsdojo.org":true,"does-it.net":true,"doesntexist.com":true,"doesntexist.org":true,"dontexist.com":true,"dontexist.net":true,"dontexist.org":true,"doomdns.com":true,"doomdns.org":true,"dvrdns.org":true,"dyn-o-saur.com":true,"dynalias.com":true,"dynalias.net":true,"dynalias.org":true,"dynathome.net":true,"dyndns.ws":true,"endofinternet.net":true,"endofinternet.org":true,"endoftheinternet.org":true,"est-a-la-maison.com":true,"est-a-la-masion.com":true,"est-le-patron.com":true,"est-mon-blogueur.com":true,"for-better.biz":true,"for-more.biz":true,"for-our.info":true,"for-some.biz":true,"for-the.biz":true,"forgot.her.name":true,"forgot.his.name":true,"from-ak.com":true,"from-al.com":true,"from-ar.com":true,"from-az.net":true,"from-ca.com":true,"from-co.net":true,"from-ct.com":true,"from-dc.com":true,"from-de.com":true,"from-fl.com":true,"from-ga.com":true,"from-hi.com":true,"from-ia.com":true,"from-id.com":true,"from-il.com":true,"from-in.com":true,"from-ks.com":true,"from-ky.com":true,"from-la.net":true,"from-ma.com":true,"from-md.com":true,"from-me.org":true,"from-mi.com":true,"from-mn.com":true,"from-mo.com":true,"from-ms.com":true,"from-mt.com":true,"from-nc.com":true,"from-nd.com":true,"from-ne.com":true,"from-nh.com":true,"from-nj.com":true,"from-nm.com":true,"from-nv.com":true,"from-ny.net":true,"from-oh.com":true,"from-ok.com":true,"from-or.com":true,"from-pa.com":true,"from-pr.com":true,"from-ri.com":true,"from-sc.com":true,"from-sd.com":true,"from-tn.com":true,"from-tx.com":true,"from-ut.com":true,"from-va.com":true,"from-vt.com":true,"from-wa.com":true,"from-wi.com":true,"from-wv.com":true,"from-wy.com":true,"ftpaccess.cc":true,"fuettertdasnetz.de":true,"game-host.org":true,"game-server.cc":true,"getmyip.com":true,"gets-it.net":true,"go.dyndns.org":true,"gotdns.com":true,"gotdns.org":true,"groks-the.info":true,"groks-this.info":true,"ham-radio-op.net":true,"here-for-more.info":true,"hobby-site.com":true,"hobby-site.org":true,"home.dyndns.org":true,"homedns.org":true,"homeftp.net":true,"homeftp.org":true,"homeip.net":true,"homelinux.com":true,"homelinux.net":true,"homelinux.org":true,"homeunix.com":true,"homeunix.net":true,"homeunix.org":true,"iamallama.com":true,"in-the-band.net":true,"is-a-anarchist.com":true,"is-a-blogger.com":true,"is-a-bookkeeper.com":true,"is-a-bruinsfan.org":true,"is-a-bulls-fan.com":true,"is-a-candidate.org":true,"is-a-caterer.com":true,"is-a-celticsfan.org":true,"is-a-chef.com":true,"is-a-chef.net":true,"is-a-chef.org":true,"is-a-conservative.com":true,"is-a-cpa.com":true,"is-a-cubicle-slave.com":true,"is-a-democrat.com":true,"is-a-designer.com":true,"is-a-doctor.com":true,"is-a-financialadvisor.com":true,"is-a-geek.com":true,"is-a-geek.net":true,"is-a-geek.org":true,"is-a-green.com":true,"is-a-guru.com":true,"is-a-hard-worker.com":true,"is-a-hunter.com":true,"is-a-knight.org":true,"is-a-landscaper.com":true,"is-a-lawyer.com":true,"is-a-liberal.com":true,"is-a-libertarian.com":true,"is-a-linux-user.org":true,"is-a-llama.com":true,"is-a-musician.com":true,"is-a-nascarfan.com":true,"is-a-nurse.com":true,"is-a-painter.com":true,"is-a-patsfan.org":true,"is-a-personaltrainer.com":true,"is-a-photographer.com":true,"is-a-player.com":true,"is-a-republican.com":true,"is-a-rockstar.com":true,"is-a-socialist.com":true,"is-a-soxfan.org":true,"is-a-student.com":true,"is-a-teacher.com":true,"is-a-techie.com":true,"is-a-therapist.com":true,"is-an-accountant.com":true,"is-an-actor.com":true,"is-an-actress.com":true,"is-an-anarchist.com":true,"is-an-artist.com":true,"is-an-engineer.com":true,"is-an-entertainer.com":true,"is-by.us":true,"is-certified.com":true,"is-found.org":true,"is-gone.com":true,"is-into-anime.com":true,"is-into-cars.com":true,"is-into-cartoons.com":true,"is-into-games.com":true,"is-leet.com":true,"is-lost.org":true,"is-not-certified.com":true,"is-saved.org":true,"is-slick.com":true,"is-uberleet.com":true,"is-very-bad.org":true,"is-very-evil.org":true,"is-very-good.org":true,"is-very-nice.org":true,"is-very-sweet.org":true,"is-with-theband.com":true,"isa-geek.com":true,"isa-geek.net":true,"isa-geek.org":true,"isa-hockeynut.com":true,"issmarterthanyou.com":true,"isteingeek.de":true,"istmein.de":true,"kicks-ass.net":true,"kicks-ass.org":true,"knowsitall.info":true,"land-4-sale.us":true,"lebtimnetz.de":true,"leitungsen.de":true,"likes-pie.com":true,"likescandy.com":true,"merseine.nu":true,"mine.nu":true,"misconfused.org":true,"mypets.ws":true,"myphotos.cc":true,"neat-url.com":true,"office-on-the.net":true,"on-the-web.tv":true,"podzone.net":true,"podzone.org":true,"readmyblog.org":true,"saves-the-whales.com":true,"scrapper-site.net":true,"scrapping.cc":true,"selfip.biz":true,"selfip.com":true,"selfip.info":true,"selfip.net":true,"selfip.org":true,"sells-for-less.com":true,"sells-for-u.com":true,"sells-it.net":true,"sellsyourhome.org":true,"servebbs.com":true,"servebbs.net":true,"servebbs.org":true,"serveftp.net":true,"serveftp.org":true,"servegame.org":true,"shacknet.nu":true,"simple-url.com":true,"space-to-rent.com":true,"stuff-4-sale.org":true,"stuff-4-sale.us":true,"teaches-yoga.com":true,"thruhere.net":true,"traeumtgerade.de":true,"webhop.biz":true,"webhop.info":true,"webhop.net":true,"webhop.org":true,"worse-than.tv":true,"writesthisblog.com":true,"eu.org":true,"al.eu.org":true,"asso.eu.org":true,"at.eu.org":true,"au.eu.org":true,"be.eu.org":true,"bg.eu.org":true,"ca.eu.org":true,"cd.eu.org":true,"ch.eu.org":true,"cn.eu.org":true,"cy.eu.org":true,"cz.eu.org":true,"de.eu.org":true,"dk.eu.org":true,"edu.eu.org":true,"ee.eu.org":true,"es.eu.org":true,"fi.eu.org":true,"fr.eu.org":true,"gr.eu.org":true,"hr.eu.org":true,"hu.eu.org":true,"ie.eu.org":true,"il.eu.org":true,"in.eu.org":true,"int.eu.org":true,"is.eu.org":true,"it.eu.org":true,"jp.eu.org":true,"kr.eu.org":true,"lt.eu.org":true,"lu.eu.org":true,"lv.eu.org":true,"mc.eu.org":true,"me.eu.org":true,"mk.eu.org":true,"mt.eu.org":true,"my.eu.org":true,"net.eu.org":true,"ng.eu.org":true,"nl.eu.org":true,"no.eu.org":true,"nz.eu.org":true,"paris.eu.org":true,"pl.eu.org":true,"pt.eu.org":true,"q-a.eu.org":true,"ro.eu.org":true,"ru.eu.org":true,"se.eu.org":true,"si.eu.org":true,"sk.eu.org":true,"tr.eu.org":true,"uk.eu.org":true,"us.eu.org":true,"a.ssl.fastly.net":true,"b.ssl.fastly.net":true,"global.ssl.fastly.net":true,"a.prod.fastly.net":true,"global.prod.fastly.net":true,"firebaseapp.com":true,"flynnhub.com":true,"service.gov.uk":true,"github.io":true,"githubusercontent.com":true,"ro.com":true,"appspot.com":true,"blogspot.ae":true,"blogspot.al":true,"blogspot.am":true,"blogspot.ba":true,"blogspot.be":true,"blogspot.bg":true,"blogspot.bj":true,"blogspot.ca":true,"blogspot.cf":true,"blogspot.ch":true,"blogspot.cl":true,"blogspot.co.at":true,"blogspot.co.id":true,"blogspot.co.il":true,"blogspot.co.ke":true,"blogspot.co.nz":true,"blogspot.co.uk":true,"blogspot.co.za":true,"blogspot.com":true,"blogspot.com.ar":true,"blogspot.com.au":true,"blogspot.com.br":true,"blogspot.com.by":true,"blogspot.com.co":true,"blogspot.com.cy":true,"blogspot.com.ee":true,"blogspot.com.eg":true,"blogspot.com.es":true,"blogspot.com.mt":true,"blogspot.com.ng":true,"blogspot.com.tr":true,"blogspot.com.uy":true,"blogspot.cv":true,"blogspot.cz":true,"blogspot.de":true,"blogspot.dk":true,"blogspot.fi":true,"blogspot.fr":true,"blogspot.gr":true,"blogspot.hk":true,"blogspot.hr":true,"blogspot.hu":true,"blogspot.ie":true,"blogspot.in":true,"blogspot.is":true,"blogspot.it":true,"blogspot.jp":true,"blogspot.kr":true,"blogspot.li":true,"blogspot.lt":true,"blogspot.lu":true,"blogspot.md":true,"blogspot.mk":true,"blogspot.mr":true,"blogspot.mx":true,"blogspot.my":true,"blogspot.nl":true,"blogspot.no":true,"blogspot.pe":true,"blogspot.pt":true,"blogspot.qa":true,"blogspot.re":true,"blogspot.ro":true,"blogspot.rs":true,"blogspot.ru":true,"blogspot.se":true,"blogspot.sg":true,"blogspot.si":true,"blogspot.sk":true,"blogspot.sn":true,"blogspot.td":true,"blogspot.tw":true,"blogspot.ug":true,"blogspot.vn":true,"codespot.com":true,"googleapis.com":true,"googlecode.com":true,"pagespeedmobilizer.com":true,"withgoogle.com":true,"withyoutube.com":true,"herokuapp.com":true,"herokussl.com":true,"iki.fi":true,"biz.at":true,"info.at":true,"co.pl":true,"azurewebsites.net":true,"azure-mobile.net":true,"cloudapp.net":true,"bmoattachments.org":true,"4u.com":true,"nfshost.com":true,"nyc.mn":true,"nid.io":true,"operaunite.com":true,"outsystemscloud.com":true,"art.pl":true,"gliwice.pl":true,"krakow.pl":true,"poznan.pl":true,"wroc.pl":true,"zakopane.pl":true,"pantheon.io":true,"gotpantheon.com":true,"priv.at":true,"qa2.com":true,"rhcloud.com":true,"sandcats.io":true,"biz.ua":true,"co.ua":true,"pp.ua":true,"sinaapp.com":true,"vipsinaapp.com":true,"1kapp.com":true,"gda.pl":true,"gdansk.pl":true,"gdynia.pl":true,"med.pl":true,"sopot.pl":true,"hk.com":true,"hk.org":true,"ltd.hk":true,"inc.hk":true,"yolasite.com":true,"za.net":true,"za.org":true});
+
+// END of automatically generated file
diff --git a/node_modules/request/node_modules/tough-cookie/lib/store.js b/node_modules/request/node_modules/tough-cookie/lib/store.js
new file mode 100644
index 000000000..bce52925d
--- /dev/null
+++ b/node_modules/request/node_modules/tough-cookie/lib/store.js
@@ -0,0 +1,71 @@
+/*!
+ * Copyright (c) 2015, Salesforce.com, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of Salesforce.com nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+'use strict';
+/*jshint unused:false */
+
+function Store() {
+}
+exports.Store = Store;
+
+// Stores may be synchronous, but are still required to use a
+// Continuation-Passing Style API. The CookieJar itself will expose a "*Sync"
+// API that converts from synchronous-callbacks to imperative style.
+Store.prototype.synchronous = false;
+
+Store.prototype.findCookie = function(domain, path, key, cb) {
+ throw new Error('findCookie is not implemented');
+};
+
+Store.prototype.findCookies = function(domain, path, cb) {
+ throw new Error('findCookies is not implemented');
+};
+
+Store.prototype.putCookie = function(cookie, cb) {
+ throw new Error('putCookie is not implemented');
+};
+
+Store.prototype.updateCookie = function(oldCookie, newCookie, cb) {
+ // recommended default implementation:
+ // return this.putCookie(newCookie, cb);
+ throw new Error('updateCookie is not implemented');
+};
+
+Store.prototype.removeCookie = function(domain, path, key, cb) {
+ throw new Error('removeCookie is not implemented');
+};
+
+Store.prototype.removeCookies = function(domain, path, cb) {
+ throw new Error('removeCookies is not implemented');
+};
+
+Store.prototype.getAllCookies = function(cb) {
+ throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)');
+};
diff --git a/node_modules/request/node_modules/tough-cookie/package.json b/node_modules/request/node_modules/tough-cookie/package.json
new file mode 100644
index 000000000..4a6920dd5
--- /dev/null
+++ b/node_modules/request/node_modules/tough-cookie/package.json
@@ -0,0 +1,90 @@
+{
+ "author": {
+ "name": "Jeremy Stashewsky",
+ "email": "jstashewsky@salesforce.com"
+ },
+ "contributors": [
+ {
+ "name": "Alexander Savin"
+ },
+ {
+ "name": "Ian Livingstone"
+ },
+ {
+ "name": "Ivan Nikulin"
+ },
+ {
+ "name": "Lalit Kapoor"
+ },
+ {
+ "name": "Sam Thompson"
+ },
+ {
+ "name": "Sebastian Mayr"
+ }
+ ],
+ "license": "BSD-3-Clause",
+ "name": "tough-cookie",
+ "description": "RFC6265 Cookies and Cookie Jar for node.js",
+ "keywords": [
+ "HTTP",
+ "cookie",
+ "cookies",
+ "set-cookie",
+ "cookiejar",
+ "jar",
+ "RFC6265",
+ "RFC2965"
+ ],
+ "version": "2.2.0",
+ "homepage": "https://github.com/SalesforceEng/tough-cookie",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/SalesforceEng/tough-cookie.git"
+ },
+ "bugs": {
+ "url": "https://github.com/SalesforceEng/tough-cookie/issues"
+ },
+ "main": "./lib/cookie",
+ "files": [
+ "lib"
+ ],
+ "scripts": {
+ "suffixup": "curl -o public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat && ./generate-pubsuffix.js",
+ "test": "vows test/*_test.js"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "devDependencies": {
+ "async": "^1.4.2",
+ "vows": "^0.8.1"
+ },
+ "gitHead": "fb1456177c9b51445afa34656eb314c70c2adcd2",
+ "_id": "tough-cookie@2.2.0",
+ "_shasum": "d4ce661075e5fddb7f20341d3f9931a6fbbadde0",
+ "_from": "tough-cookie@>=2.2.0 <2.3.0",
+ "_npmVersion": "2.11.2",
+ "_nodeVersion": "0.12.5",
+ "_npmUser": {
+ "name": "jstash",
+ "email": "jstash@gmail.com"
+ },
+ "dist": {
+ "shasum": "d4ce661075e5fddb7f20341d3f9931a6fbbadde0",
+ "tarball": "http://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.0.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "jstash",
+ "email": "jeremy@goinstant.com"
+ },
+ {
+ "name": "goinstant",
+ "email": "services@goinstant.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/request/node_modules/tunnel-agent/LICENSE b/node_modules/request/node_modules/tunnel-agent/LICENSE
new file mode 100644
index 000000000..a4a9aee0c
--- /dev/null
+++ b/node_modules/request/node_modules/tunnel-agent/LICENSE
@@ -0,0 +1,55 @@
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS \ No newline at end of file
diff --git a/node_modules/request/node_modules/tunnel-agent/README.md b/node_modules/request/node_modules/tunnel-agent/README.md
new file mode 100644
index 000000000..bb533d56b
--- /dev/null
+++ b/node_modules/request/node_modules/tunnel-agent/README.md
@@ -0,0 +1,4 @@
+tunnel-agent
+============
+
+HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.
diff --git a/node_modules/request/node_modules/tunnel-agent/index.js b/node_modules/request/node_modules/tunnel-agent/index.js
new file mode 100644
index 000000000..da516ec43
--- /dev/null
+++ b/node_modules/request/node_modules/tunnel-agent/index.js
@@ -0,0 +1,241 @@
+'use strict'
+
+var net = require('net')
+ , tls = require('tls')
+ , http = require('http')
+ , https = require('https')
+ , events = require('events')
+ , assert = require('assert')
+ , util = require('util')
+ ;
+
+exports.httpOverHttp = httpOverHttp
+exports.httpsOverHttp = httpsOverHttp
+exports.httpOverHttps = httpOverHttps
+exports.httpsOverHttps = httpsOverHttps
+
+
+function httpOverHttp(options) {
+ var agent = new TunnelingAgent(options)
+ agent.request = http.request
+ return agent
+}
+
+function httpsOverHttp(options) {
+ var agent = new TunnelingAgent(options)
+ agent.request = http.request
+ agent.createSocket = createSecureSocket
+ return agent
+}
+
+function httpOverHttps(options) {
+ var agent = new TunnelingAgent(options)
+ agent.request = https.request
+ return agent
+}
+
+function httpsOverHttps(options) {
+ var agent = new TunnelingAgent(options)
+ agent.request = https.request
+ agent.createSocket = createSecureSocket
+ return agent
+}
+
+
+function TunnelingAgent(options) {
+ var self = this
+ self.options = options || {}
+ self.proxyOptions = self.options.proxy || {}
+ self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets
+ self.requests = []
+ self.sockets = []
+
+ self.on('free', function onFree(socket, host, port) {
+ for (var i = 0, len = self.requests.length; i < len; ++i) {
+ var pending = self.requests[i]
+ if (pending.host === host && pending.port === port) {
+ // Detect the request to connect same origin server,
+ // reuse the connection.
+ self.requests.splice(i, 1)
+ pending.request.onSocket(socket)
+ return
+ }
+ }
+ socket.destroy()
+ self.removeSocket(socket)
+ })
+}
+util.inherits(TunnelingAgent, events.EventEmitter)
+
+TunnelingAgent.prototype.addRequest = function addRequest(req, options) {
+ var self = this
+
+ // Legacy API: addRequest(req, host, port, path)
+ if (typeof options === 'string') {
+ options = {
+ host: options,
+ port: arguments[2],
+ path: arguments[3]
+ };
+ }
+
+ if (self.sockets.length >= this.maxSockets) {
+ // We are over limit so we'll add it to the queue.
+ self.requests.push({host: options.host, port: options.port, request: req})
+ return
+ }
+
+ // If we are under maxSockets create a new one.
+ self.createConnection({host: options.host, port: options.port, request: req})
+}
+
+TunnelingAgent.prototype.createConnection = function createConnection(pending) {
+ var self = this
+
+ self.createSocket(pending, function(socket) {
+ socket.on('free', onFree)
+ socket.on('close', onCloseOrRemove)
+ socket.on('agentRemove', onCloseOrRemove)
+ pending.request.onSocket(socket)
+
+ function onFree() {
+ self.emit('free', socket, pending.host, pending.port)
+ }
+
+ function onCloseOrRemove(err) {
+ self.removeSocket(socket)
+ socket.removeListener('free', onFree)
+ socket.removeListener('close', onCloseOrRemove)
+ socket.removeListener('agentRemove', onCloseOrRemove)
+ }
+ })
+}
+
+TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
+ var self = this
+ var placeholder = {}
+ self.sockets.push(placeholder)
+
+ var connectOptions = mergeOptions({}, self.proxyOptions,
+ { method: 'CONNECT'
+ , path: options.host + ':' + options.port
+ , agent: false
+ }
+ )
+ if (connectOptions.proxyAuth) {
+ connectOptions.headers = connectOptions.headers || {}
+ connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
+ new Buffer(connectOptions.proxyAuth).toString('base64')
+ }
+
+ debug('making CONNECT request')
+ var connectReq = self.request(connectOptions)
+ connectReq.useChunkedEncodingByDefault = false // for v0.6
+ connectReq.once('response', onResponse) // for v0.6
+ connectReq.once('upgrade', onUpgrade) // for v0.6
+ connectReq.once('connect', onConnect) // for v0.7 or later
+ connectReq.once('error', onError)
+ connectReq.end()
+
+ function onResponse(res) {
+ // Very hacky. This is necessary to avoid http-parser leaks.
+ res.upgrade = true
+ }
+
+ function onUpgrade(res, socket, head) {
+ // Hacky.
+ process.nextTick(function() {
+ onConnect(res, socket, head)
+ })
+ }
+
+ function onConnect(res, socket, head) {
+ connectReq.removeAllListeners()
+ socket.removeAllListeners()
+
+ if (res.statusCode === 200) {
+ assert.equal(head.length, 0)
+ debug('tunneling connection has established')
+ self.sockets[self.sockets.indexOf(placeholder)] = socket
+ cb(socket)
+ } else {
+ debug('tunneling socket could not be established, statusCode=%d', res.statusCode)
+ var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode)
+ error.code = 'ECONNRESET'
+ options.request.emit('error', error)
+ self.removeSocket(placeholder)
+ }
+ }
+
+ function onError(cause) {
+ connectReq.removeAllListeners()
+
+ debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack)
+ var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message)
+ error.code = 'ECONNRESET'
+ options.request.emit('error', error)
+ self.removeSocket(placeholder)
+ }
+}
+
+TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
+ var pos = this.sockets.indexOf(socket)
+ if (pos === -1) return
+
+ this.sockets.splice(pos, 1)
+
+ var pending = this.requests.shift()
+ if (pending) {
+ // If we have pending requests and a socket gets closed a new one
+ // needs to be created to take over in the pool for the one that closed.
+ this.createConnection(pending)
+ }
+}
+
+function createSecureSocket(options, cb) {
+ var self = this
+ TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
+ // 0 is dummy port for v0.6
+ var secureSocket = tls.connect(0, mergeOptions({}, self.options,
+ { servername: options.host
+ , socket: socket
+ }
+ ))
+ self.sockets[self.sockets.indexOf(socket)] = secureSocket
+ cb(secureSocket)
+ })
+}
+
+
+function mergeOptions(target) {
+ for (var i = 1, len = arguments.length; i < len; ++i) {
+ var overrides = arguments[i]
+ if (typeof overrides === 'object') {
+ var keys = Object.keys(overrides)
+ for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
+ var k = keys[j]
+ if (overrides[k] !== undefined) {
+ target[k] = overrides[k]
+ }
+ }
+ }
+ }
+ return target
+}
+
+
+var debug
+if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
+ debug = function() {
+ var args = Array.prototype.slice.call(arguments)
+ if (typeof args[0] === 'string') {
+ args[0] = 'TUNNEL: ' + args[0]
+ } else {
+ args.unshift('TUNNEL:')
+ }
+ console.error.apply(console, args)
+ }
+} else {
+ debug = function() {}
+}
+exports.debug = debug // for test
diff --git a/node_modules/request/node_modules/tunnel-agent/package.json b/node_modules/request/node_modules/tunnel-agent/package.json
new file mode 100644
index 000000000..265089b64
--- /dev/null
+++ b/node_modules/request/node_modules/tunnel-agent/package.json
@@ -0,0 +1,30 @@
+{
+ "author": {
+ "name": "Mikeal Rogers",
+ "email": "mikeal.rogers@gmail.com",
+ "url": "http://www.futurealoof.com"
+ },
+ "name": "tunnel-agent",
+ "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.",
+ "version": "0.4.1",
+ "repository": {
+ "url": "git+https://github.com/mikeal/tunnel-agent.git"
+ },
+ "main": "index.js",
+ "dependencies": {},
+ "devDependencies": {},
+ "optionalDependencies": {},
+ "engines": {
+ "node": "*"
+ },
+ "readme": "tunnel-agent\n============\n\nHTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/mikeal/tunnel-agent/issues"
+ },
+ "homepage": "https://github.com/mikeal/tunnel-agent#readme",
+ "_id": "tunnel-agent@0.4.1",
+ "_shasum": "bbeecff4d679ce753db9462761a88dfcec3c5ab3",
+ "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.1.tgz",
+ "_from": "tunnel-agent@>=0.4.1 <0.5.0"
+}
diff --git a/node_modules/request/package.json b/node_modules/request/package.json
index 3653b72c6..69c6f1ba1 100644
--- a/node_modules/request/package.json
+++ b/node_modules/request/package.json
@@ -1,101 +1,89 @@
{
- "_args": [
- [
- "request@2",
- "/Users/rebecca/code/npm/node_modules/node-gyp"
- ]
- ],
- "_from": "request@>=2.0.0 <3.0.0",
- "_id": "request@2.64.0",
- "_inCache": true,
- "_location": "/request",
- "_nodeVersion": "4.1.0",
- "_npmUser": {
- "email": "simeonvelichkov@gmail.com",
- "name": "simov"
- },
- "_npmVersion": "2.14.3",
- "_phantomChildren": {},
- "_requested": {
- "name": "request",
- "raw": "request@2",
- "rawSpec": "2",
- "scope": null,
- "spec": ">=2.0.0 <3.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/node-gyp",
- "/npm-registry-client"
+ "name": "request",
+ "description": "Simplified HTTP request client.",
+ "tags": [
+ "http",
+ "simple",
+ "util",
+ "utility"
],
- "_resolved": "https://registry.npmjs.org/request/-/request-2.64.0.tgz",
- "_shasum": "96a582423ce9b4b5c34e9b232e480173f14ba608",
- "_shrinkwrap": null,
- "_spec": "request@2",
- "_where": "/Users/rebecca/code/npm/node_modules/node-gyp",
+ "version": "2.65.0",
"author": {
- "email": "mikeal.rogers@gmail.com",
- "name": "Mikeal Rogers"
+ "name": "Mikeal Rogers",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/request/request.git"
},
"bugs": {
"url": "http://github.com/request/request/issues"
},
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=0.8.0"
+ },
+ "main": "index.js",
"dependencies": {
- "aws-sign2": "~0.5.0",
"bl": "~1.0.0",
"caseless": "~0.11.0",
- "combined-stream": "~1.0.1",
"extend": "~3.0.0",
- "forever-agent": "~0.6.0",
- "form-data": "~1.0.0-rc1",
- "har-validator": "^1.6.1",
- "hawk": "~3.1.0",
+ "forever-agent": "~0.6.1",
+ "form-data": "~1.0.0-rc3",
+ "json-stringify-safe": "~5.0.1",
+ "mime-types": "~2.1.7",
+ "node-uuid": "~1.4.3",
+ "qs": "~5.2.0",
+ "tunnel-agent": "~0.4.1",
+ "tough-cookie": "~2.2.0",
"http-signature": "~0.11.0",
- "isstream": "~0.1.1",
- "json-stringify-safe": "~5.0.0",
- "mime-types": "~2.1.2",
- "node-uuid": "~1.4.0",
"oauth-sign": "~0.8.0",
- "qs": "~5.1.0",
+ "hawk": "~3.1.0",
+ "aws-sign2": "~0.6.0",
"stringstream": "~0.0.4",
- "tough-cookie": ">=0.12.0",
- "tunnel-agent": "~0.4.0"
+ "combined-stream": "~1.0.5",
+ "isstream": "~0.1.2",
+ "har-validator": "~2.0.2"
+ },
+ "scripts": {
+ "test": "npm run lint && npm run test-ci && npm run test-browser",
+ "test-ci": "taper tests/test-*.js",
+ "test-cov": "istanbul cover tape tests/test-*.js",
+ "test-browser": "node tests/browser/start.js",
+ "lint": "eslint lib/ *.js tests/ && echo Lint passed."
},
- "description": "Simplified HTTP request client.",
"devDependencies": {
- "bluebird": "~2.9.21",
- "browserify": "~5.9.1",
- "browserify-istanbul": "~0.1.3",
- "buffer-equal": "0.0.1",
- "codecov.io": "~0.1.2",
- "coveralls": "~2.11.2",
+ "browserify-istanbul": "^0.1.5",
+ "browserify": "^11.2.0",
+ "buffer-equal": "^0.0.1",
+ "codecov.io": "^0.1.6",
+ "coveralls": "^2.11.4",
"eslint": "0.18.0",
- "function-bind": "~1.0.0",
- "istanbul": "~0.3.2",
- "karma": "~0.12.21",
- "karma-browserify": "~3.0.1",
- "karma-cli": "0.0.4",
- "karma-coverage": "0.2.6",
- "karma-phantomjs-launcher": "~0.1.4",
- "karma-tap": "~1.0.1",
- "rimraf": "~2.2.8",
- "server-destroy": "~1.0.0",
- "tape": "~3.0.0",
- "taper": "~0.4.0"
+ "function-bind": "^1.0.2",
+ "istanbul": "^0.3.21",
+ "karma-browserify": "^4.4.0",
+ "karma": "^0.13.10",
+ "karma-cli": "^0.1.1",
+ "karma-coverage": "^0.2.6",
+ "karma-phantomjs-launcher": "^0.1.4",
+ "karma-tap": "^1.0.3",
+ "rimraf": "^2.2.8",
+ "server-destroy": "^1.0.1",
+ "tape": "^4.2.0",
+ "taper": "^0.4.0",
+ "bluebird": "^2.10.1"
},
- "directories": {},
- "dist": {
- "shasum": "96a582423ce9b4b5c34e9b232e480173f14ba608",
- "tarball": "http://registry.npmjs.org/request/-/request-2.64.0.tgz"
- },
- "engines": {
- "node": ">=0.8.0"
- },
- "gitHead": "ca364485249f13c4810bb9b3952fb0fb886a93ee",
+ "gitHead": "8a7a37835c600f5006a6679aa23a0db504003ecd",
"homepage": "https://github.com/request/request#readme",
- "installable": true,
- "license": "Apache-2.0",
- "main": "index.js",
+ "_id": "request@2.65.0",
+ "_shasum": "cc1a3bc72b96254734fc34296da322f9486ddeba",
+ "_from": "request@2.65.0",
+ "_npmVersion": "2.14.3",
+ "_nodeVersion": "4.1.0",
+ "_npmUser": {
+ "name": "simov",
+ "email": "simeonvelichkov@gmail.com"
+ },
"maintainers": [
{
"name": "mikeal",
@@ -114,26 +102,11 @@
"email": "simeonvelichkov@gmail.com"
}
],
- "name": "request",
- "optionalDependencies": {},
- "readme": "\n# Request - Simplified HTTP client\n\n[![npm package](https://nodei.co/npm/request.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/request/)\n\n[![Build status](https://img.shields.io/travis/request/request.svg?style=flat-square)](https://travis-ci.org/request/request)\n[![Coverage](https://img.shields.io/codecov/c/github/request/request.svg?style=flat-square)](https://codecov.io/github/request/request?branch=master)\n[![Coverage](https://img.shields.io/coveralls/request/request.svg?style=flat-square)](https://coveralls.io/r/request/request)\n[![Dependency Status](https://img.shields.io/david/request/request.svg?style=flat-square)](https://david-dm.org/request/request)\n[![Gitter](https://img.shields.io/badge/gitter-join_chat-blue.svg?style=flat-square)](https://gitter.im/request/request?utm_source=badge)\n\n\n## Super simple to use\n\nRequest is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.\n\n```js\nvar request = require('request');\nrequest('http://www.google.com', function (error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(body) // Show the HTML for the Google homepage.\n }\n})\n```\n\n\n## Table of contents\n\n- [Streaming](#streaming)\n- [Forms](#forms)\n- [HTTP Authentication](#http-authentication)\n- [Custom HTTP Headers](#custom-http-headers)\n- [OAuth Signing](#oauth-signing)\n- [Proxies](#proxies)\n- [Unix Domain Sockets](#unix-domain-sockets)\n- [TLS/SSL Protocol](#tlsssl-protocol)\n- [Support for HAR 1.2](#support-for-har-12)\n- [**All Available Options**](#requestoptions-callback)\n\nRequest also offers [convenience methods](#convenience-methods) like\n`request.defaults` and `request.post`, and there are\nlots of [usage examples](#examples) and several\n[debugging techniques](#debugging).\n\n\n---\n\n\n## Streaming\n\nYou can stream any response to a file stream.\n\n```js\nrequest('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'))\n```\n\nYou can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types (in this case `application/json`) and use the proper `content-type` in the PUT request (if the headers don’t already provide one).\n\n```js\nfs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json'))\n```\n\nRequest can also `pipe` to itself. When doing so, `content-type` and `content-length` are preserved in the PUT headers.\n\n```js\nrequest.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png'))\n```\n\nRequest emits a \"response\" event when a response is received. The `response` argument will be an instance of [http.IncomingMessage](http://nodejs.org/api/http.html#http_http_incomingmessage).\n\n```js\nrequest\n .get('http://google.com/img.png')\n .on('response', function(response) {\n console.log(response.statusCode) // 200\n console.log(response.headers['content-type']) // 'image/png'\n })\n .pipe(request.put('http://mysite.com/img.png'))\n```\n\nTo easily handle errors when streaming requests, listen to the `error` event before piping:\n\n```js\nrequest\n .get('http://mysite.com/doodle.png')\n .on('error', function(err) {\n console.log(err)\n })\n .pipe(fs.createWriteStream('doodle.png'))\n```\n\nNow let’s get fancy.\n\n```js\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n if (req.method === 'PUT') {\n req.pipe(request.put('http://mysite.com/doodle.png'))\n } else if (req.method === 'GET' || req.method === 'HEAD') {\n request.get('http://mysite.com/doodle.png').pipe(resp)\n }\n }\n})\n```\n\nYou can also `pipe()` from `http.ServerRequest` instances, as well as to `http.ServerResponse` instances. The HTTP method, headers, and entity-body data will be sent. Which means that, if you don't really care about security, you can do:\n\n```js\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n var x = request('http://mysite.com/doodle.png')\n req.pipe(x)\n x.pipe(resp)\n }\n})\n```\n\nAnd since `pipe()` returns the destination stream in ≥ Node 0.5.x you can do one line proxying. :)\n\n```js\nreq.pipe(request('http://mysite.com/doodle.png')).pipe(resp)\n```\n\nAlso, none of this new functionality conflicts with requests previous features, it just expands them.\n\n```js\nvar r = request.defaults({'proxy':'http://localproxy.com'})\n\nhttp.createServer(function (req, resp) {\n if (req.url === '/doodle.png') {\n r.get('http://google.com/doodle.png').pipe(resp)\n }\n})\n```\n\nYou can still use intermediate proxies, the requests will still follow HTTP forwards, etc.\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## Forms\n\n`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API.\n\n\n#### application/x-www-form-urlencoded (URL-Encoded Forms)\n\nURL-encoded forms are simple.\n\n```js\nrequest.post('http://service.com/upload', {form:{key:'value'}})\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n// or\nrequest.post({url:'http://service.com/upload', form: {key:'value'}}, function(err,httpResponse,body){ /* ... */ })\n```\n\n\n#### multipart/form-data (Multipart Form Uploads)\n\nFor `multipart/form-data` we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.\n\n\n```js\nvar formData = {\n // Pass a simple key-value pair\n my_field: 'my_value',\n // Pass data via Buffers\n my_buffer: new Buffer([1, 2, 3]),\n // Pass data via Streams\n my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n // Pass multiple values /w an Array\n attachments: [\n fs.createReadStream(__dirname + '/attachment1.jpg'),\n fs.createReadStream(__dirname + '/attachment2.jpg')\n ],\n // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}\n // Use case: for some types of streams, you'll need to provide \"file\"-related information manually.\n // See the `form-data` README for more information about options: https://github.com/felixge/node-form-data\n custom_file: {\n value: fs.createReadStream('/dev/urandom'),\n options: {\n filename: 'topsecret.jpg',\n contentType: 'image/jpg'\n }\n }\n};\nrequest.post({url:'http://service.com/upload', formData: formData}, function optionalCallback(err, httpResponse, body) {\n if (err) {\n return console.error('upload failed:', err);\n }\n console.log('Upload successful! Server responded with:', body);\n});\n```\n\nFor advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)\n\n```js\n// NOTE: Advanced use-case, for normal use see 'formData' usage above\nvar r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})\nvar form = r.form();\nform.append('my_field', 'my_value');\nform.append('my_buffer', new Buffer([1, 2, 3]));\nform.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});\n```\nSee the [form-data README](https://github.com/felixge/node-form-data) for more information & examples.\n\n\n#### multipart/related\n\nSome 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.\n\n```js\n request({\n method: 'PUT',\n preambleCRLF: true,\n postambleCRLF: true,\n uri: 'http://service.com/upload',\n multipart: [\n {\n 'content-type': 'application/json',\n body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})\n },\n { body: 'I am an attachment' },\n { body: fs.createReadStream('image.png') }\n ],\n // alternatively pass an object containing additional options\n multipart: {\n chunked: false,\n data: [\n {\n 'content-type': 'application/json',\n body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})\n },\n { body: 'I am an attachment' }\n ]\n }\n },\n function (error, response, body) {\n if (error) {\n return console.error('upload failed:', error);\n }\n console.log('Upload successful! Server responded with:', body);\n })\n```\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## HTTP Authentication\n\n```js\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/', {\n 'auth': {\n 'user': 'username',\n 'pass': 'password',\n 'sendImmediately': false\n }\n});\n// or\nrequest.get('http://some.server.com/').auth(null, null, true, 'bearerToken');\n// or\nrequest.get('http://some.server.com/', {\n 'auth': {\n 'bearer': 'bearerToken'\n }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values:\n\n- `user` || `username`\n- `pass` || `password`\n- `sendImmediately` (optional)\n- `bearer` (optional)\n\nThe method form takes parameters\n`auth(username, password, sendImmediately, bearer)`.\n\n`sendImmediately` defaults to `true`, which causes a basic or bearer\nauthentication header to be sent. If `sendImmediately` is `false`, then\n`request` will retry with a proper authentication header after receiving a\n`401` response from the server (which must contain a `WWW-Authenticate` header\nindicating the required authentication method).\n\nNote that you can also specify basic authentication using the URL itself, as\ndetailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the\n`user:password` before the host with an `@` sign:\n\n```js\nvar username = 'username',\n password = 'password',\n url = 'http://' + username + ':' + password + '@some.server.com';\n\nrequest({url: url}, function (error, response, body) {\n // Do more stuff with 'body' here\n});\n```\n\nDigest authentication is supported, but it only works with `sendImmediately`\nset to `false`; otherwise `request` will send basic authentication on the\ninitial request, which will probably cause the request to fail.\n\nBearer authentication is supported, and is activated when the `bearer` value is\navailable. The value may be either a `String` or a `Function` returning a\n`String`. Using a function to supply the bearer token is particularly useful if\nused in conjunction with `defaults` to allow a single function to supply the\nlast known token at the time of sending a request, or to compute one on the fly.\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```js\nvar request = require('request');\n\nvar options = {\n url: 'https://api.github.com/repos/request/request',\n headers: {\n 'User-Agent': 'request'\n }\n};\n\nfunction callback(error, response, body) {\n if (!error && response.statusCode == 200) {\n var info = JSON.parse(body);\n console.log(info.stargazers_count + \" Stars\");\n console.log(info.forks_count + \" Forks\");\n }\n}\n\nrequest(options, callback);\n```\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## OAuth Signing\n\n[OAuth version 1.0](https://tools.ietf.org/html/rfc5849) is supported. The\ndefault signing algorithm is\n[HMAC-SHA1](https://tools.ietf.org/html/rfc5849#section-3.4.2):\n\n```js\n// OAuth1.0 - 3-legged server side flow (Twitter example)\n// step 1\nvar qs = require('querystring')\n , oauth =\n { callback: 'http://mysite.com/callback/'\n , consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n }\n , url = 'https://api.twitter.com/oauth/request_token'\n ;\nrequest.post({url:url, oauth:oauth}, function (e, r, body) {\n // Ideally, you would take the body in the response\n // and construct a URL that a user clicks on (like a sign in button).\n // The verifier is only available in the response after a user has\n // verified with twitter that they are authorizing your app.\n\n // step 2\n var req_data = qs.parse(body)\n var uri = 'https://api.twitter.com/oauth/authenticate'\n + '?' + qs.stringify({oauth_token: req_data.oauth_token})\n // redirect the user to the authorize uri\n\n // step 3\n // after the user is redirected back to your server\n var auth_data = qs.parse(body)\n , oauth =\n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: auth_data.oauth_token\n , token_secret: req_data.oauth_token_secret\n , verifier: auth_data.oauth_verifier\n }\n , url = 'https://api.twitter.com/oauth/access_token'\n ;\n request.post({url:url, oauth:oauth}, function (e, r, body) {\n // ready to make signed requests on behalf of the user\n var perm_data = qs.parse(body)\n , oauth =\n { consumer_key: CONSUMER_KEY\n , consumer_secret: CONSUMER_SECRET\n , token: perm_data.oauth_token\n , token_secret: perm_data.oauth_token_secret\n }\n , url = 'https://api.twitter.com/1.1/users/show.json'\n , qs =\n { screen_name: perm_data.screen_name\n , user_id: perm_data.user_id\n }\n ;\n request.get({url:url, oauth:oauth, qs:qs, json:true}, function (e, r, user) {\n console.log(user)\n })\n })\n})\n```\n\nFor [RSA-SHA1 signing](https://tools.ietf.org/html/rfc5849#section-3.4.3), make\nthe following changes to the OAuth options object:\n* Pass `signature_method : 'RSA-SHA1'`\n* Instead of `consumer_secret`, specify a `private_key` string in\n [PEM format](http://how2ssl.com/articles/working_with_pem_files/)\n\nFor [PLAINTEXT signing](http://oauth.net/core/1.0/#anchor22), make\nthe following changes to the OAuth options object:\n* Pass `signature_method : 'PLAINTEXT'`\n\nTo send OAuth parameters via query params or in a post body as described in The\n[Consumer Request Parameters](http://oauth.net/core/1.0/#consumer_req_param)\nsection of the oauth1 spec:\n* Pass `transport_method : 'query'` or `transport_method : 'body'` in the OAuth\n options object.\n* `transport_method` defaults to `'header'`\n\nTo use [Request Body Hash](https://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html) you can either\n* Manually generate the body hash and pass it as a string `body_hash: '...'`\n* Automatically generate the body hash by passing `body_hash: true`\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## Proxies\n\nIf you specify a `proxy` option, then the request (and any subsequent\nredirects) will be sent via a connection to the proxy server.\n\nIf your endpoint is an `https` url, and you are using a proxy, then\nrequest will send a `CONNECT` request to the proxy server *first*, and\nthen use the supplied connection to connect to the endpoint.\n\nThat is, first it will make a request like:\n\n```\nHTTP/1.1 CONNECT endpoint-server.com:80\nHost: proxy-server.com\nUser-Agent: whatever user agent you specify\n```\n\nand then the proxy server make a TCP connection to `endpoint-server`\non port `80`, and return a response that looks like:\n\n```\nHTTP/1.1 200 OK\n```\n\nAt this point, the connection is left open, and the client is\ncommunicating directly with the `endpoint-server.com` machine.\n\nSee [the wikipedia page on HTTP Tunneling](http://en.wikipedia.org/wiki/HTTP_tunnel)\nfor more information.\n\nBy default, when proxying `http` traffic, request will simply make a\nstandard proxied `http` request. This is done by making the `url`\nsection of the initial line of the request a fully qualified url to\nthe endpoint.\n\nFor example, it will make a single request that looks like:\n\n```\nHTTP/1.1 GET http://endpoint-server.com/some-url\nHost: proxy-server.com\nOther-Headers: all go here\n\nrequest body or whatever\n```\n\nBecause a pure \"http over http\" tunnel offers no additional security\nor other features, it is generally simpler to go with a\nstraightforward HTTP proxy in this case. However, if you would like\nto force a tunneling proxy, you may set the `tunnel` option to `true`.\n\nYou can also make a standard proxied `http` request by explicitly setting\n`tunnel : false`, but **note that this will allow the proxy to see the traffic\nto/from the destination server**.\n\nIf you are using a tunneling proxy, you may set the\n`proxyHeaderWhiteList` to share certain headers with the proxy.\n\nYou can also set the `proxyHeaderExclusiveList` to share certain\nheaders only with the proxy and not with destination host.\n\nBy default, this set is:\n\n```\naccept\naccept-charset\naccept-encoding\naccept-language\naccept-ranges\ncache-control\ncontent-encoding\ncontent-language\ncontent-length\ncontent-location\ncontent-md5\ncontent-range\ncontent-type\nconnection\ndate\nexpect\nmax-forwards\npragma\nproxy-authorization\nreferer\nte\ntransfer-encoding\nuser-agent\nvia\n```\n\nNote that, when using a tunneling proxy, the `proxy-authorization`\nheader and any headers from custom `proxyHeaderExclusiveList` are\n*never* sent to the endpoint server, but only to the proxy server.\n\n\n### Controlling proxy behaviour using environment variables\n\nThe following environment variables are respected by `request`:\n\n * `HTTP_PROXY` / `http_proxy`\n * `HTTPS_PROXY` / `https_proxy`\n * `NO_PROXY` / `no_proxy`\n\nWhen `HTTP_PROXY` / `http_proxy` are set, they will be used to proxy non-SSL requests that do not have an explicit `proxy` configuration option present. Similarly, `HTTPS_PROXY` / `https_proxy` will be respected for SSL requests that do not have an explicit `proxy` configuration option. It is valid to define a proxy in one of the environment variables, but then override it for a specific request, using the `proxy` configuration option. Furthermore, the `proxy` configuration option can be explicitly set to false / null to opt out of proxying altogether for that request.\n\n`request` is also aware of the `NO_PROXY`/`no_proxy` environment variables. These variables provide a granular way to opt out of proxying, on a per-host basis. It should contain a comma separated list of hosts to opt out of proxying. It is also possible to opt of proxying when a particular destination port is used. Finally, the variable may be set to `*` to opt out of the implicit proxy configuration of the other environment variables.\n\nHere's some examples of valid `no_proxy` values:\n\n * `google.com` - don't proxy HTTP/HTTPS requests to Google.\n * `google.com:443` - don't proxy HTTPS requests to Google, but *do* proxy HTTP requests to Google.\n * `google.com:443, yahoo.com:80` - don't proxy HTTPS requests to Google, and don't proxy HTTP requests to Yahoo!\n * `*` - ignore `https_proxy`/`http_proxy` environment variables altogether.\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## UNIX Domain Sockets\n\n`request` supports making requests to [UNIX Domain Sockets](http://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:\n\n```js\n/* Pattern */ 'http://unix:SOCKET:PATH'\n/* Example */ request.get('http://unix:/absolute/path/to/unix.socket:/request/path')\n```\n\nNote: The `SOCKET` path is assumed to be absolute to the root of the host file system.\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## TLS/SSL Protocol\n\nTLS/SSL Protocol options, such as `cert`, `key` and `passphrase`, can be\nset directly in `options` object, in the `agentOptions` property of the `options` object, or even in `https.globalAgent.options`. Keep in mind that, although `agentOptions` allows for a slightly wider range of configurations, the recommended way is via `options` object directly, as using `agentOptions` or `https.globalAgent.options` would not be applied in the same way in proxied environments (as data travels through a TLS connection instead of an http/https agent).\n\n```js\nvar fs = require('fs')\n , path = require('path')\n , certFile = path.resolve(__dirname, 'ssl/client.crt')\n , keyFile = path.resolve(__dirname, 'ssl/client.key')\n , caFile = path.resolve(__dirname, 'ssl/ca.cert.pem')\n , request = require('request');\n\nvar options = {\n url: 'https://api.some-server.com/',\n cert: fs.readFileSync(certFile),\n key: fs.readFileSync(keyFile),\n passphrase: 'password',\n ca: fs.readFileSync(caFile)\n }\n};\n\nrequest.get(options);\n```\n\n### Using `options.agentOptions`\n\nIn the example below, we call an API requires client side SSL certificate\n(in PEM format) with passphrase protected private key (in PEM format) and disable the SSLv3 protocol:\n\n```js\nvar fs = require('fs')\n , path = require('path')\n , certFile = path.resolve(__dirname, 'ssl/client.crt')\n , keyFile = path.resolve(__dirname, 'ssl/client.key')\n , request = require('request');\n\nvar options = {\n url: 'https://api.some-server.com/',\n agentOptions: {\n cert: fs.readFileSync(certFile),\n key: fs.readFileSync(keyFile),\n // Or use `pfx` property replacing `cert` and `key` when using private key, certificate and CA certs in PFX or PKCS12 format:\n // pfx: fs.readFileSync(pfxFilePath),\n passphrase: 'password',\n securityOptions: 'SSL_OP_NO_SSLv3'\n }\n};\n\nrequest.get(options);\n```\n\nIt is able to force using SSLv3 only by specifying `secureProtocol`:\n\n```js\nrequest.get({\n url: 'https://api.some-server.com/',\n agentOptions: {\n secureProtocol: 'SSLv3_method'\n }\n});\n```\n\nIt is possible to accept other certificates than those signed by generally allowed Certificate Authorities (CAs).\nThis can be useful, for example, when using self-signed certificates.\nTo require a different root certificate, you can specify the signing CA by adding the contents of the CA's certificate file to the `agentOptions`.\nThe certificate the domain presents must be signed by the root certificate specified:\n\n```js\nrequest.get({\n url: 'https://api.some-server.com/',\n agentOptions: {\n ca: fs.readFileSync('ca.cert.pem')\n }\n});\n```\n\n[back to top](#table-of-contents)\n\n\n---\n\n## Support for HAR 1.2\n\nThe `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`.\n\na validation step will check if the HAR Request format matches the latest spec (v1.2) and will skip parsing if not matching.\n\n```js\n var request = require('request')\n request({\n // will be ignored\n method: 'GET',\n uri: 'http://www.google.com',\n\n // HTTP Archive Request Object\n har: {\n url: 'http://www.mockbin.com/har',\n method: 'POST',\n headers: [\n {\n name: 'content-type',\n value: 'application/x-www-form-urlencoded'\n }\n ],\n postData: {\n mimeType: 'application/x-www-form-urlencoded',\n params: [\n {\n name: 'foo',\n value: 'bar'\n },\n {\n name: 'hello',\n value: 'world'\n }\n ]\n }\n }\n })\n\n // a POST request will be sent to http://www.mockbin.com\n // with body an application/x-www-form-urlencoded body:\n // foo=bar&hello=world\n```\n\n[back to top](#table-of-contents)\n\n\n---\n\n## request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n- `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string.\n- `method` - http method (default: `\"GET\"`)\n- `headers` - http headers (default: `{}`)\n\n---\n\n- `qs` - object containing querystring values to be appended to the `uri`\n- `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:{}}`\n- `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`\n- `useQuerystring` - If true, use `querystring` to stringify and parse\n querystrings, otherwise use `qs` (default: `false`). Set this option to\n `true` if you need arrays to be serialized as `foo=bar&foo=baz` instead of the\n default `foo[0]=bar&foo[1]=baz`.\n\n---\n\n- `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.\n- `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.\n- `formData` - Data to pass for a `multipart/form-data` request. See\n [Forms](#forms) section above.\n- `multipart` - array of objects which contain their own headers and `body`\n attributes. Sends a `multipart/related` request. See [Forms](#forms) section\n above.\n - Alternatively you can pass in an object `{chunked: false, data: []}` where\n `chunked` is used to specify whether the request is sent in\n [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)\n In non-chunked requests, data items with body streams are not allowed.\n- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.\n- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.\n- `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.\n- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.\n\n---\n\n- `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above.\n- `oauth` - Options for OAuth HMAC-SHA1 signing. See documentation above.\n- `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).\n- `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`. Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services)\n- `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.\n\n---\n\n- `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.\n- `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n- `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n- `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`).\n\n---\n\n- `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`.)\n- `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.\n- `jar` - If `true`, remember cookies for future use (or define your custom cookie jar; see examples section)\n\n---\n\n- `agent` - `http(s).Agent` instance to use\n- `agentClass` - alternatively specify your agent's class name\n- `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).\n- `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+\n- `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.\n - 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}`).\n - Note that if you are sending multiple requests in a loop and creating\n multiple new `pool` objects, `maxSockets` will not work as intended. To\n work around this, either use [`request.defaults`](#requestdefaultsoptions)\n with your pool options or create the pool object with the `maxSockets`\n property outside of the loop.\n- `timeout` - Integer containing the number of milliseconds to wait for a\nserver to send response headers (and start the response body) before aborting\nthe request. Note that if the underlying TCP connection cannot be established,\nthe OS-wide TCP connection timeout will overrule the `timeout` option ([the\ndefault in Linux can be anywhere from 20-120 seconds][linux-timeout]).\n\n[linux-timeout]: http://www.sekuda.com/overriding_the_default_linux_kernel_20_second_tcp_socket_connect_timeout\n\n---\n\n- `localAddress` - Local interface to bind for network connections.\n- `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`)\n- `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.\n- `tunnel` - controls the behavior of\n [HTTP `CONNECT` tunneling](https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_tunneling)\n as follows:\n - `undefined` (default) - `true` if the destination is `https` or a previous\n request in the redirect chain used a tunneling proxy, `false` otherwise\n - `true` - always tunnel to the destination by making a `CONNECT` request to\n the proxy\n - `false` - request the destination as a `GET` request.\n- `proxyHeaderWhiteList` - A whitelist of headers to send to a\n tunneling proxy.\n- `proxyHeaderExclusiveList` - A whitelist of headers to send\n exclusively to a tunneling proxy and not to destination.\n\n---\n\n- `time` - If `true`, the request-response cycle (including all redirects) is timed at millisecond resolution, and the result provided on the response's `elapsedTime` property.\n- `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)*\n\nThe callback argument gets 3 arguments:\n\n1. An `error` when applicable (usually from [`http.ClientRequest`](http://nodejs.org/api/http.html#http_class_http_clientrequest) object)\n2. An [`http.IncomingMessage`](http://nodejs.org/api/http.html#http_http_incomingmessage) object\n3. The third is the `response` body (`String` or `Buffer`, or JSON object if the `json` option is supplied)\n\n[back to top](#table-of-contents)\n\n\n---\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n\n### request.defaults(options)\n\nThis method **returns a wrapper** around the normal request API that defaults\nto whatever options you pass to it.\n\n**Note:** `request.defaults()` **does not** modify the global request API;\ninstead, it **returns a wrapper** that has your default settings applied to it.\n\n**Note:** You can call `.defaults()` on the wrapper that is returned from\n`request.defaults` to add/override defaults that were previously defaulted.\n\nFor example:\n```js\n//requests using baseRequest() will set the 'x-token' header\nvar baseRequest = request.defaults({\n headers: {x-token: 'my-token'}\n})\n\n//requests using specialRequest() will include the 'x-token' header set in\n//baseRequest and will also include the 'special' header\nvar specialRequest = baseRequest.defaults({\n headers: {special: 'special value'}\n})\n```\n\n### request.put\n\nSame as `request()`, but defaults to `method: \"PUT\"`.\n\n```js\nrequest.put(url)\n```\n\n### request.patch\n\nSame as `request()`, but defaults to `method: \"PATCH\"`.\n\n```js\nrequest.patch(url)\n```\n\n### request.post\n\nSame as `request()`, but defaults to `method: \"POST\"`.\n\n```js\nrequest.post(url)\n```\n\n### request.head\n\nSame as `request()`, but defaults to `method: \"HEAD\"`.\n\n```js\nrequest.head(url)\n```\n\n### request.del\n\nSame as `request()`, but defaults to `method: \"DELETE\"`.\n\n```js\nrequest.del(url)\n```\n\n### request.get\n\nSame as `request()` (for uniformity).\n\n```js\nrequest.get(url)\n```\n### request.cookie\n\nFunction that creates a new cookie.\n\n```js\nrequest.cookie('key1=value1')\n```\n### request.jar()\n\nFunction that creates a new cookie jar.\n\n```js\nrequest.jar()\n```\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## Debugging\n\nThere are at least three ways to debug the operation of `request`:\n\n1. Launch the node process like `NODE_DEBUG=request node script.js`\n (`lib,request,otherlib` works too).\n\n2. Set `require('request').debug = true` at any time (this does the same thing\n as #1).\n\n3. Use the [request-debug module](https://github.com/nylen/request-debug) to\n view request and response headers and bodies.\n\n[back to top](#table-of-contents)\n\n\n---\n\n## Timeouts\n\nMost requests to external servers should have a timeout attached, in case the\nserver is not responding in a timely manner. Without a timeout, your code may\nhave a socket open/consume resources for minutes or more.\n\nThere are two main types of timeouts: **connection timeouts** and **read\ntimeouts**. A connect timeout occurs if the timeout is hit while your client is\nattempting to establish a connection to a remote machine (corresponding to the\n[connect() call][connect] on the socket). A read timeout occurs any time the\nserver is too slow to send back a part of the response.\n\nThese two situations have widely different implications for what went wrong\nwith the request, so it's useful to be able to distinguish them. You can detect\ntimeout errors by checking `err.code` for an 'ETIMEDOUT' value. Further, you\ncan detect whether the timeout was a connection timeout by checking if the\n`err.connect` property is set to `true`.\n\n```js\nrequest.get('http://10.255.255.1', {timeout: 1500}, function(err) {\n console.log(err.code === 'ETIMEDOUT');\n // Set to `true` if the timeout was a connection timeout, `false` or\n // `undefined` otherwise.\n console.log(err.connect === true);\n process.exit(0);\n});\n```\n\n[connect]: http://linux.die.net/man/2/connect\n\n## Examples:\n\n```js\n var request = require('request')\n , rand = Math.floor(Math.random()*100000000).toString()\n ;\n request(\n { method: 'PUT'\n , uri: 'http://mikeal.iriscouch.com/testjs/' + rand\n , multipart:\n [ { 'content-type': 'application/json'\n , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})\n }\n , { body: 'I am an attachment' }\n ]\n }\n , function (error, response, body) {\n if(response.statusCode == 201){\n console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand)\n } else {\n console.log('error: '+ response.statusCode)\n console.log(body)\n }\n }\n )\n```\n\nFor backwards-compatibility, response compression is not supported by default.\nTo accept gzip-compressed responses, set the `gzip` option to `true`. Note\nthat the body data passed through `request` is automatically decompressed\nwhile the response object is unmodified and will contain compressed data if\nthe server sent a compressed response.\n\n```js\n var request = require('request')\n request(\n { method: 'GET'\n , uri: 'http://www.google.com'\n , gzip: true\n }\n , function (error, response, body) {\n // body is the decompressed response body\n console.log('server encoded the data as: ' + (response.headers['content-encoding'] || 'identity'))\n console.log('the decoded data is: ' + body)\n }\n ).on('data', function(data) {\n // decompressed data as it is received\n console.log('decoded chunk: ' + data)\n })\n .on('response', function(response) {\n // unmodified http.IncomingMessage object\n response.on('data', function(data) {\n // compressed data as it is received\n console.log('received ' + data.length + ' bytes of compressed data')\n })\n })\n```\n\nCookies are disabled by default (else, they would be used in subsequent requests). To enable cookies, set `jar` to `true` (either in `defaults` or `options`).\n\n```js\nvar request = request.defaults({jar: true})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\n\nTo use a custom cookie jar (instead of `request`’s global cookie jar), set `jar` to an instance of `request.jar()` (either in `defaults` or `options`)\n\n```js\nvar j = request.jar()\nvar request = request.defaults({jar:j})\nrequest('http://www.google.com', function () {\n request('http://images.google.com')\n})\n```\n\nOR\n\n```js\nvar j = request.jar();\nvar cookie = request.cookie('key1=value1');\nvar url = 'http://www.google.com';\nj.setCookie(cookie, url);\nrequest({url: url, jar: j}, function () {\n request('http://images.google.com')\n})\n```\n\nTo use a custom cookie store (such as a\n[`FileCookieStore`](https://github.com/mitsuru/tough-cookie-filestore)\nwhich supports saving to and restoring from JSON files), pass it as a parameter\nto `request.jar()`:\n\n```js\nvar FileCookieStore = require('tough-cookie-filestore');\n// NOTE - currently the 'cookies.json' file must already exist!\nvar j = request.jar(new FileCookieStore('cookies.json'));\nrequest = request.defaults({ jar : j })\nrequest('http://www.google.com', function() {\n request('http://images.google.com')\n})\n```\n\nThe cookie store must be a\n[`tough-cookie`](https://github.com/goinstant/tough-cookie)\nstore and it must support synchronous operations; see the\n[`CookieStore` API docs](https://github.com/goinstant/tough-cookie/#cookiestore-api)\nfor details.\n\nTo inspect your cookie jar after a request:\n\n```js\nvar j = request.jar()\nrequest({url: 'http://www.google.com', jar: j}, function () {\n var cookie_string = j.getCookieString(url); // \"key1=value1; key2=value2; ...\"\n var cookies = j.getCookies(url);\n // [{key: 'key1', value: 'value1', domain: \"www.google.com\", ...}, ...]\n})\n```\n\n[back to top](#table-of-contents)\n",
- "readmeFilename": "README.md",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/request/request.git"
- },
- "scripts": {
- "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"
+ "dist": {
+ "shasum": "cc1a3bc72b96254734fc34296da322f9486ddeba",
+ "tarball": "http://registry.npmjs.org/request/-/request-2.65.0.tgz"
},
- "tags": [
- "http",
- "simple",
- "util",
- "utility"
- ],
- "version": "2.64.0"
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/request/-/request-2.65.0.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/node_modules/request/request.js b/node_modules/request/request.js
index af91a11d3..824f9386e 100644
--- a/node_modules/request/request.js
+++ b/node_modules/request/request.js
@@ -1014,54 +1014,7 @@ Request.prototype.onRequestResponse = function (response) {
responseContent.on('close', function () {self.emit('close')})
if (self.callback) {
- var buffer = bl()
- , strings = []
-
- self.on('data', function (chunk) {
- if (Buffer.isBuffer(chunk)) {
- buffer.append(chunk)
- } else {
- strings.push(chunk)
- }
- })
- self.on('end', function () {
- debug('end event', self.uri.href)
- if (self._aborted) {
- debug('aborted', self.uri.href)
- return
- }
-
- if (buffer.length) {
- debug('has body', self.uri.href, buffer.length)
- if (self.encoding === null) {
- // response.body = buffer
- // can't move to this until https://github.com/rvagg/bl/issues/13
- response.body = buffer.slice()
- } else {
- response.body = buffer.toString(self.encoding)
- }
- } else if (strings.length) {
- // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation.
- // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse().
- if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') {
- strings[0] = strings[0].substring(1)
- }
- response.body = strings.join('')
- }
-
- if (self._json) {
- try {
- response.body = JSON.parse(response.body, self._jsonReviver)
- } catch (e) {
- debug('invalid JSON received', self.uri.href)
- }
- }
- debug('emitting complete', self.uri.href)
- if (typeof response.body === 'undefined' && !self._json) {
- response.body = self.encoding === null ? new Buffer(0) : ''
- }
- self.emit('complete', response, response.body)
- })
+ self.readResponseBody(response)
}
//if no callback
else {
@@ -1077,6 +1030,59 @@ Request.prototype.onRequestResponse = function (response) {
debug('finish init function', self.uri.href)
}
+Request.prototype.readResponseBody = function (response) {
+ var self = this
+ debug('reading response\'s body')
+ var buffer = bl()
+ , strings = []
+
+ self.on('data', function (chunk) {
+ if (Buffer.isBuffer(chunk)) {
+ buffer.append(chunk)
+ } else {
+ strings.push(chunk)
+ }
+ })
+ self.on('end', function () {
+ debug('end event', self.uri.href)
+ if (self._aborted) {
+ debug('aborted', self.uri.href)
+ return
+ }
+
+ if (buffer.length) {
+ debug('has body', self.uri.href, buffer.length)
+ if (self.encoding === null) {
+ // response.body = buffer
+ // can't move to this until https://github.com/rvagg/bl/issues/13
+ response.body = buffer.slice()
+ } else {
+ response.body = buffer.toString(self.encoding)
+ }
+ } else if (strings.length) {
+ // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation.
+ // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse().
+ if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') {
+ strings[0] = strings[0].substring(1)
+ }
+ response.body = strings.join('')
+ }
+
+ if (self._json) {
+ try {
+ response.body = JSON.parse(response.body, self._jsonReviver)
+ } catch (e) {
+ debug('invalid JSON received', self.uri.href)
+ }
+ }
+ debug('emitting complete', self.uri.href)
+ if (typeof response.body === 'undefined' && !self._json) {
+ response.body = self.encoding === null ? new Buffer(0) : ''
+ }
+ self.emit('complete', response, response.body)
+ })
+}
+
Request.prototype.abort = function () {
var self = this
self._aborted = true
@@ -1143,12 +1149,12 @@ Request.prototype.qs = function (q, clobber) {
base[i] = q[i]
}
- if (self._qs.stringify(base) === '') {
+ var qs = self._qs.stringify(base)
+
+ if (qs === '') {
return self
}
- var qs = self._qs.stringify(base)
-
self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs)
self.url = self.uri
self.path = self.uri.path