mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 18:06:45 +00:00
Fix.
This commit is contained in:
parent
596a6da241
commit
c1a589c5b6
7078 changed files with 1882834 additions and 319 deletions
709
node_modules/request/CHANGELOG.md
generated
vendored
Normal file
709
node_modules/request/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,709 @@
|
|||
## Change Log
|
||||
|
||||
### v2.87.0 (2018/05/21)
|
||||
- [#2943](https://github.com/request/request/pull/2943) Replace hawk dependency with a local implemenation (#2943) (@hueniverse)
|
||||
|
||||
### v2.86.0 (2018/05/15)
|
||||
- [#2885](https://github.com/request/request/pull/2885) Remove redundant code (for Node.js 0.9.4 and below) and dependency (@ChALkeR)
|
||||
- [#2942](https://github.com/request/request/pull/2942) Make Test GREEN Again! (@simov)
|
||||
- [#2923](https://github.com/request/request/pull/2923) Alterations for failing CI tests (@gareth-robinson)
|
||||
|
||||
### v2.85.0 (2018/03/12)
|
||||
- [#2880](https://github.com/request/request/pull/2880) Revert "Update hawk to 7.0.7 (#2880)" (@simov)
|
||||
|
||||
### v2.84.0 (2018/03/12)
|
||||
- [#2793](https://github.com/request/request/pull/2793) Fixed calculation of oauth_body_hash, issue #2792 (@dvishniakov)
|
||||
- [#2880](https://github.com/request/request/pull/2880) Update hawk to 7.0.7 (#2880) (@kornel-kedzierski)
|
||||
|
||||
### v2.83.0 (2017/09/27)
|
||||
- [#2776](https://github.com/request/request/pull/2776) Updating tough-cookie due to security fix. (#2776) (@karlnorling)
|
||||
|
||||
### v2.82.0 (2017/09/19)
|
||||
- [#2703](https://github.com/request/request/pull/2703) Add Node.js v8 to Travis CI (@ryysud)
|
||||
- [#2751](https://github.com/request/request/pull/2751) Update of hawk and qs to latest version (#2751) (@Olivier-Moreau)
|
||||
- [#2658](https://github.com/request/request/pull/2658) Fixed some text in README.md (#2658) (@Marketionist)
|
||||
- [#2635](https://github.com/request/request/pull/2635) chore(package): update aws-sign2 to version 0.7.0 (#2635) (@greenkeeperio-bot)
|
||||
- [#2641](https://github.com/request/request/pull/2641) Update README to simplify & update convenience methods (#2641) (@FredKSchott)
|
||||
- [#2541](https://github.com/request/request/pull/2541) Add convenience method for HTTP OPTIONS (#2541) (@jamesseanwright)
|
||||
- [#2605](https://github.com/request/request/pull/2605) Add promise support section to README (#2605) (@FredKSchott)
|
||||
- [#2579](https://github.com/request/request/pull/2579) refactor(lint): replace eslint with standard (#2579) (@ahmadnassri)
|
||||
- [#2598](https://github.com/request/request/pull/2598) Update codecov to version 2.0.2 🚀 (@greenkeeperio-bot)
|
||||
- [#2590](https://github.com/request/request/pull/2590) Adds test-timing keepAlive test (@nicjansma)
|
||||
- [#2589](https://github.com/request/request/pull/2589) fix tabulation on request example README.MD (@odykyi)
|
||||
- [#2594](https://github.com/request/request/pull/2594) chore(dependencies): har-validator to 5.x [removes babel dep] (@ahmadnassri)
|
||||
|
||||
### v2.81.0 (2017/03/09)
|
||||
- [#2584](https://github.com/request/request/pull/2584) Security issue: Upgrade qs to version 6.4.0 (@sergejmueller)
|
||||
- [#2578](https://github.com/request/request/pull/2578) safe-buffer doesn't zero-fill by default, its just a polyfill. (#2578) (@mikeal)
|
||||
- [#2566](https://github.com/request/request/pull/2566) Timings: Tracks 'lookup', adds 'wait' time, fixes connection re-use (#2566) (@nicjansma)
|
||||
- [#2574](https://github.com/request/request/pull/2574) Migrating to safe-buffer for improved security. (@mikeal)
|
||||
- [#2573](https://github.com/request/request/pull/2573) fixes #2572 (@ahmadnassri)
|
||||
|
||||
### v2.80.0 (2017/03/04)
|
||||
- [#2571](https://github.com/request/request/pull/2571) Correctly format the Host header for IPv6 addresses (@JamesMGreene)
|
||||
- [#2558](https://github.com/request/request/pull/2558) Update README.md example snippet (@FredKSchott)
|
||||
- [#2221](https://github.com/request/request/pull/2221) Adding a simple Response object reference in argument specification (@calamarico)
|
||||
- [#2452](https://github.com/request/request/pull/2452) Adds .timings array with DNC, TCP, request and response times (@nicjansma)
|
||||
- [#2553](https://github.com/request/request/pull/2553) add ISSUE_TEMPLATE, move PR template (@FredKSchott)
|
||||
- [#2539](https://github.com/request/request/pull/2539) Create PULL_REQUEST_TEMPLATE.md (@FredKSchott)
|
||||
- [#2524](https://github.com/request/request/pull/2524) Update caseless to version 0.12.0 🚀 (@greenkeeperio-bot)
|
||||
- [#2460](https://github.com/request/request/pull/2460) Fix wrong MIME type in example (@OwnageIsMagic)
|
||||
- [#2514](https://github.com/request/request/pull/2514) Change tags to keywords in package.json (@humphd)
|
||||
- [#2492](https://github.com/request/request/pull/2492) More lenient gzip decompression (@addaleax)
|
||||
|
||||
### v2.79.0 (2016/11/18)
|
||||
- [#2368](https://github.com/request/request/pull/2368) Fix typeof check in test-pool.js (@forivall)
|
||||
- [#2394](https://github.com/request/request/pull/2394) Use `files` in package.json (@SimenB)
|
||||
- [#2463](https://github.com/request/request/pull/2463) AWS support for session tokens for temporary credentials (@simov)
|
||||
- [#2467](https://github.com/request/request/pull/2467) Migrate to uuid (@simov, @antialias)
|
||||
- [#2459](https://github.com/request/request/pull/2459) Update taper to version 0.5.0 🚀 (@greenkeeperio-bot)
|
||||
- [#2448](https://github.com/request/request/pull/2448) Make other connect timeout test more reliable too (@mscdex)
|
||||
|
||||
### v2.78.0 (2016/11/03)
|
||||
- [#2447](https://github.com/request/request/pull/2447) Always set request timeout on keep-alive connections (@mscdex)
|
||||
|
||||
### v2.77.0 (2016/11/03)
|
||||
- [#2439](https://github.com/request/request/pull/2439) Fix socket 'connect' listener handling (@mscdex)
|
||||
- [#2442](https://github.com/request/request/pull/2442) 👻😱 Node.js 0.10 is unmaintained 😱👻 (@greenkeeperio-bot)
|
||||
- [#2435](https://github.com/request/request/pull/2435) Add followOriginalHttpMethod to redirect to original HTTP method (@kirrg001)
|
||||
- [#2414](https://github.com/request/request/pull/2414) Improve test-timeout reliability (@mscdex)
|
||||
|
||||
### v2.76.0 (2016/10/25)
|
||||
- [#2424](https://github.com/request/request/pull/2424) Handle buffers directly instead of using "bl" (@zertosh)
|
||||
- [#2415](https://github.com/request/request/pull/2415) Re-enable timeout tests on Travis + other fixes (@mscdex)
|
||||
- [#2431](https://github.com/request/request/pull/2431) Improve timeouts accuracy and node v6.8.0+ compatibility (@mscdex, @greenkeeperio-bot)
|
||||
- [#2428](https://github.com/request/request/pull/2428) Update qs to version 6.3.0 🚀 (@greenkeeperio-bot)
|
||||
- [#2420](https://github.com/request/request/pull/2420) change .on to .once, remove possible memory leaks (@duereg)
|
||||
- [#2426](https://github.com/request/request/pull/2426) Remove "isFunction" helper in favor of "typeof" check (@zertosh)
|
||||
- [#2425](https://github.com/request/request/pull/2425) Simplify "defer" helper creation (@zertosh)
|
||||
- [#2402](https://github.com/request/request/pull/2402) form-data@2.1.1 breaks build 🚨 (@greenkeeperio-bot)
|
||||
- [#2393](https://github.com/request/request/pull/2393) Update form-data to version 2.1.0 🚀 (@greenkeeperio-bot)
|
||||
|
||||
### v2.75.0 (2016/09/17)
|
||||
- [#2381](https://github.com/request/request/pull/2381) Drop support for Node 0.10 (@simov)
|
||||
- [#2377](https://github.com/request/request/pull/2377) Update form-data to version 2.0.0 🚀 (@greenkeeperio-bot)
|
||||
- [#2353](https://github.com/request/request/pull/2353) Add greenkeeper ignored packages (@simov)
|
||||
- [#2351](https://github.com/request/request/pull/2351) Update karma-tap to version 3.0.1 🚀 (@greenkeeperio-bot)
|
||||
- [#2348](https://github.com/request/request/pull/2348) form-data@1.0.1 breaks build 🚨 (@greenkeeperio-bot)
|
||||
- [#2349](https://github.com/request/request/pull/2349) Check error type instead of string (@scotttrinh)
|
||||
|
||||
### v2.74.0 (2016/07/22)
|
||||
- [#2295](https://github.com/request/request/pull/2295) Update tough-cookie to 2.3.0 (@stash-sfdc)
|
||||
- [#2280](https://github.com/request/request/pull/2280) Update karma-tap to version 2.0.1 🚀 (@greenkeeperio-bot)
|
||||
|
||||
### v2.73.0 (2016/07/09)
|
||||
- [#2240](https://github.com/request/request/pull/2240) Remove connectionErrorHandler to fix #1903 (@zarenner)
|
||||
- [#2251](https://github.com/request/request/pull/2251) tape@4.6.0 breaks build 🚨 (@greenkeeperio-bot)
|
||||
- [#2225](https://github.com/request/request/pull/2225) Update docs (@ArtskydJ)
|
||||
- [#2203](https://github.com/request/request/pull/2203) Update browserify to version 13.0.1 🚀 (@greenkeeperio-bot)
|
||||
- [#2275](https://github.com/request/request/pull/2275) Update karma to version 1.1.1 🚀 (@greenkeeperio-bot)
|
||||
- [#2204](https://github.com/request/request/pull/2204) Add codecov.yml and disable PR comments (@simov)
|
||||
- [#2212](https://github.com/request/request/pull/2212) Fix link to http.IncomingMessage documentation (@nazieb)
|
||||
- [#2208](https://github.com/request/request/pull/2208) Update to form-data RC4 and pass null values to it (@simov)
|
||||
- [#2207](https://github.com/request/request/pull/2207) Move aws4 require statement to the top (@simov)
|
||||
- [#2199](https://github.com/request/request/pull/2199) Update karma-coverage to version 1.0.0 🚀 (@greenkeeperio-bot)
|
||||
- [#2206](https://github.com/request/request/pull/2206) Update qs to version 6.2.0 🚀 (@greenkeeperio-bot)
|
||||
- [#2205](https://github.com/request/request/pull/2205) Use server-destory to close hanging sockets in tests (@simov)
|
||||
- [#2200](https://github.com/request/request/pull/2200) Update karma-cli to version 1.0.0 🚀 (@greenkeeperio-bot)
|
||||
|
||||
### v2.72.0 (2016/04/17)
|
||||
- [#2176](https://github.com/request/request/pull/2176) Do not try to pipe Gzip responses with no body (@simov)
|
||||
- [#2175](https://github.com/request/request/pull/2175) Add 'delete' alias for the 'del' API method (@simov, @MuhanZou)
|
||||
- [#2172](https://github.com/request/request/pull/2172) Add support for deflate content encoding (@czardoz)
|
||||
- [#2169](https://github.com/request/request/pull/2169) Add callback option (@simov)
|
||||
- [#2165](https://github.com/request/request/pull/2165) Check for self.req existence inside the write method (@simov)
|
||||
- [#2167](https://github.com/request/request/pull/2167) Fix TravisCI badge reference master branch (@a0viedo)
|
||||
|
||||
### v2.71.0 (2016/04/12)
|
||||
- [#2164](https://github.com/request/request/pull/2164) Catch errors from the underlying http module (@simov)
|
||||
|
||||
### v2.70.0 (2016/04/05)
|
||||
- [#2147](https://github.com/request/request/pull/2147) Update eslint to version 2.5.3 🚀 (@simov, @greenkeeperio-bot)
|
||||
- [#2009](https://github.com/request/request/pull/2009) Support JSON stringify replacer argument. (@elyobo)
|
||||
- [#2142](https://github.com/request/request/pull/2142) Update eslint to version 2.5.1 🚀 (@greenkeeperio-bot)
|
||||
- [#2128](https://github.com/request/request/pull/2128) Update browserify-istanbul to version 2.0.0 🚀 (@greenkeeperio-bot)
|
||||
- [#2115](https://github.com/request/request/pull/2115) Update eslint to version 2.3.0 🚀 (@simov, @greenkeeperio-bot)
|
||||
- [#2089](https://github.com/request/request/pull/2089) Fix badges (@simov)
|
||||
- [#2092](https://github.com/request/request/pull/2092) Update browserify-istanbul to version 1.0.0 🚀 (@greenkeeperio-bot)
|
||||
- [#2079](https://github.com/request/request/pull/2079) Accept read stream as body option (@simov)
|
||||
- [#2070](https://github.com/request/request/pull/2070) Update bl to version 1.1.2 🚀 (@greenkeeperio-bot)
|
||||
- [#2063](https://github.com/request/request/pull/2063) Up bluebird and oauth-sign (@simov)
|
||||
- [#2058](https://github.com/request/request/pull/2058) Karma fixes for latest versions (@eiriksm)
|
||||
- [#2057](https://github.com/request/request/pull/2057) Update contributing guidelines (@simov)
|
||||
- [#2054](https://github.com/request/request/pull/2054) Update qs to version 6.1.0 🚀 (@greenkeeperio-bot)
|
||||
|
||||
### v2.69.0 (2016/01/27)
|
||||
- [#2041](https://github.com/request/request/pull/2041) restore aws4 as regular dependency (@rmg)
|
||||
|
||||
### v2.68.0 (2016/01/27)
|
||||
- [#2036](https://github.com/request/request/pull/2036) Add AWS Signature Version 4 (@simov, @mirkods)
|
||||
- [#2022](https://github.com/request/request/pull/2022) Convert numeric multipart bodies to string (@simov, @feross)
|
||||
- [#2024](https://github.com/request/request/pull/2024) Update har-validator dependency for nsp advisory #76 (@TylerDixon)
|
||||
- [#2016](https://github.com/request/request/pull/2016) Update qs to version 6.0.2 🚀 (@greenkeeperio-bot)
|
||||
- [#2007](https://github.com/request/request/pull/2007) Use the `extend` module instead of util._extend (@simov)
|
||||
- [#2003](https://github.com/request/request/pull/2003) Update browserify to version 13.0.0 🚀 (@greenkeeperio-bot)
|
||||
- [#1989](https://github.com/request/request/pull/1989) Update buffer-equal to version 1.0.0 🚀 (@greenkeeperio-bot)
|
||||
- [#1956](https://github.com/request/request/pull/1956) Check form-data content-length value before setting up the header (@jongyoonlee)
|
||||
- [#1958](https://github.com/request/request/pull/1958) Use IncomingMessage.destroy method (@simov)
|
||||
- [#1952](https://github.com/request/request/pull/1952) Adds example for Tor proxy (@prometheansacrifice)
|
||||
- [#1943](https://github.com/request/request/pull/1943) Update eslint to version 1.10.3 🚀 (@simov, @greenkeeperio-bot)
|
||||
- [#1924](https://github.com/request/request/pull/1924) Update eslint to version 1.10.1 🚀 (@greenkeeperio-bot)
|
||||
- [#1915](https://github.com/request/request/pull/1915) Remove content-length and transfer-encoding headers from defaultProxyHeaderWhiteList (@yaxia)
|
||||
|
||||
### v2.67.0 (2015/11/19)
|
||||
- [#1913](https://github.com/request/request/pull/1913) Update http-signature to version 1.1.0 🚀 (@greenkeeperio-bot)
|
||||
|
||||
### v2.66.0 (2015/11/18)
|
||||
- [#1906](https://github.com/request/request/pull/1906) Update README URLs based on HTTP redirects (@ReadmeCritic)
|
||||
- [#1905](https://github.com/request/request/pull/1905) Convert typed arrays into regular buffers (@simov)
|
||||
- [#1902](https://github.com/request/request/pull/1902) node-uuid@1.4.7 breaks build 🚨 (@greenkeeperio-bot)
|
||||
- [#1894](https://github.com/request/request/pull/1894) Fix tunneling after redirection from https (Original: #1881) (@simov, @falms)
|
||||
- [#1893](https://github.com/request/request/pull/1893) Update eslint to version 1.9.0 🚀 (@greenkeeperio-bot)
|
||||
- [#1852](https://github.com/request/request/pull/1852) Update eslint to version 1.7.3 🚀 (@simov, @greenkeeperio-bot, @paulomcnally, @michelsalib, @arbaaz, @nsklkn, @LoicMahieu, @JoshWillik, @jzaefferer, @ryanwholey, @djchie, @thisconnect, @mgenereu, @acroca, @Sebmaster, @KoltesDigital)
|
||||
- [#1876](https://github.com/request/request/pull/1876) Implement loose matching for har mime types (@simov)
|
||||
- [#1875](https://github.com/request/request/pull/1875) Update bluebird to version 3.0.2 🚀 (@simov, @greenkeeperio-bot)
|
||||
- [#1871](https://github.com/request/request/pull/1871) Update browserify to version 12.0.1 🚀 (@greenkeeperio-bot)
|
||||
- [#1866](https://github.com/request/request/pull/1866) Add missing quotes on x-token property in README (@miguelmota)
|
||||
- [#1874](https://github.com/request/request/pull/1874) Fix typo in README.md (@gswalden)
|
||||
- [#1860](https://github.com/request/request/pull/1860) Improve referer header tests and docs (@simov)
|
||||
- [#1861](https://github.com/request/request/pull/1861) Remove redundant call to Stream constructor (@watson)
|
||||
- [#1857](https://github.com/request/request/pull/1857) Fix Referer header to point to the original host name (@simov)
|
||||
- [#1850](https://github.com/request/request/pull/1850) Update karma-coverage to version 0.5.3 🚀 (@greenkeeperio-bot)
|
||||
- [#1847](https://github.com/request/request/pull/1847) Use node's latest version when building (@simov)
|
||||
- [#1836](https://github.com/request/request/pull/1836) Tunnel: fix wrong property name (@KoltesDigital)
|
||||
- [#1820](https://github.com/request/request/pull/1820) Set href as request.js uses it (@mgenereu)
|
||||
- [#1840](https://github.com/request/request/pull/1840) Update http-signature to version 1.0.2 🚀 (@greenkeeperio-bot)
|
||||
- [#1845](https://github.com/request/request/pull/1845) Update istanbul to version 0.4.0 🚀 (@greenkeeperio-bot)
|
||||
|
||||
### 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)
|
||||
- [#1776](https://github.com/request/request/pull/1776) Changed word 'conjuction' to read 'conjunction' in README.md (@ryanwholey)
|
||||
- [#1785](https://github.com/request/request/pull/1785) Revert: Set default application/json content-type when using json option #1772 (@simov)
|
||||
|
||||
### v2.63.0 (2015/09/21)
|
||||
- [#1772](https://github.com/request/request/pull/1772) Set default application/json content-type when using json option (@jzaefferer)
|
||||
|
||||
### v2.62.0 (2015/09/15)
|
||||
- [#1768](https://github.com/request/request/pull/1768) Add node 4.0 to the list of build targets (@simov)
|
||||
- [#1767](https://github.com/request/request/pull/1767) Query strings now cooperate with unix sockets (@JoshWillik)
|
||||
- [#1750](https://github.com/request/request/pull/1750) Revert doc about installation of tough-cookie added in #884 (@LoicMahieu)
|
||||
- [#1746](https://github.com/request/request/pull/1746) Missed comma in Readme (@nsklkn)
|
||||
- [#1743](https://github.com/request/request/pull/1743) Fix options not being initialized in defaults method (@simov)
|
||||
|
||||
### v2.61.0 (2015/08/19)
|
||||
- [#1721](https://github.com/request/request/pull/1721) Minor fix in README.md (@arbaaz)
|
||||
- [#1733](https://github.com/request/request/pull/1733) Avoid useless Buffer transformation (@michelsalib)
|
||||
- [#1726](https://github.com/request/request/pull/1726) Update README.md (@paulomcnally)
|
||||
- [#1715](https://github.com/request/request/pull/1715) Fix forever option in node > 0.10 #1709 (@calibr)
|
||||
- [#1716](https://github.com/request/request/pull/1716) Do not create Buffer from Object in setContentLength(iojs v3.0 issue) (@calibr)
|
||||
- [#1711](https://github.com/request/request/pull/1711) Add ability to detect connect timeouts (@kevinburke)
|
||||
- [#1712](https://github.com/request/request/pull/1712) Set certificate expiration to August 2, 2018 (@kevinburke)
|
||||
- [#1700](https://github.com/request/request/pull/1700) debug() when JSON.parse() on a response body fails (@phillipj)
|
||||
|
||||
### v2.60.0 (2015/07/21)
|
||||
- [#1687](https://github.com/request/request/pull/1687) Fix caseless bug - content-type not being set for multipart/form-data (@simov, @garymathews)
|
||||
|
||||
### v2.59.0 (2015/07/20)
|
||||
- [#1671](https://github.com/request/request/pull/1671) Add tests and docs for using the agent, agentClass, agentOptions and forever options.
|
||||
Forever option defaults to using http(s).Agent in node 0.12+ (@simov)
|
||||
- [#1679](https://github.com/request/request/pull/1679) Fix - do not remove OAuth param when using OAuth realm (@simov, @jhalickman)
|
||||
- [#1668](https://github.com/request/request/pull/1668) updated dependencies (@deamme)
|
||||
- [#1656](https://github.com/request/request/pull/1656) Fix form method (@simov)
|
||||
- [#1651](https://github.com/request/request/pull/1651) Preserve HEAD method when using followAllRedirects (@simov)
|
||||
- [#1652](https://github.com/request/request/pull/1652) Update `encoding` option documentation in README.md (@daniel347x)
|
||||
- [#1650](https://github.com/request/request/pull/1650) Allow content-type overriding when using the `form` option (@simov)
|
||||
- [#1646](https://github.com/request/request/pull/1646) Clarify the nature of setting `ca` in `agentOptions` (@jeffcharles)
|
||||
|
||||
### v2.58.0 (2015/06/16)
|
||||
- [#1638](https://github.com/request/request/pull/1638) Use the `extend` module to deep extend in the defaults method (@simov)
|
||||
- [#1631](https://github.com/request/request/pull/1631) Move tunnel logic into separate module (@simov)
|
||||
- [#1634](https://github.com/request/request/pull/1634) Fix OAuth query transport_method (@simov)
|
||||
- [#1603](https://github.com/request/request/pull/1603) Add codecov (@simov)
|
||||
|
||||
### v2.57.0 (2015/05/31)
|
||||
- [#1615](https://github.com/request/request/pull/1615) Replace '.client' with '.socket' as the former was deprecated in 2.2.0. (@ChALkeR)
|
||||
|
||||
### v2.56.0 (2015/05/28)
|
||||
- [#1610](https://github.com/request/request/pull/1610) Bump module dependencies (@simov)
|
||||
- [#1600](https://github.com/request/request/pull/1600) Extract the querystring logic into separate module (@simov)
|
||||
- [#1607](https://github.com/request/request/pull/1607) Re-generate certificates (@simov)
|
||||
- [#1599](https://github.com/request/request/pull/1599) Move getProxyFromURI logic below the check for Invaild URI (#1595) (@simov)
|
||||
- [#1598](https://github.com/request/request/pull/1598) Fix the way http verbs are defined in order to please intellisense IDEs (@simov, @flannelJesus)
|
||||
- [#1591](https://github.com/request/request/pull/1591) A few minor fixes: (@simov)
|
||||
- [#1584](https://github.com/request/request/pull/1584) Refactor test-default tests (according to comments in #1430) (@simov)
|
||||
- [#1585](https://github.com/request/request/pull/1585) Fixing documentation regarding TLS options (#1583) (@mainakae)
|
||||
- [#1574](https://github.com/request/request/pull/1574) Refresh the oauth_nonce on redirect (#1573) (@simov)
|
||||
- [#1570](https://github.com/request/request/pull/1570) Discovered tests that weren't properly running (@seanstrom)
|
||||
- [#1569](https://github.com/request/request/pull/1569) Fix pause before response arrives (@kevinoid)
|
||||
- [#1558](https://github.com/request/request/pull/1558) Emit error instead of throw (@simov)
|
||||
- [#1568](https://github.com/request/request/pull/1568) Fix stall when piping gzipped response (@kevinoid)
|
||||
- [#1560](https://github.com/request/request/pull/1560) Update combined-stream (@apechimp)
|
||||
- [#1543](https://github.com/request/request/pull/1543) Initial support for oauth_body_hash on json payloads (@simov, @aesopwolf)
|
||||
- [#1541](https://github.com/request/request/pull/1541) Fix coveralls (@simov)
|
||||
- [#1540](https://github.com/request/request/pull/1540) Fix recursive defaults for convenience methods (@simov)
|
||||
- [#1536](https://github.com/request/request/pull/1536) More eslint style rules (@froatsnook)
|
||||
- [#1533](https://github.com/request/request/pull/1533) Adding dependency status bar to README.md (@YasharF)
|
||||
- [#1539](https://github.com/request/request/pull/1539) ensure the latest version of har-validator is included (@ahmadnassri)
|
||||
- [#1516](https://github.com/request/request/pull/1516) forever+pool test (@devTristan)
|
||||
|
||||
### v2.55.0 (2015/04/05)
|
||||
- [#1520](https://github.com/request/request/pull/1520) Refactor defaults (@simov)
|
||||
- [#1525](https://github.com/request/request/pull/1525) Delete request headers with undefined value. (@froatsnook)
|
||||
- [#1521](https://github.com/request/request/pull/1521) Add promise tests (@simov)
|
||||
- [#1518](https://github.com/request/request/pull/1518) Fix defaults (@simov)
|
||||
- [#1515](https://github.com/request/request/pull/1515) Allow static invoking of convenience methods (@simov)
|
||||
- [#1505](https://github.com/request/request/pull/1505) Fix multipart boundary extraction regexp (@simov)
|
||||
- [#1510](https://github.com/request/request/pull/1510) Fix basic auth form data (@simov)
|
||||
|
||||
### v2.54.0 (2015/03/24)
|
||||
- [#1501](https://github.com/request/request/pull/1501) HTTP Archive 1.2 support (@ahmadnassri)
|
||||
- [#1486](https://github.com/request/request/pull/1486) Add a test for the forever agent (@akshayp)
|
||||
- [#1500](https://github.com/request/request/pull/1500) Adding handling for no auth method and null bearer (@philberg)
|
||||
- [#1498](https://github.com/request/request/pull/1498) Add table of contents in readme (@simov)
|
||||
- [#1477](https://github.com/request/request/pull/1477) Add support for qs options via qsOptions key (@simov)
|
||||
- [#1496](https://github.com/request/request/pull/1496) Parameters encoded to base 64 should be decoded as UTF-8, not ASCII. (@albanm)
|
||||
- [#1494](https://github.com/request/request/pull/1494) Update eslint (@froatsnook)
|
||||
- [#1474](https://github.com/request/request/pull/1474) Require Colon in Basic Auth (@erykwalder)
|
||||
- [#1481](https://github.com/request/request/pull/1481) Fix baseUrl and redirections. (@burningtree)
|
||||
- [#1469](https://github.com/request/request/pull/1469) Feature/base url (@froatsnook)
|
||||
- [#1459](https://github.com/request/request/pull/1459) Add option to time request/response cycle (including rollup of redirects) (@aaron-em)
|
||||
- [#1468](https://github.com/request/request/pull/1468) Re-enable io.js/node 0.12 build (@simov, @mikeal, @BBB)
|
||||
- [#1442](https://github.com/request/request/pull/1442) Fixed the issue with strictSSL tests on 0.12 & io.js by explicitly setting a cipher that matches the cert. (@BBB, @nickmccurdy, @demohi, @simov, @0x4139)
|
||||
- [#1460](https://github.com/request/request/pull/1460) localAddress or proxy config is lost when redirecting (@simov, @0x4139)
|
||||
- [#1453](https://github.com/request/request/pull/1453) Test on Node.js 0.12 and io.js with allowed failures (@nickmccurdy, @demohi)
|
||||
- [#1426](https://github.com/request/request/pull/1426) Fixing tests to pass on io.js and node 0.12 (only test-https.js stiff failing) (@mikeal)
|
||||
- [#1446](https://github.com/request/request/pull/1446) Missing HTTP referer header with redirects Fixes #1038 (@simov, @guimon)
|
||||
- [#1428](https://github.com/request/request/pull/1428) Deprecate Node v0.8.x (@nylen)
|
||||
- [#1436](https://github.com/request/request/pull/1436) Add ability to set a requester without setting default options (@tikotzky)
|
||||
- [#1435](https://github.com/request/request/pull/1435) dry up verb methods (@sethpollack)
|
||||
- [#1423](https://github.com/request/request/pull/1423) Allow fully qualified multipart content-type header (@simov)
|
||||
- [#1430](https://github.com/request/request/pull/1430) Fix recursive requester (@tikotzky)
|
||||
- [#1429](https://github.com/request/request/pull/1429) Throw error when making HEAD request with a body (@tikotzky)
|
||||
- [#1419](https://github.com/request/request/pull/1419) Add note that the project is broken in 0.12.x (@nylen)
|
||||
- [#1413](https://github.com/request/request/pull/1413) Fix basic auth (@simov)
|
||||
- [#1397](https://github.com/request/request/pull/1397) Improve pipe-from-file tests (@nylen)
|
||||
|
||||
### v2.53.0 (2015/02/02)
|
||||
- [#1396](https://github.com/request/request/pull/1396) Do not rfc3986 escape JSON bodies (@nylen, @simov)
|
||||
- [#1392](https://github.com/request/request/pull/1392) Improve `timeout` option description (@watson)
|
||||
|
||||
### v2.52.0 (2015/02/02)
|
||||
- [#1383](https://github.com/request/request/pull/1383) Add missing HTTPS options that were not being passed to tunnel (@brichard19) (@nylen)
|
||||
- [#1388](https://github.com/request/request/pull/1388) Upgrade mime-types package version (@roderickhsiao)
|
||||
- [#1389](https://github.com/request/request/pull/1389) Revise Setup Tunnel Function (@seanstrom)
|
||||
- [#1374](https://github.com/request/request/pull/1374) Allow explicitly disabling tunneling for proxied https destinations (@nylen)
|
||||
- [#1376](https://github.com/request/request/pull/1376) Use karma-browserify for tests. Add browser test coverage reporter. (@eiriksm)
|
||||
- [#1366](https://github.com/request/request/pull/1366) Refactor OAuth into separate module (@simov)
|
||||
- [#1373](https://github.com/request/request/pull/1373) Rewrite tunnel test to be pure Node.js (@nylen)
|
||||
- [#1371](https://github.com/request/request/pull/1371) Upgrade test reporter (@nylen)
|
||||
- [#1360](https://github.com/request/request/pull/1360) Refactor basic, bearer, digest auth logic into separate class (@simov)
|
||||
- [#1354](https://github.com/request/request/pull/1354) Remove circular dependency from debugging code (@nylen)
|
||||
- [#1351](https://github.com/request/request/pull/1351) Move digest auth into private prototype method (@simov)
|
||||
- [#1352](https://github.com/request/request/pull/1352) Update hawk dependency to ~2.3.0 (@mridgway)
|
||||
- [#1353](https://github.com/request/request/pull/1353) Correct travis-ci badge (@dogancelik)
|
||||
- [#1349](https://github.com/request/request/pull/1349) Make sure we return on errored browser requests. (@eiriksm)
|
||||
- [#1346](https://github.com/request/request/pull/1346) getProxyFromURI Extraction Refactor (@seanstrom)
|
||||
- [#1337](https://github.com/request/request/pull/1337) Standardize test ports on 6767 (@nylen)
|
||||
- [#1341](https://github.com/request/request/pull/1341) Emit FormData error events as Request error events (@nylen, @rwky)
|
||||
- [#1343](https://github.com/request/request/pull/1343) Clean up readme badges, and add Travis and Coveralls badges (@nylen)
|
||||
- [#1345](https://github.com/request/request/pull/1345) Update README.md (@Aaron-Hartwig)
|
||||
- [#1338](https://github.com/request/request/pull/1338) Always wait for server.close() callback in tests (@nylen)
|
||||
- [#1342](https://github.com/request/request/pull/1342) Add mock https server and redo start of browser tests for this purpose. (@eiriksm)
|
||||
- [#1339](https://github.com/request/request/pull/1339) Improve auth docs (@nylen)
|
||||
- [#1335](https://github.com/request/request/pull/1335) Add support for OAuth plaintext signature method (@simov)
|
||||
- [#1332](https://github.com/request/request/pull/1332) Add clean script to remove test-browser.js after the tests run (@seanstrom)
|
||||
- [#1327](https://github.com/request/request/pull/1327) Fix errors generating coverage reports. (@nylen)
|
||||
- [#1330](https://github.com/request/request/pull/1330) Return empty buffer upon empty response body and encoding is set to null (@seanstrom)
|
||||
- [#1326](https://github.com/request/request/pull/1326) Use faster container-based infrastructure on Travis (@nylen)
|
||||
- [#1315](https://github.com/request/request/pull/1315) Implement rfc3986 option (@simov, @nylen, @apoco, @DullReferenceException, @mmalecki, @oliamb, @cliffcrosland, @LewisJEllis, @eiriksm, @poislagarde)
|
||||
- [#1314](https://github.com/request/request/pull/1314) Detect urlencoded form data header via regex (@simov)
|
||||
- [#1317](https://github.com/request/request/pull/1317) Improve OAuth1.0 server side flow example (@simov)
|
||||
|
||||
### v2.51.0 (2014/12/10)
|
||||
- [#1310](https://github.com/request/request/pull/1310) Revert changes introduced in https://github.com/request/request/pull/1282 (@simov)
|
||||
|
||||
### v2.50.0 (2014/12/09)
|
||||
- [#1308](https://github.com/request/request/pull/1308) Add browser test to keep track of browserify compability. (@eiriksm)
|
||||
- [#1299](https://github.com/request/request/pull/1299) Add optional support for jsonReviver (@poislagarde)
|
||||
- [#1277](https://github.com/request/request/pull/1277) Add Coveralls configuration (@simov)
|
||||
- [#1307](https://github.com/request/request/pull/1307) Upgrade form-data, add back browserify compability. Fixes #455. (@eiriksm)
|
||||
- [#1305](https://github.com/request/request/pull/1305) Fix typo in README.md (@LewisJEllis)
|
||||
- [#1288](https://github.com/request/request/pull/1288) Update README.md to explain custom file use case (@cliffcrosland)
|
||||
|
||||
### v2.49.0 (2014/11/28)
|
||||
- [#1295](https://github.com/request/request/pull/1295) fix(proxy): no-proxy false positive (@oliamb)
|
||||
- [#1292](https://github.com/request/request/pull/1292) Upgrade `caseless` to 0.8.1 (@mmalecki)
|
||||
- [#1276](https://github.com/request/request/pull/1276) Set transfer encoding for multipart/related to chunked by default (@simov)
|
||||
- [#1275](https://github.com/request/request/pull/1275) Fix multipart content-type headers detection (@simov)
|
||||
- [#1269](https://github.com/request/request/pull/1269) adds streams example for review (@tbuchok)
|
||||
- [#1238](https://github.com/request/request/pull/1238) Add examples README.md (@simov)
|
||||
|
||||
### v2.48.0 (2014/11/12)
|
||||
- [#1263](https://github.com/request/request/pull/1263) Fixed a syntax error / typo in README.md (@xna2)
|
||||
- [#1253](https://github.com/request/request/pull/1253) Add multipart chunked flag (@simov, @nylen)
|
||||
- [#1251](https://github.com/request/request/pull/1251) Clarify that defaults() does not modify global defaults (@nylen)
|
||||
- [#1250](https://github.com/request/request/pull/1250) Improve documentation for pool and maxSockets options (@nylen)
|
||||
- [#1237](https://github.com/request/request/pull/1237) Documenting error handling when using streams (@vmattos)
|
||||
- [#1244](https://github.com/request/request/pull/1244) Finalize changelog command (@nylen)
|
||||
- [#1241](https://github.com/request/request/pull/1241) Fix typo (@alexanderGugel)
|
||||
- [#1223](https://github.com/request/request/pull/1223) Show latest version number instead of "upcoming" in changelog (@nylen)
|
||||
- [#1236](https://github.com/request/request/pull/1236) Document how to use custom CA in README (#1229) (@hypesystem)
|
||||
- [#1228](https://github.com/request/request/pull/1228) Support for oauth with RSA-SHA1 signing (@nylen)
|
||||
- [#1216](https://github.com/request/request/pull/1216) Made json and multipart options coexist (@nylen, @simov)
|
||||
- [#1225](https://github.com/request/request/pull/1225) Allow header white/exclusive lists in any case. (@RReverser)
|
||||
|
||||
### v2.47.0 (2014/10/26)
|
||||
- [#1222](https://github.com/request/request/pull/1222) Move from mikeal/request to request/request (@nylen)
|
||||
- [#1220](https://github.com/request/request/pull/1220) update qs dependency to 2.3.1 (@FredKSchott)
|
||||
- [#1212](https://github.com/request/request/pull/1212) Improve tests/test-timeout.js (@nylen)
|
||||
- [#1219](https://github.com/request/request/pull/1219) remove old globalAgent workaround for node 0.4 (@request)
|
||||
- [#1214](https://github.com/request/request/pull/1214) Remove cruft left over from optional dependencies (@nylen)
|
||||
- [#1215](https://github.com/request/request/pull/1215) Add proxyHeaderExclusiveList option for proxy-only headers. (@RReverser)
|
||||
- [#1211](https://github.com/request/request/pull/1211) Allow 'Host' header instead of 'host' and remember case across redirects (@nylen)
|
||||
- [#1208](https://github.com/request/request/pull/1208) Improve release script (@nylen)
|
||||
- [#1213](https://github.com/request/request/pull/1213) Support for custom cookie store (@nylen, @mitsuru)
|
||||
- [#1197](https://github.com/request/request/pull/1197) Clean up some code around setting the agent (@FredKSchott)
|
||||
- [#1209](https://github.com/request/request/pull/1209) Improve multipart form append test (@simov)
|
||||
- [#1207](https://github.com/request/request/pull/1207) Update changelog (@nylen)
|
||||
- [#1185](https://github.com/request/request/pull/1185) Stream multipart/related bodies (@simov)
|
||||
|
||||
### v2.46.0 (2014/10/23)
|
||||
- [#1198](https://github.com/request/request/pull/1198) doc for TLS/SSL protocol options (@shawnzhu)
|
||||
- [#1200](https://github.com/request/request/pull/1200) Add a Gitter chat badge to README.md (@gitter-badger)
|
||||
- [#1196](https://github.com/request/request/pull/1196) Upgrade taper test reporter to v0.3.0 (@nylen)
|
||||
- [#1199](https://github.com/request/request/pull/1199) Fix lint error: undeclared var i (@nylen)
|
||||
- [#1191](https://github.com/request/request/pull/1191) Move self.proxy decision logic out of init and into a helper (@FredKSchott)
|
||||
- [#1190](https://github.com/request/request/pull/1190) Move _buildRequest() logic back into init (@FredKSchott)
|
||||
- [#1186](https://github.com/request/request/pull/1186) Support Smarter Unix URL Scheme (@FredKSchott)
|
||||
- [#1178](https://github.com/request/request/pull/1178) update form documentation for new usage (@FredKSchott)
|
||||
- [#1180](https://github.com/request/request/pull/1180) Enable no-mixed-requires linting rule (@nylen)
|
||||
- [#1184](https://github.com/request/request/pull/1184) Don't forward authorization header across redirects to different hosts (@nylen)
|
||||
- [#1183](https://github.com/request/request/pull/1183) Correct README about pre and postamble CRLF using multipart and not mult... (@netpoetica)
|
||||
- [#1179](https://github.com/request/request/pull/1179) Lint tests directory (@nylen)
|
||||
- [#1169](https://github.com/request/request/pull/1169) add metadata for form-data file field (@dotcypress)
|
||||
- [#1173](https://github.com/request/request/pull/1173) remove optional dependencies (@seanstrom)
|
||||
- [#1165](https://github.com/request/request/pull/1165) Cleanup event listeners and remove function creation from init (@FredKSchott)
|
||||
- [#1174](https://github.com/request/request/pull/1174) update the request.cookie docs to have a valid cookie example (@seanstrom)
|
||||
- [#1168](https://github.com/request/request/pull/1168) create a detach helper and use detach helper in replace of nextTick (@seanstrom)
|
||||
- [#1171](https://github.com/request/request/pull/1171) in post can send form data and use callback (@MiroRadenovic)
|
||||
- [#1159](https://github.com/request/request/pull/1159) accept charset for x-www-form-urlencoded content-type (@seanstrom)
|
||||
- [#1157](https://github.com/request/request/pull/1157) Update README.md: body with json=true (@Rob--W)
|
||||
- [#1164](https://github.com/request/request/pull/1164) Disable tests/test-timeout.js on Travis (@nylen)
|
||||
- [#1153](https://github.com/request/request/pull/1153) Document how to run a single test (@nylen)
|
||||
- [#1144](https://github.com/request/request/pull/1144) adds documentation for the "response" event within the streaming section (@tbuchok)
|
||||
- [#1162](https://github.com/request/request/pull/1162) Update eslintrc file to no longer allow past errors (@FredKSchott)
|
||||
- [#1155](https://github.com/request/request/pull/1155) Support/use self everywhere (@seanstrom)
|
||||
- [#1161](https://github.com/request/request/pull/1161) fix no-use-before-define lint warnings (@emkay)
|
||||
- [#1156](https://github.com/request/request/pull/1156) adding curly brackets to get rid of lint errors (@emkay)
|
||||
- [#1151](https://github.com/request/request/pull/1151) Fix localAddress test on OS X (@nylen)
|
||||
- [#1145](https://github.com/request/request/pull/1145) documentation: fix outdated reference to setCookieSync old name in README (@FredKSchott)
|
||||
- [#1131](https://github.com/request/request/pull/1131) Update pool documentation (@FredKSchott)
|
||||
- [#1143](https://github.com/request/request/pull/1143) Rewrite all tests to use tape (@nylen)
|
||||
- [#1137](https://github.com/request/request/pull/1137) Add ability to specifiy querystring lib in options. (@jgrund)
|
||||
- [#1138](https://github.com/request/request/pull/1138) allow hostname and port in place of host on uri (@cappslock)
|
||||
- [#1134](https://github.com/request/request/pull/1134) Fix multiple redirects and `self.followRedirect` (@blakeembrey)
|
||||
- [#1130](https://github.com/request/request/pull/1130) documentation fix: add note about npm test for contributing (@FredKSchott)
|
||||
- [#1120](https://github.com/request/request/pull/1120) Support/refactor request setup tunnel (@seanstrom)
|
||||
- [#1129](https://github.com/request/request/pull/1129) linting fix: convert double quote strings to use single quotes (@FredKSchott)
|
||||
- [#1124](https://github.com/request/request/pull/1124) linting fix: remove unneccesary semi-colons (@FredKSchott)
|
||||
|
||||
### v2.45.0 (2014/10/06)
|
||||
- [#1128](https://github.com/request/request/pull/1128) Add test for setCookie regression (@nylen)
|
||||
- [#1127](https://github.com/request/request/pull/1127) added tests around using objects as values in a query string (@bcoe)
|
||||
- [#1103](https://github.com/request/request/pull/1103) Support/refactor request constructor (@nylen, @seanstrom)
|
||||
- [#1119](https://github.com/request/request/pull/1119) add basic linting to request library (@FredKSchott)
|
||||
- [#1121](https://github.com/request/request/pull/1121) Revert "Explicitly use sync versions of cookie functions" (@nylen)
|
||||
- [#1118](https://github.com/request/request/pull/1118) linting fix: Restructure bad empty if statement (@FredKSchott)
|
||||
- [#1117](https://github.com/request/request/pull/1117) Fix a bad check for valid URIs (@FredKSchott)
|
||||
- [#1113](https://github.com/request/request/pull/1113) linting fix: space out operators (@FredKSchott)
|
||||
- [#1116](https://github.com/request/request/pull/1116) Fix typo in `noProxyHost` definition (@FredKSchott)
|
||||
- [#1114](https://github.com/request/request/pull/1114) linting fix: Added a `new` operator that was missing when creating and throwing a new error (@FredKSchott)
|
||||
- [#1096](https://github.com/request/request/pull/1096) No_proxy support (@samcday)
|
||||
- [#1107](https://github.com/request/request/pull/1107) linting-fix: remove unused variables (@FredKSchott)
|
||||
- [#1112](https://github.com/request/request/pull/1112) linting fix: Make return values consistent and more straitforward (@FredKSchott)
|
||||
- [#1111](https://github.com/request/request/pull/1111) linting fix: authPieces was getting redeclared (@FredKSchott)
|
||||
- [#1105](https://github.com/request/request/pull/1105) Use strict mode in request (@FredKSchott)
|
||||
- [#1110](https://github.com/request/request/pull/1110) linting fix: replace lazy '==' with more strict '===' (@FredKSchott)
|
||||
- [#1109](https://github.com/request/request/pull/1109) linting fix: remove function call from if-else conditional statement (@FredKSchott)
|
||||
- [#1102](https://github.com/request/request/pull/1102) Fix to allow setting a `requester` on recursive calls to `request.defaults` (@tikotzky)
|
||||
- [#1095](https://github.com/request/request/pull/1095) Tweaking engines in package.json (@pdehaan)
|
||||
- [#1082](https://github.com/request/request/pull/1082) Forward the socket event from the httpModule request (@seanstrom)
|
||||
- [#972](https://github.com/request/request/pull/972) Clarify gzip handling in the README (@kevinoid)
|
||||
- [#1089](https://github.com/request/request/pull/1089) Mention that encoding defaults to utf8, not Buffer (@stuartpb)
|
||||
- [#1088](https://github.com/request/request/pull/1088) Fix cookie example in README.md and make it more clear (@pipi32167)
|
||||
- [#1027](https://github.com/request/request/pull/1027) Add support for multipart form data in request options. (@crocket)
|
||||
- [#1076](https://github.com/request/request/pull/1076) use Request.abort() to abort the request when the request has timed-out (@seanstrom)
|
||||
- [#1068](https://github.com/request/request/pull/1068) add optional postamble required by .NET multipart requests (@netpoetica)
|
||||
|
||||
### v2.43.0 (2014/09/18)
|
||||
- [#1057](https://github.com/request/request/pull/1057) Defaults should not overwrite defined options (@davidwood)
|
||||
- [#1046](https://github.com/request/request/pull/1046) Propagate datastream errors, useful in case gzip fails. (@ZJONSSON, @Janpot)
|
||||
- [#1063](https://github.com/request/request/pull/1063) copy the input headers object #1060 (@finnp)
|
||||
- [#1031](https://github.com/request/request/pull/1031) Explicitly use sync versions of cookie functions (@ZJONSSON)
|
||||
- [#1056](https://github.com/request/request/pull/1056) Fix redirects when passing url.parse(x) as URL to convenience method (@nylen)
|
||||
|
||||
### v2.42.0 (2014/09/04)
|
||||
- [#1053](https://github.com/request/request/pull/1053) Fix #1051 Parse auth properly when using non-tunneling proxy (@isaacs)
|
||||
|
||||
### v2.41.0 (2014/09/04)
|
||||
- [#1050](https://github.com/request/request/pull/1050) Pass whitelisted headers to tunneling proxy. Organize all tunneling logic. (@isaacs, @Feldhacker)
|
||||
- [#1035](https://github.com/request/request/pull/1035) souped up nodei.co badge (@rvagg)
|
||||
- [#1048](https://github.com/request/request/pull/1048) Aws is now possible over a proxy (@steven-aerts)
|
||||
- [#1039](https://github.com/request/request/pull/1039) extract out helper functions to a helper file (@seanstrom)
|
||||
- [#1021](https://github.com/request/request/pull/1021) Support/refactor indexjs (@seanstrom)
|
||||
- [#1033](https://github.com/request/request/pull/1033) Improve and document debug options (@nylen)
|
||||
- [#1034](https://github.com/request/request/pull/1034) Fix readme headings (@nylen)
|
||||
- [#1030](https://github.com/request/request/pull/1030) Allow recursive request.defaults (@tikotzky)
|
||||
- [#1029](https://github.com/request/request/pull/1029) Fix a couple of typos (@nylen)
|
||||
- [#675](https://github.com/request/request/pull/675) Checking for SSL fault on connection before reading SSL properties (@VRMink)
|
||||
- [#989](https://github.com/request/request/pull/989) Added allowRedirect function. Should return true if redirect is allowed or false otherwise (@doronin)
|
||||
- [#1025](https://github.com/request/request/pull/1025) [fixes #1023] Set self._ended to true once response has ended (@mridgway)
|
||||
- [#1020](https://github.com/request/request/pull/1020) Add back removed debug metadata (@FredKSchott)
|
||||
- [#1008](https://github.com/request/request/pull/1008) Moving to module instead of cutomer buffer concatenation. (@mikeal)
|
||||
- [#770](https://github.com/request/request/pull/770) Added dependency badge for README file; (@timgluz, @mafintosh, @lalitkapoor, @stash, @bobyrizov)
|
||||
- [#1016](https://github.com/request/request/pull/1016) toJSON no longer results in an infinite loop, returns simple objects (@FredKSchott)
|
||||
- [#1018](https://github.com/request/request/pull/1018) Remove pre-0.4.4 HTTPS fix (@mmalecki)
|
||||
- [#1006](https://github.com/request/request/pull/1006) Migrate to caseless, fixes #1001 (@mikeal)
|
||||
- [#995](https://github.com/request/request/pull/995) Fix parsing array of objects (@sjonnet19)
|
||||
- [#999](https://github.com/request/request/pull/999) Fix fallback for browserify for optional modules. (@eiriksm)
|
||||
- [#996](https://github.com/request/request/pull/996) Wrong oauth signature when multiple same param keys exist [updated] (@bengl)
|
||||
|
||||
### v2.40.0 (2014/08/06)
|
||||
- [#992](https://github.com/request/request/pull/992) Fix security vulnerability. Update qs (@poeticninja)
|
||||
- [#988](https://github.com/request/request/pull/988) “--” -> “—” (@upisfree)
|
||||
- [#987](https://github.com/request/request/pull/987) Show optional modules as being loaded by the module that reqeusted them (@iarna)
|
||||
|
||||
### v2.39.0 (2014/07/24)
|
||||
- [#976](https://github.com/request/request/pull/976) Update README.md (@pvoznenko)
|
||||
|
||||
### v2.38.0 (2014/07/22)
|
||||
- [#952](https://github.com/request/request/pull/952) Adding support to client certificate with proxy use case (@ofirshaked)
|
||||
- [#884](https://github.com/request/request/pull/884) Documented tough-cookie installation. (@wbyoung)
|
||||
- [#935](https://github.com/request/request/pull/935) Correct repository url (@fritx)
|
||||
- [#963](https://github.com/request/request/pull/963) Update changelog (@nylen)
|
||||
- [#960](https://github.com/request/request/pull/960) Support gzip with encoding on node pre-v0.9.4 (@kevinoid)
|
||||
- [#953](https://github.com/request/request/pull/953) Add async Content-Length computation when using form-data (@LoicMahieu)
|
||||
- [#844](https://github.com/request/request/pull/844) Add support for HTTP[S]_PROXY environment variables. Fixes #595. (@jvmccarthy)
|
||||
- [#946](https://github.com/request/request/pull/946) defaults: merge headers (@aj0strow)
|
||||
|
||||
### v2.37.0 (2014/07/07)
|
||||
- [#957](https://github.com/request/request/pull/957) Silence EventEmitter memory leak warning #311 (@watson)
|
||||
- [#955](https://github.com/request/request/pull/955) check for content-length header before setting it in nextTick (@camilleanne)
|
||||
- [#951](https://github.com/request/request/pull/951) Add support for gzip content decoding (@kevinoid)
|
||||
- [#949](https://github.com/request/request/pull/949) Manually enter querystring in form option (@charlespwd)
|
||||
- [#944](https://github.com/request/request/pull/944) Make request work with browserify (@eiriksm)
|
||||
- [#943](https://github.com/request/request/pull/943) New mime module (@eiriksm)
|
||||
- [#927](https://github.com/request/request/pull/927) Bump version of hawk dep. (@samccone)
|
||||
- [#907](https://github.com/request/request/pull/907) append secureOptions to poolKey (@medovob)
|
||||
|
||||
### v2.35.0 (2014/05/17)
|
||||
- [#901](https://github.com/request/request/pull/901) Fixes #555 (@pigulla)
|
||||
- [#897](https://github.com/request/request/pull/897) merge with default options (@vohof)
|
||||
- [#891](https://github.com/request/request/pull/891) fixes 857 - options object is mutated by calling request (@lalitkapoor)
|
||||
- [#869](https://github.com/request/request/pull/869) Pipefilter test (@tgohn)
|
||||
- [#866](https://github.com/request/request/pull/866) Fix typo (@dandv)
|
||||
- [#861](https://github.com/request/request/pull/861) Add support for RFC 6750 Bearer Tokens (@phedny)
|
||||
- [#809](https://github.com/request/request/pull/809) upgrade tunnel-proxy to 0.4.0 (@ksato9700)
|
||||
- [#850](https://github.com/request/request/pull/850) Fix word consistency in readme (@0xNobody)
|
||||
- [#810](https://github.com/request/request/pull/810) add some exposition to mpu example in README.md (@mikermcneil)
|
||||
- [#840](https://github.com/request/request/pull/840) improve error reporting for invalid protocols (@FND)
|
||||
- [#821](https://github.com/request/request/pull/821) added secureOptions back (@nw)
|
||||
- [#815](https://github.com/request/request/pull/815) Create changelog based on pull requests (@lalitkapoor)
|
||||
|
||||
### v2.34.0 (2014/02/18)
|
||||
- [#516](https://github.com/request/request/pull/516) UNIX Socket URL Support (@lyuzashi)
|
||||
- [#801](https://github.com/request/request/pull/801) 794 ignore cookie parsing and domain errors (@lalitkapoor)
|
||||
- [#802](https://github.com/request/request/pull/802) Added the Apache license to the package.json. (@keskival)
|
||||
- [#793](https://github.com/request/request/pull/793) Adds content-length calculation when submitting forms using form-data li... (@Juul)
|
||||
- [#785](https://github.com/request/request/pull/785) Provide ability to override content-type when `json` option used (@vvo)
|
||||
- [#781](https://github.com/request/request/pull/781) simpler isReadStream function (@joaojeronimo)
|
||||
|
||||
### v2.32.0 (2014/01/16)
|
||||
- [#767](https://github.com/request/request/pull/767) Use tough-cookie CookieJar sync API (@stash)
|
||||
- [#764](https://github.com/request/request/pull/764) Case-insensitive authentication scheme (@bobyrizov)
|
||||
- [#763](https://github.com/request/request/pull/763) Upgrade tough-cookie to 0.10.0 (@stash)
|
||||
- [#744](https://github.com/request/request/pull/744) Use Cookie.parse (@lalitkapoor)
|
||||
- [#757](https://github.com/request/request/pull/757) require aws-sign2 (@mafintosh)
|
||||
|
||||
### v2.31.0 (2014/01/08)
|
||||
- [#645](https://github.com/request/request/pull/645) update twitter api url to v1.1 (@mick)
|
||||
- [#746](https://github.com/request/request/pull/746) README: Markdown code highlight (@weakish)
|
||||
- [#745](https://github.com/request/request/pull/745) updating setCookie example to make it clear that the callback is required (@emkay)
|
||||
- [#742](https://github.com/request/request/pull/742) Add note about JSON output body type (@iansltx)
|
||||
- [#741](https://github.com/request/request/pull/741) README example is using old cookie jar api (@emkay)
|
||||
- [#736](https://github.com/request/request/pull/736) Fix callback arguments documentation (@mmalecki)
|
||||
- [#732](https://github.com/request/request/pull/732) JSHINT: Creating global 'for' variable. Should be 'for (var ...'. (@Fritz-Lium)
|
||||
- [#730](https://github.com/request/request/pull/730) better HTTP DIGEST support (@dai-shi)
|
||||
- [#728](https://github.com/request/request/pull/728) Fix TypeError when calling request.cookie (@scarletmeow)
|
||||
- [#727](https://github.com/request/request/pull/727) fix requester bug (@jchris)
|
||||
- [#724](https://github.com/request/request/pull/724) README.md: add custom HTTP Headers example. (@tcort)
|
||||
- [#719](https://github.com/request/request/pull/719) Made a comment gender neutral. (@unsetbit)
|
||||
- [#715](https://github.com/request/request/pull/715) Request.multipart no longer crashes when header 'Content-type' present (@pastaclub)
|
||||
- [#710](https://github.com/request/request/pull/710) Fixing listing in callback part of docs. (@lukasz-zak)
|
||||
- [#696](https://github.com/request/request/pull/696) Edited README.md for formatting and clarity of phrasing (@Zearin)
|
||||
- [#694](https://github.com/request/request/pull/694) Typo in README (@VRMink)
|
||||
- [#690](https://github.com/request/request/pull/690) Handle blank password in basic auth. (@diversario)
|
||||
- [#682](https://github.com/request/request/pull/682) Optional dependencies (@Turbo87)
|
||||
- [#683](https://github.com/request/request/pull/683) Travis CI support (@Turbo87)
|
||||
- [#674](https://github.com/request/request/pull/674) change cookie module,to tough-cookie.please check it . (@sxyizhiren)
|
||||
- [#666](https://github.com/request/request/pull/666) make `ciphers` and `secureProtocol` to work in https request (@richarddong)
|
||||
- [#656](https://github.com/request/request/pull/656) Test case for #304. (@diversario)
|
||||
- [#662](https://github.com/request/request/pull/662) option.tunnel to explicitly disable tunneling (@seanmonstar)
|
||||
- [#659](https://github.com/request/request/pull/659) fix failure when running with NODE_DEBUG=request, and a test for that (@jrgm)
|
||||
- [#630](https://github.com/request/request/pull/630) Send random cnonce for HTTP Digest requests (@wprl)
|
||||
- [#619](https://github.com/request/request/pull/619) decouple things a bit (@joaojeronimo)
|
||||
- [#613](https://github.com/request/request/pull/613) Fixes #583, moved initialization of self.uri.pathname (@lexander)
|
||||
- [#605](https://github.com/request/request/pull/605) Only include ":" + pass in Basic Auth if it's defined (fixes #602) (@bendrucker)
|
||||
- [#596](https://github.com/request/request/pull/596) Global agent is being used when pool is specified (@Cauldrath)
|
||||
- [#594](https://github.com/request/request/pull/594) Emit complete event when there is no callback (@RomainLK)
|
||||
- [#601](https://github.com/request/request/pull/601) Fixed a small typo (@michalstanko)
|
||||
- [#589](https://github.com/request/request/pull/589) Prevent setting headers after they are sent (@geek)
|
||||
- [#587](https://github.com/request/request/pull/587) Global cookie jar disabled by default (@threepointone)
|
||||
- [#544](https://github.com/request/request/pull/544) Update http-signature version. (@davidlehn)
|
||||
- [#581](https://github.com/request/request/pull/581) Fix spelling of "ignoring." (@bigeasy)
|
||||
- [#568](https://github.com/request/request/pull/568) use agentOptions to create agent when specified in request (@SamPlacette)
|
||||
- [#564](https://github.com/request/request/pull/564) Fix redirections (@criloz)
|
||||
- [#541](https://github.com/request/request/pull/541) The exported request function doesn't have an auth method (@tschaub)
|
||||
- [#542](https://github.com/request/request/pull/542) Expose Request class (@regality)
|
||||
- [#536](https://github.com/request/request/pull/536) Allow explicitly empty user field for basic authentication. (@mikeando)
|
||||
- [#532](https://github.com/request/request/pull/532) fix typo (@fredericosilva)
|
||||
- [#497](https://github.com/request/request/pull/497) Added redirect event (@Cauldrath)
|
||||
- [#503](https://github.com/request/request/pull/503) Fix basic auth for passwords that contain colons (@tonistiigi)
|
||||
- [#521](https://github.com/request/request/pull/521) Improving test-localAddress.js (@noway)
|
||||
- [#529](https://github.com/request/request/pull/529) dependencies versions bump (@jodaka)
|
||||
- [#523](https://github.com/request/request/pull/523) Updating dependencies (@noway)
|
||||
- [#520](https://github.com/request/request/pull/520) Fixing test-tunnel.js (@noway)
|
||||
- [#519](https://github.com/request/request/pull/519) Update internal path state on post-creation QS changes (@jblebrun)
|
||||
- [#510](https://github.com/request/request/pull/510) Add HTTP Signature support. (@davidlehn)
|
||||
- [#502](https://github.com/request/request/pull/502) Fix POST (and probably other) requests that are retried after 401 Unauthorized (@nylen)
|
||||
- [#508](https://github.com/request/request/pull/508) Honor the .strictSSL option when using proxies (tunnel-agent) (@jhs)
|
||||
- [#512](https://github.com/request/request/pull/512) Make password optional to support the format: http://username@hostname/ (@pajato1)
|
||||
- [#513](https://github.com/request/request/pull/513) add 'localAddress' support (@yyfrankyy)
|
||||
- [#498](https://github.com/request/request/pull/498) Moving response emit above setHeaders on destination streams (@kenperkins)
|
||||
- [#490](https://github.com/request/request/pull/490) Empty response body (3-rd argument) must be passed to callback as an empty string (@Olegas)
|
||||
- [#479](https://github.com/request/request/pull/479) Changing so if Accept header is explicitly set, sending json does not ov... (@RoryH)
|
||||
- [#475](https://github.com/request/request/pull/475) Use `unescape` from `querystring` (@shimaore)
|
||||
- [#473](https://github.com/request/request/pull/473) V0.10 compat (@isaacs)
|
||||
- [#471](https://github.com/request/request/pull/471) Using querystring library from visionmedia (@kbackowski)
|
||||
- [#461](https://github.com/request/request/pull/461) Strip the UTF8 BOM from a UTF encoded response (@kppullin)
|
||||
- [#460](https://github.com/request/request/pull/460) hawk 0.10.0 (@hueniverse)
|
||||
- [#462](https://github.com/request/request/pull/462) if query params are empty, then request path shouldn't end with a '?' (merges cleanly now) (@jaipandya)
|
||||
- [#456](https://github.com/request/request/pull/456) hawk 0.9.0 (@hueniverse)
|
||||
- [#429](https://github.com/request/request/pull/429) Copy options before adding callback. (@nrn, @nfriedly, @youurayy, @jplock, @kapetan, @landeiro, @othiym23, @mmalecki)
|
||||
- [#454](https://github.com/request/request/pull/454) Destroy the response if present when destroying the request (clean merge) (@mafintosh)
|
||||
- [#310](https://github.com/request/request/pull/310) Twitter Oauth Stuff Out of Date; Now Updated (@joemccann, @isaacs, @mscdex)
|
||||
- [#413](https://github.com/request/request/pull/413) rename googledoodle.png to .jpg (@nfriedly, @youurayy, @jplock, @kapetan, @landeiro, @othiym23, @mmalecki)
|
||||
- [#448](https://github.com/request/request/pull/448) Convenience method for PATCH (@mloar)
|
||||
- [#444](https://github.com/request/request/pull/444) protect against double callbacks on error path (@spollack)
|
||||
- [#433](https://github.com/request/request/pull/433) Added support for HTTPS cert & key (@mmalecki)
|
||||
- [#430](https://github.com/request/request/pull/430) Respect specified {Host,host} headers, not just {host} (@andrewschaaf)
|
||||
- [#415](https://github.com/request/request/pull/415) Fixed a typo. (@jerem)
|
||||
- [#338](https://github.com/request/request/pull/338) Add more auth options, including digest support (@nylen)
|
||||
- [#403](https://github.com/request/request/pull/403) Optimize environment lookup to happen once only (@mmalecki)
|
||||
- [#398](https://github.com/request/request/pull/398) Add more reporting to tests (@mmalecki)
|
||||
- [#388](https://github.com/request/request/pull/388) Ensure "safe" toJSON doesn't break EventEmitters (@othiym23)
|
||||
- [#381](https://github.com/request/request/pull/381) Resolving "Invalid signature. Expected signature base string: " (@landeiro)
|
||||
- [#380](https://github.com/request/request/pull/380) Fixes missing host header on retried request when using forever agent (@mac-)
|
||||
- [#376](https://github.com/request/request/pull/376) Headers lost on redirect (@kapetan)
|
||||
- [#375](https://github.com/request/request/pull/375) Fix for missing oauth_timestamp parameter (@jplock)
|
||||
- [#374](https://github.com/request/request/pull/374) Correct Host header for proxy tunnel CONNECT (@youurayy)
|
||||
- [#370](https://github.com/request/request/pull/370) Twitter reverse auth uses x_auth_mode not x_auth_type (@drudge)
|
||||
- [#369](https://github.com/request/request/pull/369) Don't remove x_auth_mode for Twitter reverse auth (@drudge)
|
||||
- [#344](https://github.com/request/request/pull/344) Make AWS auth signing find headers correctly (@nlf)
|
||||
- [#363](https://github.com/request/request/pull/363) rfc3986 on base_uri, now passes tests (@jeffmarshall)
|
||||
- [#362](https://github.com/request/request/pull/362) Running `rfc3986` on `base_uri` in `oauth.hmacsign` instead of just `encodeURIComponent` (@jeffmarshall)
|
||||
- [#361](https://github.com/request/request/pull/361) Don't create a Content-Length header if we already have it set (@danjenkins)
|
||||
- [#360](https://github.com/request/request/pull/360) Delete self._form along with everything else on redirect (@jgautier)
|
||||
- [#355](https://github.com/request/request/pull/355) stop sending erroneous headers on redirected requests (@azylman)
|
||||
- [#332](https://github.com/request/request/pull/332) Fix #296 - Only set Content-Type if body exists (@Marsup)
|
||||
- [#343](https://github.com/request/request/pull/343) Allow AWS to work in more situations, added a note in the README on its usage (@nlf)
|
||||
- [#320](https://github.com/request/request/pull/320) request.defaults() doesn't need to wrap jar() (@StuartHarris)
|
||||
- [#322](https://github.com/request/request/pull/322) Fix + test for piped into request bumped into redirect. #321 (@alexindigo)
|
||||
- [#326](https://github.com/request/request/pull/326) Do not try to remove listener from an undefined connection (@CartoDB)
|
||||
- [#318](https://github.com/request/request/pull/318) Pass servername to tunneling secure socket creation (@isaacs)
|
||||
- [#317](https://github.com/request/request/pull/317) Workaround for #313 (@isaacs)
|
||||
- [#293](https://github.com/request/request/pull/293) Allow parser errors to bubble up to request (@mscdex)
|
||||
- [#290](https://github.com/request/request/pull/290) A test for #289 (@isaacs)
|
||||
- [#280](https://github.com/request/request/pull/280) Like in node.js print options if NODE_DEBUG contains the word request (@Filirom1)
|
||||
- [#207](https://github.com/request/request/pull/207) Fix #206 Change HTTP/HTTPS agent when redirecting between protocols (@isaacs)
|
||||
- [#214](https://github.com/request/request/pull/214) documenting additional behavior of json option (@jphaas, @vpulim)
|
||||
- [#272](https://github.com/request/request/pull/272) Boundary begins with CRLF? (@elspoono, @timshadel, @naholyr, @nanodocumet, @TehShrike)
|
||||
- [#284](https://github.com/request/request/pull/284) Remove stray `console.log()` call in multipart generator. (@bcherry)
|
||||
- [#241](https://github.com/request/request/pull/241) Composability updates suggested by issue #239 (@polotek)
|
||||
- [#282](https://github.com/request/request/pull/282) OAuth Authorization header contains non-"oauth_" parameters (@jplock)
|
||||
- [#279](https://github.com/request/request/pull/279) fix tests with boundary by injecting boundry from header (@benatkin)
|
||||
- [#273](https://github.com/request/request/pull/273) Pipe back pressure issue (@mafintosh)
|
||||
- [#268](https://github.com/request/request/pull/268) I'm not OCD seriously (@TehShrike)
|
||||
- [#263](https://github.com/request/request/pull/263) Bug in OAuth key generation for sha1 (@nanodocumet)
|
||||
- [#265](https://github.com/request/request/pull/265) uncaughtException when redirected to invalid URI (@naholyr)
|
||||
- [#262](https://github.com/request/request/pull/262) JSON test should check for equality (@timshadel)
|
||||
- [#261](https://github.com/request/request/pull/261) Setting 'pool' to 'false' does NOT disable Agent pooling (@timshadel)
|
||||
- [#249](https://github.com/request/request/pull/249) Fix for the fix of your (closed) issue #89 where self.headers[content-length] is set to 0 for all methods (@sethbridges, @polotek, @zephrax, @jeromegn)
|
||||
- [#255](https://github.com/request/request/pull/255) multipart allow body === '' ( the empty string ) (@Filirom1)
|
||||
- [#260](https://github.com/request/request/pull/260) fixed just another leak of 'i' (@sreuter)
|
||||
- [#246](https://github.com/request/request/pull/246) Fixing the set-cookie header (@jeromegn)
|
||||
- [#243](https://github.com/request/request/pull/243) Dynamic boundary (@zephrax)
|
||||
- [#240](https://github.com/request/request/pull/240) don't error when null is passed for options (@polotek)
|
||||
- [#211](https://github.com/request/request/pull/211) Replace all occurrences of special chars in RFC3986 (@chriso, @vpulim)
|
||||
- [#224](https://github.com/request/request/pull/224) Multipart content-type change (@janjongboom)
|
||||
- [#217](https://github.com/request/request/pull/217) need to use Authorization (titlecase) header with Tumblr OAuth (@visnup)
|
||||
- [#203](https://github.com/request/request/pull/203) Fix cookie and redirect bugs and add auth support for HTTPS tunnel (@vpulim)
|
||||
- [#199](https://github.com/request/request/pull/199) Tunnel (@isaacs)
|
||||
- [#198](https://github.com/request/request/pull/198) Bugfix on forever usage of util.inherits (@isaacs)
|
||||
- [#197](https://github.com/request/request/pull/197) Make ForeverAgent work with HTTPS (@isaacs)
|
||||
- [#193](https://github.com/request/request/pull/193) Fixes GH-119 (@goatslacker)
|
||||
- [#188](https://github.com/request/request/pull/188) Add abort support to the returned request (@itay)
|
||||
- [#176](https://github.com/request/request/pull/176) Querystring option (@csainty)
|
||||
- [#182](https://github.com/request/request/pull/182) Fix request.defaults to support (uri, options, callback) api (@twilson63)
|
||||
- [#180](https://github.com/request/request/pull/180) Modified the post, put, head and del shortcuts to support uri optional param (@twilson63)
|
||||
- [#179](https://github.com/request/request/pull/179) fix to add opts in .pipe(stream, opts) (@substack)
|
||||
- [#177](https://github.com/request/request/pull/177) Issue #173 Support uri as first and optional config as second argument (@twilson63)
|
||||
- [#170](https://github.com/request/request/pull/170) can't create a cookie in a wrapped request (defaults) (@fabianonunes)
|
||||
- [#168](https://github.com/request/request/pull/168) Picking off an EasyFix by adding some missing mimetypes. (@serby)
|
||||
- [#161](https://github.com/request/request/pull/161) Fix cookie jar/headers.cookie collision (#125) (@papandreou)
|
||||
- [#162](https://github.com/request/request/pull/162) Fix issue #159 (@dpetukhov)
|
||||
- [#90](https://github.com/request/request/pull/90) add option followAllRedirects to follow post/put redirects (@jroes)
|
||||
- [#148](https://github.com/request/request/pull/148) Retry Agent (@thejh)
|
||||
- [#146](https://github.com/request/request/pull/146) Multipart should respect content-type if previously set (@apeace)
|
||||
- [#144](https://github.com/request/request/pull/144) added "form" option to readme (@petejkim)
|
||||
- [#133](https://github.com/request/request/pull/133) Fixed cookies parsing (@afanasy)
|
||||
- [#135](https://github.com/request/request/pull/135) host vs hostname (@iangreenleaf)
|
||||
- [#132](https://github.com/request/request/pull/132) return the body as a Buffer when encoding is set to null (@jahewson)
|
||||
- [#112](https://github.com/request/request/pull/112) Support using a custom http-like module (@jhs)
|
||||
- [#104](https://github.com/request/request/pull/104) Cookie handling contains bugs (@janjongboom)
|
||||
- [#121](https://github.com/request/request/pull/121) Another patch for cookie handling regression (@jhurliman)
|
||||
- [#117](https://github.com/request/request/pull/117) Remove the global `i` (@3rd-Eden)
|
||||
- [#110](https://github.com/request/request/pull/110) Update to Iris Couch URL (@jhs)
|
||||
- [#86](https://github.com/request/request/pull/86) Can't post binary to multipart requests (@kkaefer)
|
||||
- [#105](https://github.com/request/request/pull/105) added test for proxy option. (@dominictarr)
|
||||
- [#102](https://github.com/request/request/pull/102) Implemented cookies - closes issue 82: https://github.com/mikeal/request/issues/82 (@alessioalex)
|
||||
- [#97](https://github.com/request/request/pull/97) Typo in previous pull causes TypeError in non-0.5.11 versions (@isaacs)
|
||||
- [#96](https://github.com/request/request/pull/96) Authless parsed url host support (@isaacs)
|
||||
- [#81](https://github.com/request/request/pull/81) Enhance redirect handling (@danmactough)
|
||||
- [#78](https://github.com/request/request/pull/78) Don't try to do strictSSL for non-ssl connections (@isaacs)
|
||||
- [#76](https://github.com/request/request/pull/76) Bug when a request fails and a timeout is set (@Marsup)
|
||||
- [#70](https://github.com/request/request/pull/70) add test script to package.json (@isaacs, @aheckmann)
|
||||
- [#73](https://github.com/request/request/pull/73) Fix #71 Respect the strictSSL flag (@isaacs)
|
||||
- [#69](https://github.com/request/request/pull/69) Flatten chunked requests properly (@isaacs)
|
||||
- [#67](https://github.com/request/request/pull/67) fixed global variable leaks (@aheckmann)
|
||||
- [#66](https://github.com/request/request/pull/66) Do not overwrite established content-type headers for read stream deliver (@voodootikigod)
|
||||
- [#53](https://github.com/request/request/pull/53) Parse json: Issue #51 (@benatkin)
|
||||
- [#45](https://github.com/request/request/pull/45) Added timeout option (@mbrevoort)
|
||||
- [#35](https://github.com/request/request/pull/35) The "end" event isn't emitted for some responses (@voxpelli)
|
||||
- [#31](https://github.com/request/request/pull/31) Error on piping a request to a destination (@tobowers)
|
55
node_modules/request/LICENSE
generated
vendored
Normal file
55
node_modules/request/LICENSE
generated
vendored
Normal file
|
@ -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
|
1097
node_modules/request/README.md
generated
vendored
Normal file
1097
node_modules/request/README.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
155
node_modules/request/index.js
generated
vendored
Normal file
155
node_modules/request/index.js
generated
vendored
Normal file
|
@ -0,0 +1,155 @@
|
|||
// Copyright 2010-2012 Mikeal Rogers
|
||||
//
|
||||
// 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.
|
||||
|
||||
'use strict'
|
||||
|
||||
var extend = require('extend')
|
||||
var cookies = require('./lib/cookies')
|
||||
var helpers = require('./lib/helpers')
|
||||
|
||||
var paramsHaveRequestBody = helpers.paramsHaveRequestBody
|
||||
|
||||
// organize params for patch, post, put, head, del
|
||||
function initParams (uri, options, callback) {
|
||||
if (typeof options === 'function') {
|
||||
callback = options
|
||||
}
|
||||
|
||||
var params = {}
|
||||
if (typeof options === 'object') {
|
||||
extend(params, options, {uri: uri})
|
||||
} else if (typeof uri === 'string') {
|
||||
extend(params, {uri: uri})
|
||||
} else {
|
||||
extend(params, uri)
|
||||
}
|
||||
|
||||
params.callback = callback || params.callback
|
||||
return params
|
||||
}
|
||||
|
||||
function request (uri, options, callback) {
|
||||
if (typeof uri === 'undefined') {
|
||||
throw new Error('undefined is not a valid uri or options object.')
|
||||
}
|
||||
|
||||
var params = initParams(uri, options, callback)
|
||||
|
||||
if (params.method === 'HEAD' && paramsHaveRequestBody(params)) {
|
||||
throw new Error('HTTP HEAD requests MUST NOT include a request body.')
|
||||
}
|
||||
|
||||
return new request.Request(params)
|
||||
}
|
||||
|
||||
function verbFunc (verb) {
|
||||
var method = verb.toUpperCase()
|
||||
return function (uri, options, callback) {
|
||||
var params = initParams(uri, options, callback)
|
||||
params.method = method
|
||||
return request(params, params.callback)
|
||||
}
|
||||
}
|
||||
|
||||
// define like this to please codeintel/intellisense IDEs
|
||||
request.get = verbFunc('get')
|
||||
request.head = verbFunc('head')
|
||||
request.options = verbFunc('options')
|
||||
request.post = verbFunc('post')
|
||||
request.put = verbFunc('put')
|
||||
request.patch = verbFunc('patch')
|
||||
request.del = verbFunc('delete')
|
||||
request['delete'] = verbFunc('delete')
|
||||
|
||||
request.jar = function (store) {
|
||||
return cookies.jar(store)
|
||||
}
|
||||
|
||||
request.cookie = function (str) {
|
||||
return cookies.parse(str)
|
||||
}
|
||||
|
||||
function wrapRequestMethod (method, options, requester, verb) {
|
||||
return function (uri, opts, callback) {
|
||||
var params = initParams(uri, opts, callback)
|
||||
|
||||
var target = {}
|
||||
extend(true, target, options, params)
|
||||
|
||||
target.pool = params.pool || options.pool
|
||||
|
||||
if (verb) {
|
||||
target.method = verb.toUpperCase()
|
||||
}
|
||||
|
||||
if (typeof requester === 'function') {
|
||||
method = requester
|
||||
}
|
||||
|
||||
return method(target, target.callback)
|
||||
}
|
||||
}
|
||||
|
||||
request.defaults = function (options, requester) {
|
||||
var self = this
|
||||
|
||||
options = options || {}
|
||||
|
||||
if (typeof options === 'function') {
|
||||
requester = options
|
||||
options = {}
|
||||
}
|
||||
|
||||
var defaults = wrapRequestMethod(self, options, requester)
|
||||
|
||||
var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete']
|
||||
verbs.forEach(function (verb) {
|
||||
defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb)
|
||||
})
|
||||
|
||||
defaults.cookie = wrapRequestMethod(self.cookie, options, requester)
|
||||
defaults.jar = self.jar
|
||||
defaults.defaults = self.defaults
|
||||
return defaults
|
||||
}
|
||||
|
||||
request.forever = function (agentOptions, optionsArg) {
|
||||
var options = {}
|
||||
if (optionsArg) {
|
||||
extend(options, optionsArg)
|
||||
}
|
||||
if (agentOptions) {
|
||||
options.agentOptions = agentOptions
|
||||
}
|
||||
|
||||
options.forever = true
|
||||
return request.defaults(options)
|
||||
}
|
||||
|
||||
// Exports
|
||||
|
||||
module.exports = request
|
||||
request.Request = require('./request')
|
||||
request.initParams = initParams
|
||||
|
||||
// Backwards compatibility for request.debug
|
||||
Object.defineProperty(request, 'debug', {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return request.Request.debug
|
||||
},
|
||||
set: function (debug) {
|
||||
request.Request.debug = debug
|
||||
}
|
||||
})
|
167
node_modules/request/lib/auth.js
generated
vendored
Normal file
167
node_modules/request/lib/auth.js
generated
vendored
Normal file
|
@ -0,0 +1,167 @@
|
|||
'use strict'
|
||||
|
||||
var caseless = require('caseless')
|
||||
var uuid = require('uuid/v4')
|
||||
var helpers = require('./helpers')
|
||||
|
||||
var md5 = helpers.md5
|
||||
var toBase64 = helpers.toBase64
|
||||
|
||||
function Auth (request) {
|
||||
// define all public properties here
|
||||
this.request = request
|
||||
this.hasAuth = false
|
||||
this.sentAuth = false
|
||||
this.bearerToken = null
|
||||
this.user = null
|
||||
this.pass = null
|
||||
}
|
||||
|
||||
Auth.prototype.basic = function (user, pass, sendImmediately) {
|
||||
var self = this
|
||||
if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) {
|
||||
self.request.emit('error', new Error('auth() received invalid user or password'))
|
||||
}
|
||||
self.user = user
|
||||
self.pass = pass
|
||||
self.hasAuth = true
|
||||
var header = user + ':' + (pass || '')
|
||||
if (sendImmediately || typeof sendImmediately === 'undefined') {
|
||||
var authHeader = 'Basic ' + toBase64(header)
|
||||
self.sentAuth = true
|
||||
return authHeader
|
||||
}
|
||||
}
|
||||
|
||||
Auth.prototype.bearer = function (bearer, sendImmediately) {
|
||||
var self = this
|
||||
self.bearerToken = bearer
|
||||
self.hasAuth = true
|
||||
if (sendImmediately || typeof sendImmediately === 'undefined') {
|
||||
if (typeof bearer === 'function') {
|
||||
bearer = bearer()
|
||||
}
|
||||
var authHeader = 'Bearer ' + (bearer || '')
|
||||
self.sentAuth = true
|
||||
return authHeader
|
||||
}
|
||||
}
|
||||
|
||||
Auth.prototype.digest = function (method, path, authHeader) {
|
||||
// TODO: More complete implementation of RFC 2617.
|
||||
// - handle challenge.domain
|
||||
// - support qop="auth-int" only
|
||||
// - handle Authentication-Info (not necessarily?)
|
||||
// - check challenge.stale (not necessarily?)
|
||||
// - increase nc (not necessarily?)
|
||||
// For reference:
|
||||
// http://tools.ietf.org/html/rfc2617#section-3
|
||||
// https://github.com/bagder/curl/blob/master/lib/http_digest.c
|
||||
|
||||
var self = this
|
||||
|
||||
var challenge = {}
|
||||
var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi
|
||||
for (;;) {
|
||||
var match = re.exec(authHeader)
|
||||
if (!match) {
|
||||
break
|
||||
}
|
||||
challenge[match[1]] = match[2] || match[3]
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
var authValues = {
|
||||
username: self.user,
|
||||
realm: challenge.realm,
|
||||
nonce: challenge.nonce,
|
||||
uri: path,
|
||||
qop: qop,
|
||||
response: digestResponse,
|
||||
nc: nc,
|
||||
cnonce: cnonce,
|
||||
algorithm: challenge.algorithm,
|
||||
opaque: challenge.opaque
|
||||
}
|
||||
|
||||
authHeader = []
|
||||
for (var k in authValues) {
|
||||
if (authValues[k]) {
|
||||
if (k === 'qop' || k === 'nc' || k === 'algorithm') {
|
||||
authHeader.push(k + '=' + authValues[k])
|
||||
} else {
|
||||
authHeader.push(k + '="' + authValues[k] + '"')
|
||||
}
|
||||
}
|
||||
}
|
||||
authHeader = 'Digest ' + authHeader.join(', ')
|
||||
self.sentAuth = true
|
||||
return authHeader
|
||||
}
|
||||
|
||||
Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) {
|
||||
var self = this
|
||||
var request = self.request
|
||||
|
||||
var authHeader
|
||||
if (bearer === undefined && user === undefined) {
|
||||
self.request.emit('error', new Error('no auth mechanism defined'))
|
||||
} else if (bearer !== undefined) {
|
||||
authHeader = self.bearer(bearer, sendImmediately)
|
||||
} else {
|
||||
authHeader = self.basic(user, pass, sendImmediately)
|
||||
}
|
||||
if (authHeader) {
|
||||
request.setHeader('authorization', authHeader)
|
||||
}
|
||||
}
|
||||
|
||||
Auth.prototype.onResponse = function (response) {
|
||||
var self = this
|
||||
var request = self.request
|
||||
|
||||
if (!self.hasAuth || self.sentAuth) { return null }
|
||||
|
||||
var c = caseless(response.headers)
|
||||
|
||||
var authHeader = c.get('www-authenticate')
|
||||
var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase()
|
||||
request.debug('reauth', authVerb)
|
||||
|
||||
switch (authVerb) {
|
||||
case 'basic':
|
||||
return self.basic(self.user, self.pass, true)
|
||||
|
||||
case 'bearer':
|
||||
return self.bearer(self.bearerToken, true)
|
||||
|
||||
case 'digest':
|
||||
return self.digest(request.method, request.path, authHeader)
|
||||
}
|
||||
}
|
||||
|
||||
exports.Auth = Auth
|
38
node_modules/request/lib/cookies.js
generated
vendored
Normal file
38
node_modules/request/lib/cookies.js
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
'use strict'
|
||||
|
||||
var tough = require('tough-cookie')
|
||||
|
||||
var Cookie = tough.Cookie
|
||||
var CookieJar = tough.CookieJar
|
||||
|
||||
exports.parse = function (str) {
|
||||
if (str && str.uri) {
|
||||
str = str.uri
|
||||
}
|
||||
if (typeof str !== 'string') {
|
||||
throw new Error('The cookie function only accepts STRING as param')
|
||||
}
|
||||
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, {looseMode: true})
|
||||
}
|
||||
RequestJar.prototype.setCookie = function (cookieOrStr, uri, options) {
|
||||
var self = this
|
||||
return self._jar.setCookieSync(cookieOrStr, uri, options || {})
|
||||
}
|
||||
RequestJar.prototype.getCookieString = function (uri) {
|
||||
var self = this
|
||||
return self._jar.getCookieStringSync(uri)
|
||||
}
|
||||
RequestJar.prototype.getCookies = function (uri) {
|
||||
var self = this
|
||||
return self._jar.getCookiesSync(uri)
|
||||
}
|
||||
|
||||
exports.jar = function (store) {
|
||||
return new RequestJar(store)
|
||||
}
|
79
node_modules/request/lib/getProxyFromURI.js
generated
vendored
Normal file
79
node_modules/request/lib/getProxyFromURI.js
generated
vendored
Normal file
|
@ -0,0 +1,79 @@
|
|||
'use strict'
|
||||
|
||||
function formatHostname (hostname) {
|
||||
// canonicalize the hostname, so that 'oogle.com' won't match 'google.com'
|
||||
return hostname.replace(/^\.*/, '.').toLowerCase()
|
||||
}
|
||||
|
||||
function parseNoProxyZone (zone) {
|
||||
zone = zone.trim().toLowerCase()
|
||||
|
||||
var zoneParts = zone.split(':', 2)
|
||||
var zoneHost = formatHostname(zoneParts[0])
|
||||
var zonePort = zoneParts[1]
|
||||
var hasPort = zone.indexOf(':') > -1
|
||||
|
||||
return {hostname: zoneHost, port: zonePort, hasPort: hasPort}
|
||||
}
|
||||
|
||||
function uriInNoProxy (uri, noProxy) {
|
||||
var port = uri.port || (uri.protocol === 'https:' ? '443' : '80')
|
||||
var hostname = formatHostname(uri.hostname)
|
||||
var noProxyList = noProxy.split(',')
|
||||
|
||||
// iterate through the noProxyList until it finds a match.
|
||||
return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) {
|
||||
var isMatchedAt = hostname.indexOf(noProxyZone.hostname)
|
||||
var hostnameMatched = (
|
||||
isMatchedAt > -1 &&
|
||||
(isMatchedAt === hostname.length - noProxyZone.hostname.length)
|
||||
)
|
||||
|
||||
if (noProxyZone.hasPort) {
|
||||
return (port === noProxyZone.port) && hostnameMatched
|
||||
}
|
||||
|
||||
return hostnameMatched
|
||||
})
|
||||
}
|
||||
|
||||
function getProxyFromURI (uri) {
|
||||
// Decide the proper request proxy to use based on the request URI object and the
|
||||
// environmental variables (NO_PROXY, HTTP_PROXY, etc.)
|
||||
// respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html)
|
||||
|
||||
var noProxy = process.env.NO_PROXY || process.env.no_proxy || ''
|
||||
|
||||
// if the noProxy is a wildcard then return null
|
||||
|
||||
if (noProxy === '*') {
|
||||
return null
|
||||
}
|
||||
|
||||
// if the noProxy is not empty and the uri is found return null
|
||||
|
||||
if (noProxy !== '' && uriInNoProxy(uri, noProxy)) {
|
||||
return null
|
||||
}
|
||||
|
||||
// Check for HTTP or HTTPS Proxy in environment Else default to null
|
||||
|
||||
if (uri.protocol === 'http:') {
|
||||
return process.env.HTTP_PROXY ||
|
||||
process.env.http_proxy || null
|
||||
}
|
||||
|
||||
if (uri.protocol === 'https:') {
|
||||
return process.env.HTTPS_PROXY ||
|
||||
process.env.https_proxy ||
|
||||
process.env.HTTP_PROXY ||
|
||||
process.env.http_proxy || null
|
||||
}
|
||||
|
||||
// if none of that works, return null
|
||||
// (What uri protocol are you using then?)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
module.exports = getProxyFromURI
|
205
node_modules/request/lib/har.js
generated
vendored
Normal file
205
node_modules/request/lib/har.js
generated
vendored
Normal file
|
@ -0,0 +1,205 @@
|
|||
'use strict'
|
||||
|
||||
var fs = require('fs')
|
||||
var qs = require('querystring')
|
||||
var validate = require('har-validator')
|
||||
var extend = require('extend')
|
||||
|
||||
function Har (request) {
|
||||
this.request = request
|
||||
}
|
||||
|
||||
Har.prototype.reducer = function (obj, pair) {
|
||||
// new property ?
|
||||
if (obj[pair.name] === undefined) {
|
||||
obj[pair.name] = pair.value
|
||||
return obj
|
||||
}
|
||||
|
||||
// existing? convert to array
|
||||
var arr = [
|
||||
obj[pair.name],
|
||||
pair.value
|
||||
]
|
||||
|
||||
obj[pair.name] = arr
|
||||
|
||||
return obj
|
||||
}
|
||||
|
||||
Har.prototype.prep = function (data) {
|
||||
// construct utility properties
|
||||
data.queryObj = {}
|
||||
data.headersObj = {}
|
||||
data.postData.jsonObj = false
|
||||
data.postData.paramsObj = false
|
||||
|
||||
// construct query objects
|
||||
if (data.queryString && data.queryString.length) {
|
||||
data.queryObj = data.queryString.reduce(this.reducer, {})
|
||||
}
|
||||
|
||||
// construct headers objects
|
||||
if (data.headers && data.headers.length) {
|
||||
// loweCase header keys
|
||||
data.headersObj = data.headers.reduceRight(function (headers, header) {
|
||||
headers[header.name] = header.value
|
||||
return headers
|
||||
}, {})
|
||||
}
|
||||
|
||||
// construct Cookie header
|
||||
if (data.cookies && data.cookies.length) {
|
||||
var cookies = data.cookies.map(function (cookie) {
|
||||
return cookie.name + '=' + cookie.value
|
||||
})
|
||||
|
||||
if (cookies.length) {
|
||||
data.headersObj.cookie = cookies.join('; ')
|
||||
}
|
||||
}
|
||||
|
||||
// prep body
|
||||
function some (arr) {
|
||||
return arr.some(function (type) {
|
||||
return data.postData.mimeType.indexOf(type) === 0
|
||||
})
|
||||
}
|
||||
|
||||
if (some([
|
||||
'multipart/mixed',
|
||||
'multipart/related',
|
||||
'multipart/form-data',
|
||||
'multipart/alternative'])) {
|
||||
// reset values
|
||||
data.postData.mimeType = 'multipart/form-data'
|
||||
} else if (some([
|
||||
'application/x-www-form-urlencoded'])) {
|
||||
if (!data.postData.params) {
|
||||
data.postData.text = ''
|
||||
} else {
|
||||
data.postData.paramsObj = data.postData.params.reduce(this.reducer, {})
|
||||
|
||||
// always overwrite
|
||||
data.postData.text = qs.stringify(data.postData.paramsObj)
|
||||
}
|
||||
} else if (some([
|
||||
'text/json',
|
||||
'text/x-json',
|
||||
'application/json',
|
||||
'application/x-json'])) {
|
||||
data.postData.mimeType = 'application/json'
|
||||
|
||||
if (data.postData.text) {
|
||||
try {
|
||||
data.postData.jsonObj = JSON.parse(data.postData.text)
|
||||
} catch (e) {
|
||||
this.request.debug(e)
|
||||
|
||||
// force back to text/plain
|
||||
data.postData.mimeType = 'text/plain'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
Har.prototype.options = function (options) {
|
||||
// skip if no har property defined
|
||||
if (!options.har) {
|
||||
return options
|
||||
}
|
||||
|
||||
var har = {}
|
||||
extend(har, options.har)
|
||||
|
||||
// only process the first entry
|
||||
if (har.log && har.log.entries) {
|
||||
har = har.log.entries[0]
|
||||
}
|
||||
|
||||
// add optional properties to make validation successful
|
||||
har.url = har.url || options.url || options.uri || options.baseUrl || '/'
|
||||
har.httpVersion = har.httpVersion || 'HTTP/1.1'
|
||||
har.queryString = har.queryString || []
|
||||
har.headers = har.headers || []
|
||||
har.cookies = har.cookies || []
|
||||
har.postData = har.postData || {}
|
||||
har.postData.mimeType = har.postData.mimeType || 'application/octet-stream'
|
||||
|
||||
har.bodySize = 0
|
||||
har.headersSize = 0
|
||||
har.postData.size = 0
|
||||
|
||||
if (!validate.request(har)) {
|
||||
return options
|
||||
}
|
||||
|
||||
// clean up and get some utility properties
|
||||
var req = this.prep(har)
|
||||
|
||||
// construct new options
|
||||
if (req.url) {
|
||||
options.url = req.url
|
||||
}
|
||||
|
||||
if (req.method) {
|
||||
options.method = req.method
|
||||
}
|
||||
|
||||
if (Object.keys(req.queryObj).length) {
|
||||
options.qs = req.queryObj
|
||||
}
|
||||
|
||||
if (Object.keys(req.headersObj).length) {
|
||||
options.headers = req.headersObj
|
||||
}
|
||||
|
||||
function test (type) {
|
||||
return req.postData.mimeType.indexOf(type) === 0
|
||||
}
|
||||
if (test('application/x-www-form-urlencoded')) {
|
||||
options.form = req.postData.paramsObj
|
||||
} else if (test('application/json')) {
|
||||
if (req.postData.jsonObj) {
|
||||
options.body = req.postData.jsonObj
|
||||
options.json = true
|
||||
}
|
||||
} else if (test('multipart/form-data')) {
|
||||
options.formData = {}
|
||||
|
||||
req.postData.params.forEach(function (param) {
|
||||
var attachment = {}
|
||||
|
||||
if (!param.fileName && !param.fileName && !param.contentType) {
|
||||
options.formData[param.name] = param.value
|
||||
return
|
||||
}
|
||||
|
||||
// attempt to read from disk!
|
||||
if (param.fileName && !param.value) {
|
||||
attachment.value = fs.createReadStream(param.fileName)
|
||||
} else if (param.value) {
|
||||
attachment.value = param.value
|
||||
}
|
||||
|
||||
if (param.fileName) {
|
||||
attachment.options = {
|
||||
filename: param.fileName,
|
||||
contentType: param.contentType ? param.contentType : null
|
||||
}
|
||||
}
|
||||
|
||||
options.formData[param.name] = attachment
|
||||
})
|
||||
} else {
|
||||
if (req.postData.text) {
|
||||
options.body = req.postData.text
|
||||
}
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
exports.Har = Har
|
89
node_modules/request/lib/hawk.js
generated
vendored
Normal file
89
node_modules/request/lib/hawk.js
generated
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
'use strict'
|
||||
|
||||
var crypto = require('crypto')
|
||||
|
||||
function randomString (size) {
|
||||
var bits = (size + 1) * 6
|
||||
var buffer = crypto.randomBytes(Math.ceil(bits / 8))
|
||||
var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '')
|
||||
return string.slice(0, size)
|
||||
}
|
||||
|
||||
function calculatePayloadHash (payload, algorithm, contentType) {
|
||||
var hash = crypto.createHash(algorithm)
|
||||
hash.update('hawk.1.payload\n')
|
||||
hash.update((contentType ? contentType.split(';')[0].trim().toLowerCase() : '') + '\n')
|
||||
hash.update(payload || '')
|
||||
hash.update('\n')
|
||||
return hash.digest('base64')
|
||||
}
|
||||
|
||||
exports.calculateMac = function (credentials, opts) {
|
||||
var normalized = 'hawk.1.header\n' +
|
||||
opts.ts + '\n' +
|
||||
opts.nonce + '\n' +
|
||||
(opts.method || '').toUpperCase() + '\n' +
|
||||
opts.resource + '\n' +
|
||||
opts.host.toLowerCase() + '\n' +
|
||||
opts.port + '\n' +
|
||||
(opts.hash || '') + '\n'
|
||||
|
||||
if (opts.ext) {
|
||||
normalized = normalized + opts.ext.replace('\\', '\\\\').replace('\n', '\\n')
|
||||
}
|
||||
|
||||
normalized = normalized + '\n'
|
||||
|
||||
if (opts.app) {
|
||||
normalized = normalized + opts.app + '\n' + (opts.dlg || '') + '\n'
|
||||
}
|
||||
|
||||
var hmac = crypto.createHmac(credentials.algorithm, credentials.key).update(normalized)
|
||||
var digest = hmac.digest('base64')
|
||||
return digest
|
||||
}
|
||||
|
||||
exports.header = function (uri, method, opts) {
|
||||
var timestamp = opts.timestamp || Math.floor((Date.now() + (opts.localtimeOffsetMsec || 0)) / 1000)
|
||||
var credentials = opts.credentials
|
||||
if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) {
|
||||
return ''
|
||||
}
|
||||
|
||||
if (['sha1', 'sha256'].indexOf(credentials.algorithm) === -1) {
|
||||
return ''
|
||||
}
|
||||
|
||||
var artifacts = {
|
||||
ts: timestamp,
|
||||
nonce: opts.nonce || randomString(6),
|
||||
method: method,
|
||||
resource: uri.pathname + (uri.search || ''),
|
||||
host: uri.hostname,
|
||||
port: uri.port || (uri.protocol === 'http:' ? 80 : 443),
|
||||
hash: opts.hash,
|
||||
ext: opts.ext,
|
||||
app: opts.app,
|
||||
dlg: opts.dlg
|
||||
}
|
||||
|
||||
if (!artifacts.hash && (opts.payload || opts.payload === '')) {
|
||||
artifacts.hash = calculatePayloadHash(opts.payload, credentials.algorithm, opts.contentType)
|
||||
}
|
||||
|
||||
var mac = exports.calculateMac(credentials, artifacts)
|
||||
|
||||
var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''
|
||||
var header = 'Hawk id="' + credentials.id +
|
||||
'", ts="' + artifacts.ts +
|
||||
'", nonce="' + artifacts.nonce +
|
||||
(artifacts.hash ? '", hash="' + artifacts.hash : '') +
|
||||
(hasExt ? '", ext="' + artifacts.ext.replace(/\\/g, '\\\\').replace(/"/g, '\\"') : '') +
|
||||
'", mac="' + mac + '"'
|
||||
|
||||
if (artifacts.app) {
|
||||
header = header + ', app="' + artifacts.app + (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"'
|
||||
}
|
||||
|
||||
return header
|
||||
}
|
66
node_modules/request/lib/helpers.js
generated
vendored
Normal file
66
node_modules/request/lib/helpers.js
generated
vendored
Normal file
|
@ -0,0 +1,66 @@
|
|||
'use strict'
|
||||
|
||||
var jsonSafeStringify = require('json-stringify-safe')
|
||||
var crypto = require('crypto')
|
||||
var Buffer = require('safe-buffer').Buffer
|
||||
|
||||
var defer = typeof setImmediate === 'undefined'
|
||||
? process.nextTick
|
||||
: setImmediate
|
||||
|
||||
function paramsHaveRequestBody (params) {
|
||||
return (
|
||||
params.body ||
|
||||
params.requestBodyStream ||
|
||||
(params.json && typeof params.json !== 'boolean') ||
|
||||
params.multipart
|
||||
)
|
||||
}
|
||||
|
||||
function safeStringify (obj, replacer) {
|
||||
var ret
|
||||
try {
|
||||
ret = JSON.stringify(obj, replacer)
|
||||
} catch (e) {
|
||||
ret = jsonSafeStringify(obj, replacer)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
function md5 (str) {
|
||||
return crypto.createHash('md5').update(str).digest('hex')
|
||||
}
|
||||
|
||||
function isReadStream (rs) {
|
||||
return rs.readable && rs.path && rs.mode
|
||||
}
|
||||
|
||||
function toBase64 (str) {
|
||||
return Buffer.from(str || '', 'utf8').toString('base64')
|
||||
}
|
||||
|
||||
function copy (obj) {
|
||||
var o = {}
|
||||
Object.keys(obj).forEach(function (i) {
|
||||
o[i] = obj[i]
|
||||
})
|
||||
return o
|
||||
}
|
||||
|
||||
function version () {
|
||||
var numbers = process.version.replace('v', '').split('.')
|
||||
return {
|
||||
major: parseInt(numbers[0], 10),
|
||||
minor: parseInt(numbers[1], 10),
|
||||
patch: parseInt(numbers[2], 10)
|
||||
}
|
||||
}
|
||||
|
||||
exports.paramsHaveRequestBody = paramsHaveRequestBody
|
||||
exports.safeStringify = safeStringify
|
||||
exports.md5 = md5
|
||||
exports.isReadStream = isReadStream
|
||||
exports.toBase64 = toBase64
|
||||
exports.copy = copy
|
||||
exports.version = version
|
||||
exports.defer = defer
|
112
node_modules/request/lib/multipart.js
generated
vendored
Normal file
112
node_modules/request/lib/multipart.js
generated
vendored
Normal file
|
@ -0,0 +1,112 @@
|
|||
'use strict'
|
||||
|
||||
var uuid = require('uuid/v4')
|
||||
var CombinedStream = require('combined-stream')
|
||||
var isstream = require('isstream')
|
||||
var Buffer = require('safe-buffer').Buffer
|
||||
|
||||
function Multipart (request) {
|
||||
this.request = request
|
||||
this.boundary = uuid()
|
||||
this.chunked = false
|
||||
this.body = null
|
||||
}
|
||||
|
||||
Multipart.prototype.isChunked = function (options) {
|
||||
var self = this
|
||||
var chunked = false
|
||||
var parts = options.data || options
|
||||
|
||||
if (!parts.forEach) {
|
||||
self.request.emit('error', new Error('Argument error, options.multipart.'))
|
||||
}
|
||||
|
||||
if (options.chunked !== undefined) {
|
||||
chunked = options.chunked
|
||||
}
|
||||
|
||||
if (self.request.getHeader('transfer-encoding') === 'chunked') {
|
||||
chunked = true
|
||||
}
|
||||
|
||||
if (!chunked) {
|
||||
parts.forEach(function (part) {
|
||||
if (typeof part.body === 'undefined') {
|
||||
self.request.emit('error', new Error('Body attribute missing in multipart.'))
|
||||
}
|
||||
if (isstream(part.body)) {
|
||||
chunked = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return chunked
|
||||
}
|
||||
|
||||
Multipart.prototype.setHeaders = function (chunked) {
|
||||
var self = this
|
||||
|
||||
if (chunked && !self.request.hasHeader('transfer-encoding')) {
|
||||
self.request.setHeader('transfer-encoding', 'chunked')
|
||||
}
|
||||
|
||||
var header = self.request.getHeader('content-type')
|
||||
|
||||
if (!header || header.indexOf('multipart') === -1) {
|
||||
self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary)
|
||||
} else {
|
||||
if (header.indexOf('boundary') !== -1) {
|
||||
self.boundary = header.replace(/.*boundary=([^\s;]+).*/, '$1')
|
||||
} else {
|
||||
self.request.setHeader('content-type', header + '; boundary=' + self.boundary)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Multipart.prototype.build = function (parts, chunked) {
|
||||
var self = this
|
||||
var body = chunked ? new CombinedStream() : []
|
||||
|
||||
function add (part) {
|
||||
if (typeof part === 'number') {
|
||||
part = part.toString()
|
||||
}
|
||||
return chunked ? body.append(part) : body.push(Buffer.from(part))
|
||||
}
|
||||
|
||||
if (self.request.preambleCRLF) {
|
||||
add('\r\n')
|
||||
}
|
||||
|
||||
parts.forEach(function (part) {
|
||||
var preamble = '--' + self.boundary + '\r\n'
|
||||
Object.keys(part).forEach(function (key) {
|
||||
if (key === 'body') { return }
|
||||
preamble += key + ': ' + part[key] + '\r\n'
|
||||
})
|
||||
preamble += '\r\n'
|
||||
add(preamble)
|
||||
add(part.body)
|
||||
add('\r\n')
|
||||
})
|
||||
add('--' + self.boundary + '--')
|
||||
|
||||
if (self.request.postambleCRLF) {
|
||||
add('\r\n')
|
||||
}
|
||||
|
||||
return body
|
||||
}
|
||||
|
||||
Multipart.prototype.onRequest = function (options) {
|
||||
var self = this
|
||||
|
||||
var chunked = self.isChunked(options)
|
||||
var parts = options.data || options
|
||||
|
||||
self.setHeaders(chunked)
|
||||
self.chunked = chunked
|
||||
self.body = self.build(parts, chunked)
|
||||
}
|
||||
|
||||
exports.Multipart = Multipart
|
148
node_modules/request/lib/oauth.js
generated
vendored
Normal file
148
node_modules/request/lib/oauth.js
generated
vendored
Normal file
|
@ -0,0 +1,148 @@
|
|||
'use strict'
|
||||
|
||||
var url = require('url')
|
||||
var qs = require('qs')
|
||||
var caseless = require('caseless')
|
||||
var uuid = require('uuid/v4')
|
||||
var oauth = require('oauth-sign')
|
||||
var crypto = require('crypto')
|
||||
var Buffer = require('safe-buffer').Buffer
|
||||
|
||||
function OAuth (request) {
|
||||
this.request = request
|
||||
this.params = null
|
||||
}
|
||||
|
||||
OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) {
|
||||
var oa = {}
|
||||
for (var i in _oauth) {
|
||||
oa['oauth_' + i] = _oauth[i]
|
||||
}
|
||||
if (!oa.oauth_version) {
|
||||
oa.oauth_version = '1.0'
|
||||
}
|
||||
if (!oa.oauth_timestamp) {
|
||||
oa.oauth_timestamp = Math.floor(Date.now() / 1000).toString()
|
||||
}
|
||||
if (!oa.oauth_nonce) {
|
||||
oa.oauth_nonce = uuid().replace(/-/g, '')
|
||||
}
|
||||
if (!oa.oauth_signature_method) {
|
||||
oa.oauth_signature_method = 'HMAC-SHA1'
|
||||
}
|
||||
|
||||
var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key // eslint-disable-line camelcase
|
||||
delete oa.oauth_consumer_secret
|
||||
delete oa.oauth_private_key
|
||||
|
||||
var token_secret = oa.oauth_token_secret // eslint-disable-line camelcase
|
||||
delete oa.oauth_token_secret
|
||||
|
||||
var realm = oa.oauth_realm
|
||||
delete oa.oauth_realm
|
||||
delete oa.oauth_transport_method
|
||||
|
||||
var baseurl = uri.protocol + '//' + uri.host + uri.pathname
|
||||
var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))
|
||||
|
||||
oa.oauth_signature = oauth.sign(
|
||||
oa.oauth_signature_method,
|
||||
method,
|
||||
baseurl,
|
||||
params,
|
||||
consumer_secret_or_private_key, // eslint-disable-line camelcase
|
||||
token_secret // eslint-disable-line camelcase
|
||||
)
|
||||
|
||||
if (realm) {
|
||||
oa.realm = realm
|
||||
}
|
||||
|
||||
return oa
|
||||
}
|
||||
|
||||
OAuth.prototype.buildBodyHash = function (_oauth, body) {
|
||||
if (['HMAC-SHA1', 'RSA-SHA1'].indexOf(_oauth.signature_method || 'HMAC-SHA1') < 0) {
|
||||
this.request.emit('error', new Error('oauth: ' + _oauth.signature_method +
|
||||
' signature_method not supported with body_hash signing.'))
|
||||
}
|
||||
|
||||
var shasum = crypto.createHash('sha1')
|
||||
shasum.update(body || '')
|
||||
var sha1 = shasum.digest('hex')
|
||||
|
||||
return Buffer.from(sha1, 'hex').toString('base64')
|
||||
}
|
||||
|
||||
OAuth.prototype.concatParams = function (oa, sep, wrap) {
|
||||
wrap = wrap || ''
|
||||
|
||||
var params = Object.keys(oa).filter(function (i) {
|
||||
return i !== 'realm' && i !== 'oauth_signature'
|
||||
}).sort()
|
||||
|
||||
if (oa.realm) {
|
||||
params.splice(0, 0, 'realm')
|
||||
}
|
||||
params.push('oauth_signature')
|
||||
|
||||
return params.map(function (i) {
|
||||
return i + '=' + wrap + oauth.rfc3986(oa[i]) + wrap
|
||||
}).join(sep)
|
||||
}
|
||||
|
||||
OAuth.prototype.onRequest = function (_oauth) {
|
||||
var self = this
|
||||
self.params = _oauth
|
||||
|
||||
var uri = self.request.uri || {}
|
||||
var method = self.request.method || ''
|
||||
var headers = caseless(self.request.headers)
|
||||
var body = self.request.body || ''
|
||||
var qsLib = self.request.qsLib || qs
|
||||
|
||||
var form
|
||||
var query
|
||||
var contentType = headers.get('content-type') || ''
|
||||
var formContentType = 'application/x-www-form-urlencoded'
|
||||
var transport = _oauth.transport_method || 'header'
|
||||
|
||||
if (contentType.slice(0, formContentType.length) === formContentType) {
|
||||
contentType = formContentType
|
||||
form = body
|
||||
}
|
||||
if (uri.query) {
|
||||
query = uri.query
|
||||
}
|
||||
if (transport === 'body' && (method !== 'POST' || contentType !== formContentType)) {
|
||||
self.request.emit('error', new Error('oauth: transport_method of body requires POST ' +
|
||||
'and content-type ' + formContentType))
|
||||
}
|
||||
|
||||
if (!form && typeof _oauth.body_hash === 'boolean') {
|
||||
_oauth.body_hash = self.buildBodyHash(_oauth, self.request.body.toString())
|
||||
}
|
||||
|
||||
var oa = self.buildParams(_oauth, uri, method, query, form, qsLib)
|
||||
|
||||
switch (transport) {
|
||||
case 'header':
|
||||
self.request.setHeader('Authorization', 'OAuth ' + self.concatParams(oa, ',', '"'))
|
||||
break
|
||||
|
||||
case 'query':
|
||||
var href = self.request.uri.href += (query ? '&' : '?') + self.concatParams(oa, '&')
|
||||
self.request.uri = url.parse(href)
|
||||
self.request.path = self.request.uri.path
|
||||
break
|
||||
|
||||
case 'body':
|
||||
self.request.body = (form ? form + '&' : '') + self.concatParams(oa, '&')
|
||||
break
|
||||
|
||||
default:
|
||||
self.request.emit('error', new Error('oauth: transport_method invalid'))
|
||||
}
|
||||
}
|
||||
|
||||
exports.OAuth = OAuth
|
50
node_modules/request/lib/querystring.js
generated
vendored
Normal file
50
node_modules/request/lib/querystring.js
generated
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
'use strict'
|
||||
|
||||
var qs = require('qs')
|
||||
var querystring = require('querystring')
|
||||
|
||||
function Querystring (request) {
|
||||
this.request = request
|
||||
this.lib = null
|
||||
this.useQuerystring = null
|
||||
this.parseOptions = null
|
||||
this.stringifyOptions = null
|
||||
}
|
||||
|
||||
Querystring.prototype.init = function (options) {
|
||||
if (this.lib) { return }
|
||||
|
||||
this.useQuerystring = options.useQuerystring
|
||||
this.lib = (this.useQuerystring ? querystring : qs)
|
||||
|
||||
this.parseOptions = options.qsParseOptions || {}
|
||||
this.stringifyOptions = options.qsStringifyOptions || {}
|
||||
}
|
||||
|
||||
Querystring.prototype.stringify = function (obj) {
|
||||
return (this.useQuerystring)
|
||||
? this.rfc3986(this.lib.stringify(obj,
|
||||
this.stringifyOptions.sep || null,
|
||||
this.stringifyOptions.eq || null,
|
||||
this.stringifyOptions))
|
||||
: this.lib.stringify(obj, this.stringifyOptions)
|
||||
}
|
||||
|
||||
Querystring.prototype.parse = function (str) {
|
||||
return (this.useQuerystring)
|
||||
? this.lib.parse(str,
|
||||
this.parseOptions.sep || null,
|
||||
this.parseOptions.eq || null,
|
||||
this.parseOptions)
|
||||
: this.lib.parse(str, this.parseOptions)
|
||||
}
|
||||
|
||||
Querystring.prototype.rfc3986 = function (str) {
|
||||
return str.replace(/[!'()*]/g, function (c) {
|
||||
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
|
||||
})
|
||||
}
|
||||
|
||||
Querystring.prototype.unescape = querystring.unescape
|
||||
|
||||
exports.Querystring = Querystring
|
154
node_modules/request/lib/redirect.js
generated
vendored
Normal file
154
node_modules/request/lib/redirect.js
generated
vendored
Normal file
|
@ -0,0 +1,154 @@
|
|||
'use strict'
|
||||
|
||||
var url = require('url')
|
||||
var isUrl = /^https?:/
|
||||
|
||||
function Redirect (request) {
|
||||
this.request = request
|
||||
this.followRedirect = true
|
||||
this.followRedirects = true
|
||||
this.followAllRedirects = false
|
||||
this.followOriginalHttpMethod = false
|
||||
this.allowRedirect = function () { return true }
|
||||
this.maxRedirects = 10
|
||||
this.redirects = []
|
||||
this.redirectsFollowed = 0
|
||||
this.removeRefererHeader = false
|
||||
}
|
||||
|
||||
Redirect.prototype.onRequest = function (options) {
|
||||
var self = this
|
||||
|
||||
if (options.maxRedirects !== undefined) {
|
||||
self.maxRedirects = options.maxRedirects
|
||||
}
|
||||
if (typeof options.followRedirect === 'function') {
|
||||
self.allowRedirect = options.followRedirect
|
||||
}
|
||||
if (options.followRedirect !== undefined) {
|
||||
self.followRedirects = !!options.followRedirect
|
||||
}
|
||||
if (options.followAllRedirects !== undefined) {
|
||||
self.followAllRedirects = options.followAllRedirects
|
||||
}
|
||||
if (self.followRedirects || self.followAllRedirects) {
|
||||
self.redirects = self.redirects || []
|
||||
}
|
||||
if (options.removeRefererHeader !== undefined) {
|
||||
self.removeRefererHeader = options.removeRefererHeader
|
||||
}
|
||||
if (options.followOriginalHttpMethod !== undefined) {
|
||||
self.followOriginalHttpMethod = options.followOriginalHttpMethod
|
||||
}
|
||||
}
|
||||
|
||||
Redirect.prototype.redirectTo = function (response) {
|
||||
var self = this
|
||||
var request = self.request
|
||||
|
||||
var redirectTo = null
|
||||
if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) {
|
||||
var location = response.caseless.get('location')
|
||||
request.debug('redirect', location)
|
||||
|
||||
if (self.followAllRedirects) {
|
||||
redirectTo = location
|
||||
} else if (self.followRedirects) {
|
||||
switch (request.method) {
|
||||
case 'PATCH':
|
||||
case 'PUT':
|
||||
case 'POST':
|
||||
case 'DELETE':
|
||||
// Do not follow redirects
|
||||
break
|
||||
default:
|
||||
redirectTo = location
|
||||
break
|
||||
}
|
||||
}
|
||||
} else if (response.statusCode === 401) {
|
||||
var authHeader = request._auth.onResponse(response)
|
||||
if (authHeader) {
|
||||
request.setHeader('authorization', authHeader)
|
||||
redirectTo = request.uri
|
||||
}
|
||||
}
|
||||
return redirectTo
|
||||
}
|
||||
|
||||
Redirect.prototype.onResponse = function (response) {
|
||||
var self = this
|
||||
var request = self.request
|
||||
|
||||
var redirectTo = self.redirectTo(response)
|
||||
if (!redirectTo || !self.allowRedirect.call(request, response)) {
|
||||
return false
|
||||
}
|
||||
|
||||
request.debug('redirect to', redirectTo)
|
||||
|
||||
// ignore any potential response body. it cannot possibly be useful
|
||||
// to us at this point.
|
||||
// response.resume should be defined, but check anyway before calling. Workaround for browserify.
|
||||
if (response.resume) {
|
||||
response.resume()
|
||||
}
|
||||
|
||||
if (self.redirectsFollowed >= self.maxRedirects) {
|
||||
request.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + request.uri.href))
|
||||
return false
|
||||
}
|
||||
self.redirectsFollowed += 1
|
||||
|
||||
if (!isUrl.test(redirectTo)) {
|
||||
redirectTo = url.resolve(request.uri.href, redirectTo)
|
||||
}
|
||||
|
||||
var uriPrev = request.uri
|
||||
request.uri = url.parse(redirectTo)
|
||||
|
||||
// handle the case where we change protocol from https to http or vice versa
|
||||
if (request.uri.protocol !== uriPrev.protocol) {
|
||||
delete request.agent
|
||||
}
|
||||
|
||||
self.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo })
|
||||
|
||||
if (self.followAllRedirects && request.method !== 'HEAD' &&
|
||||
response.statusCode !== 401 && response.statusCode !== 307) {
|
||||
request.method = self.followOriginalHttpMethod ? request.method : 'GET'
|
||||
}
|
||||
// request.method = 'GET' // Force all redirects to use GET || commented out fixes #215
|
||||
delete request.src
|
||||
delete request.req
|
||||
delete request._started
|
||||
if (response.statusCode !== 401 && response.statusCode !== 307) {
|
||||
// Remove parameters from the previous response, unless this is the second request
|
||||
// for a server that requires digest authentication.
|
||||
delete request.body
|
||||
delete request._form
|
||||
if (request.headers) {
|
||||
request.removeHeader('host')
|
||||
request.removeHeader('content-type')
|
||||
request.removeHeader('content-length')
|
||||
if (request.uri.hostname !== request.originalHost.split(':')[0]) {
|
||||
// Remove authorization if changing hostnames (but not if just
|
||||
// changing ports or protocols). This matches the behavior of curl:
|
||||
// https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710
|
||||
request.removeHeader('authorization')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!self.removeRefererHeader) {
|
||||
request.setHeader('referer', uriPrev.href)
|
||||
}
|
||||
|
||||
request.emit('redirect')
|
||||
|
||||
request.init()
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
exports.Redirect = Redirect
|
175
node_modules/request/lib/tunnel.js
generated
vendored
Normal file
175
node_modules/request/lib/tunnel.js
generated
vendored
Normal file
|
@ -0,0 +1,175 @@
|
|||
'use strict'
|
||||
|
||||
var url = require('url')
|
||||
var tunnel = require('tunnel-agent')
|
||||
|
||||
var defaultProxyHeaderWhiteList = [
|
||||
'accept',
|
||||
'accept-charset',
|
||||
'accept-encoding',
|
||||
'accept-language',
|
||||
'accept-ranges',
|
||||
'cache-control',
|
||||
'content-encoding',
|
||||
'content-language',
|
||||
'content-location',
|
||||
'content-md5',
|
||||
'content-range',
|
||||
'content-type',
|
||||
'connection',
|
||||
'date',
|
||||
'expect',
|
||||
'max-forwards',
|
||||
'pragma',
|
||||
'referer',
|
||||
'te',
|
||||
'user-agent',
|
||||
'via'
|
||||
]
|
||||
|
||||
var defaultProxyHeaderExclusiveList = [
|
||||
'proxy-authorization'
|
||||
]
|
||||
|
||||
function constructProxyHost (uriObject) {
|
||||
var port = uriObject.port
|
||||
var protocol = uriObject.protocol
|
||||
var proxyHost = uriObject.hostname + ':'
|
||||
|
||||
if (port) {
|
||||
proxyHost += port
|
||||
} else if (protocol === 'https:') {
|
||||
proxyHost += '443'
|
||||
} else {
|
||||
proxyHost += '80'
|
||||
}
|
||||
|
||||
return proxyHost
|
||||
}
|
||||
|
||||
function constructProxyHeaderWhiteList (headers, proxyHeaderWhiteList) {
|
||||
var whiteList = proxyHeaderWhiteList
|
||||
.reduce(function (set, header) {
|
||||
set[header.toLowerCase()] = true
|
||||
return set
|
||||
}, {})
|
||||
|
||||
return Object.keys(headers)
|
||||
.filter(function (header) {
|
||||
return whiteList[header.toLowerCase()]
|
||||
})
|
||||
.reduce(function (set, header) {
|
||||
set[header] = headers[header]
|
||||
return set
|
||||
}, {})
|
||||
}
|
||||
|
||||
function constructTunnelOptions (request, proxyHeaders) {
|
||||
var proxy = request.proxy
|
||||
|
||||
var tunnelOptions = {
|
||||
proxy: {
|
||||
host: proxy.hostname,
|
||||
port: +proxy.port,
|
||||
proxyAuth: proxy.auth,
|
||||
headers: proxyHeaders
|
||||
},
|
||||
headers: request.headers,
|
||||
ca: request.ca,
|
||||
cert: request.cert,
|
||||
key: request.key,
|
||||
passphrase: request.passphrase,
|
||||
pfx: request.pfx,
|
||||
ciphers: request.ciphers,
|
||||
rejectUnauthorized: request.rejectUnauthorized,
|
||||
secureOptions: request.secureOptions,
|
||||
secureProtocol: request.secureProtocol
|
||||
}
|
||||
|
||||
return tunnelOptions
|
||||
}
|
||||
|
||||
function constructTunnelFnName (uri, proxy) {
|
||||
var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http')
|
||||
var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http')
|
||||
return [uriProtocol, proxyProtocol].join('Over')
|
||||
}
|
||||
|
||||
function getTunnelFn (request) {
|
||||
var uri = request.uri
|
||||
var proxy = request.proxy
|
||||
var tunnelFnName = constructTunnelFnName(uri, proxy)
|
||||
return tunnel[tunnelFnName]
|
||||
}
|
||||
|
||||
function Tunnel (request) {
|
||||
this.request = request
|
||||
this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList
|
||||
this.proxyHeaderExclusiveList = []
|
||||
if (typeof request.tunnel !== 'undefined') {
|
||||
this.tunnelOverride = request.tunnel
|
||||
}
|
||||
}
|
||||
|
||||
Tunnel.prototype.isEnabled = function () {
|
||||
var self = this
|
||||
var request = self.request
|
||||
// Tunnel HTTPS by default. Allow the user to override this setting.
|
||||
|
||||
// If self.tunnelOverride is set (the user specified a value), use it.
|
||||
if (typeof self.tunnelOverride !== 'undefined') {
|
||||
return self.tunnelOverride
|
||||
}
|
||||
|
||||
// If the destination is HTTPS, tunnel.
|
||||
if (request.uri.protocol === 'https:') {
|
||||
return true
|
||||
}
|
||||
|
||||
// Otherwise, do not use tunnel.
|
||||
return false
|
||||
}
|
||||
|
||||
Tunnel.prototype.setup = function (options) {
|
||||
var self = this
|
||||
var request = self.request
|
||||
|
||||
options = options || {}
|
||||
|
||||
if (typeof request.proxy === 'string') {
|
||||
request.proxy = url.parse(request.proxy)
|
||||
}
|
||||
|
||||
if (!request.proxy || !request.tunnel) {
|
||||
return false
|
||||
}
|
||||
|
||||
// Setup Proxy Header Exclusive List and White List
|
||||
if (options.proxyHeaderWhiteList) {
|
||||
self.proxyHeaderWhiteList = options.proxyHeaderWhiteList
|
||||
}
|
||||
if (options.proxyHeaderExclusiveList) {
|
||||
self.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList
|
||||
}
|
||||
|
||||
var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList)
|
||||
var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList)
|
||||
|
||||
// Setup Proxy Headers and Proxy Headers Host
|
||||
// Only send the Proxy White Listed Header names
|
||||
var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList)
|
||||
proxyHeaders.host = constructProxyHost(request.uri)
|
||||
|
||||
proxyHeaderExclusiveList.forEach(request.removeHeader, request)
|
||||
|
||||
// Set Agent from Tunnel Data
|
||||
var tunnelFn = getTunnelFn(request)
|
||||
var tunnelOptions = constructTunnelOptions(request, proxyHeaders)
|
||||
request.agent = tunnelFn(tunnelOptions)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
Tunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList
|
||||
Tunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList
|
||||
exports.Tunnel = Tunnel
|
20
node_modules/request/node_modules/punycode/LICENSE-MIT.txt
generated
vendored
Normal file
20
node_modules/request/node_modules/punycode/LICENSE-MIT.txt
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
Copyright Mathias Bynens <https://mathiasbynens.be/>
|
||||
|
||||
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.
|
176
node_modules/request/node_modules/punycode/README.md
generated
vendored
Normal file
176
node_modules/request/node_modules/punycode/README.md
generated
vendored
Normal file
|
@ -0,0 +1,176 @@
|
|||
# Punycode.js [](https://travis-ci.org/bestiejs/punycode.js) [](https://coveralls.io/r/bestiejs/punycode.js) [](https://gemnasium.com/bestiejs/punycode.js)
|
||||
|
||||
A robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms.
|
||||
|
||||
This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm:
|
||||
|
||||
* [The C example code from RFC 3492](https://tools.ietf.org/html/rfc3492#appendix-C)
|
||||
* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c)
|
||||
* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c)
|
||||
* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287)
|
||||
* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072))
|
||||
|
||||
This project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) and [io.js v1.0.0+](https://github.com/iojs/io.js/blob/v1.x/lib/punycode.js).
|
||||
|
||||
## Installation
|
||||
|
||||
Via [npm](https://www.npmjs.com/) (only required for Node.js releases older than v0.6.2):
|
||||
|
||||
```bash
|
||||
npm install punycode
|
||||
```
|
||||
|
||||
Via [Bower](http://bower.io/):
|
||||
|
||||
```bash
|
||||
bower install punycode
|
||||
```
|
||||
|
||||
Via [Component](https://github.com/component/component):
|
||||
|
||||
```bash
|
||||
component install bestiejs/punycode.js
|
||||
```
|
||||
|
||||
In a browser:
|
||||
|
||||
```html
|
||||
<script src="punycode.js"></script>
|
||||
```
|
||||
|
||||
In [Node.js](https://nodejs.org/), [io.js](https://iojs.org/), [Narwhal](http://narwhaljs.org/), and [RingoJS](http://ringojs.org/):
|
||||
|
||||
```js
|
||||
var punycode = require('punycode');
|
||||
```
|
||||
|
||||
In [Rhino](http://www.mozilla.org/rhino/):
|
||||
|
||||
```js
|
||||
load('punycode.js');
|
||||
```
|
||||
|
||||
Using an AMD loader like [RequireJS](http://requirejs.org/):
|
||||
|
||||
```js
|
||||
require(
|
||||
{
|
||||
'paths': {
|
||||
'punycode': 'path/to/punycode'
|
||||
}
|
||||
},
|
||||
['punycode'],
|
||||
function(punycode) {
|
||||
console.log(punycode);
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### `punycode.decode(string)`
|
||||
|
||||
Converts a Punycode string of ASCII symbols to a string of Unicode symbols.
|
||||
|
||||
```js
|
||||
// decode domain name parts
|
||||
punycode.decode('maana-pta'); // 'mañana'
|
||||
punycode.decode('--dqo34k'); // '☃-⌘'
|
||||
```
|
||||
|
||||
### `punycode.encode(string)`
|
||||
|
||||
Converts a string of Unicode symbols to a Punycode string of ASCII symbols.
|
||||
|
||||
```js
|
||||
// encode domain name parts
|
||||
punycode.encode('mañana'); // 'maana-pta'
|
||||
punycode.encode('☃-⌘'); // '--dqo34k'
|
||||
```
|
||||
|
||||
### `punycode.toUnicode(input)`
|
||||
|
||||
Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode.
|
||||
|
||||
```js
|
||||
// decode domain names
|
||||
punycode.toUnicode('xn--maana-pta.com');
|
||||
// → 'mañana.com'
|
||||
punycode.toUnicode('xn----dqo34k.com');
|
||||
// → '☃-⌘.com'
|
||||
|
||||
// decode email addresses
|
||||
punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq');
|
||||
// → 'джумла@джpумлатест.bрфa'
|
||||
```
|
||||
|
||||
### `punycode.toASCII(input)`
|
||||
|
||||
Converts a lowercased Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that’s already in ASCII.
|
||||
|
||||
```js
|
||||
// encode domain names
|
||||
punycode.toASCII('mañana.com');
|
||||
// → 'xn--maana-pta.com'
|
||||
punycode.toASCII('☃-⌘.com');
|
||||
// → 'xn----dqo34k.com'
|
||||
|
||||
// encode email addresses
|
||||
punycode.toASCII('джумла@джpумлатест.bрфa');
|
||||
// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'
|
||||
```
|
||||
|
||||
### `punycode.ucs2`
|
||||
|
||||
#### `punycode.ucs2.decode(string)`
|
||||
|
||||
Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16.
|
||||
|
||||
```js
|
||||
punycode.ucs2.decode('abc');
|
||||
// → [0x61, 0x62, 0x63]
|
||||
// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE:
|
||||
punycode.ucs2.decode('\uD834\uDF06');
|
||||
// → [0x1D306]
|
||||
```
|
||||
|
||||
#### `punycode.ucs2.encode(codePoints)`
|
||||
|
||||
Creates a string based on an array of numeric code point values.
|
||||
|
||||
```js
|
||||
punycode.ucs2.encode([0x61, 0x62, 0x63]);
|
||||
// → 'abc'
|
||||
punycode.ucs2.encode([0x1D306]);
|
||||
// → '\uD834\uDF06'
|
||||
```
|
||||
|
||||
### `punycode.version`
|
||||
|
||||
A string representing the current Punycode.js version number.
|
||||
|
||||
## Unit tests & code coverage
|
||||
|
||||
After cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.
|
||||
|
||||
Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`.
|
||||
|
||||
To generate the code coverage report, use `grunt cover`.
|
||||
|
||||
Feel free to fork if you see possible improvements!
|
||||
|
||||
## Author
|
||||
|
||||
| [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||
|---|
|
||||
| [Mathias Bynens](https://mathiasbynens.be/) |
|
||||
|
||||
## Contributors
|
||||
|
||||
| [](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||
|---|
|
||||
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||
|
||||
## License
|
||||
|
||||
Punycode.js is available under the [MIT](https://mths.be/mit) license.
|
87
node_modules/request/node_modules/punycode/package.json
generated
vendored
Normal file
87
node_modules/request/node_modules/punycode/package.json
generated
vendored
Normal file
|
@ -0,0 +1,87 @@
|
|||
{
|
||||
"_from": "punycode@^1.4.1",
|
||||
"_id": "punycode@1.4.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
|
||||
"_location": "/request/punycode",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "punycode@^1.4.1",
|
||||
"name": "punycode",
|
||||
"escapedName": "punycode",
|
||||
"rawSpec": "^1.4.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.4.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/request/tough-cookie"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
|
||||
"_shasum": "c0d5a63b2718800ad8e1eb0fa5269c84dd41845e",
|
||||
"_spec": "punycode@^1.4.1",
|
||||
"_where": "E:\\github\\setup-java\\node_modules\\request\\node_modules\\tough-cookie",
|
||||
"author": {
|
||||
"name": "Mathias Bynens",
|
||||
"url": "https://mathiasbynens.be/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/bestiejs/punycode.js/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Mathias Bynens",
|
||||
"url": "https://mathiasbynens.be/"
|
||||
},
|
||||
{
|
||||
"name": "John-David Dalton",
|
||||
"url": "http://allyoucanleet.com/"
|
||||
}
|
||||
],
|
||||
"deprecated": false,
|
||||
"description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.",
|
||||
"devDependencies": {
|
||||
"coveralls": "^2.11.4",
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-contrib-uglify": "^0.11.0",
|
||||
"grunt-shell": "^1.1.2",
|
||||
"istanbul": "^0.4.1",
|
||||
"qunit-extras": "^1.4.4",
|
||||
"qunitjs": "~1.11.0",
|
||||
"requirejs": "^2.1.22"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE-MIT.txt",
|
||||
"punycode.js"
|
||||
],
|
||||
"homepage": "https://mths.be/punycode",
|
||||
"jspm": {
|
||||
"map": {
|
||||
"./punycode.js": {
|
||||
"node": "@node/punycode"
|
||||
}
|
||||
}
|
||||
},
|
||||
"keywords": [
|
||||
"punycode",
|
||||
"unicode",
|
||||
"idn",
|
||||
"idna",
|
||||
"dns",
|
||||
"url",
|
||||
"domain"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "punycode.js",
|
||||
"name": "punycode",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/bestiejs/punycode.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node tests/tests.js"
|
||||
},
|
||||
"version": "1.4.1"
|
||||
}
|
533
node_modules/request/node_modules/punycode/punycode.js
generated
vendored
Normal file
533
node_modules/request/node_modules/punycode/punycode.js
generated
vendored
Normal file
|
@ -0,0 +1,533 @@
|
|||
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
||||
;(function(root) {
|
||||
|
||||
/** Detect free variables */
|
||||
var freeExports = typeof exports == 'object' && exports &&
|
||||
!exports.nodeType && exports;
|
||||
var freeModule = typeof module == 'object' && module &&
|
||||
!module.nodeType && module;
|
||||
var freeGlobal = typeof global == 'object' && global;
|
||||
if (
|
||||
freeGlobal.global === freeGlobal ||
|
||||
freeGlobal.window === freeGlobal ||
|
||||
freeGlobal.self === freeGlobal
|
||||
) {
|
||||
root = freeGlobal;
|
||||
}
|
||||
|
||||
/**
|
||||
* The `punycode` object.
|
||||
* @name punycode
|
||||
* @type Object
|
||||
*/
|
||||
var punycode,
|
||||
|
||||
/** Highest positive signed 32-bit float value */
|
||||
maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
|
||||
|
||||
/** Bootstring parameters */
|
||||
base = 36,
|
||||
tMin = 1,
|
||||
tMax = 26,
|
||||
skew = 38,
|
||||
damp = 700,
|
||||
initialBias = 72,
|
||||
initialN = 128, // 0x80
|
||||
delimiter = '-', // '\x2D'
|
||||
|
||||
/** Regular expressions */
|
||||
regexPunycode = /^xn--/,
|
||||
regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
|
||||
regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
|
||||
|
||||
/** Error messages */
|
||||
errors = {
|
||||
'overflow': 'Overflow: input needs wider integers to process',
|
||||
'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
|
||||
'invalid-input': 'Invalid input'
|
||||
},
|
||||
|
||||
/** Convenience shortcuts */
|
||||
baseMinusTMin = base - tMin,
|
||||
floor = Math.floor,
|
||||
stringFromCharCode = String.fromCharCode,
|
||||
|
||||
/** Temporary variable */
|
||||
key;
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* A generic error utility function.
|
||||
* @private
|
||||
* @param {String} type The error type.
|
||||
* @returns {Error} Throws a `RangeError` with the applicable error message.
|
||||
*/
|
||||
function error(type) {
|
||||
throw new RangeError(errors[type]);
|
||||
}
|
||||
|
||||
/**
|
||||
* A generic `Array#map` utility function.
|
||||
* @private
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {Function} callback The function that gets called for every array
|
||||
* item.
|
||||
* @returns {Array} A new array of values returned by the callback function.
|
||||
*/
|
||||
function map(array, fn) {
|
||||
var length = array.length;
|
||||
var result = [];
|
||||
while (length--) {
|
||||
result[length] = fn(array[length]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* A simple `Array#map`-like wrapper to work with domain name strings or email
|
||||
* addresses.
|
||||
* @private
|
||||
* @param {String} domain The domain name or email address.
|
||||
* @param {Function} callback The function that gets called for every
|
||||
* character.
|
||||
* @returns {Array} A new string of characters returned by the callback
|
||||
* function.
|
||||
*/
|
||||
function mapDomain(string, fn) {
|
||||
var parts = string.split('@');
|
||||
var result = '';
|
||||
if (parts.length > 1) {
|
||||
// In email addresses, only the domain name should be punycoded. Leave
|
||||
// the local part (i.e. everything up to `@`) intact.
|
||||
result = parts[0] + '@';
|
||||
string = parts[1];
|
||||
}
|
||||
// Avoid `split(regex)` for IE8 compatibility. See #17.
|
||||
string = string.replace(regexSeparators, '\x2E');
|
||||
var labels = string.split('.');
|
||||
var encoded = map(labels, fn).join('.');
|
||||
return result + encoded;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array containing the numeric code points of each Unicode
|
||||
* character in the string. While JavaScript uses UCS-2 internally,
|
||||
* this function will convert a pair of surrogate halves (each of which
|
||||
* UCS-2 exposes as separate characters) into a single code point,
|
||||
* matching UTF-16.
|
||||
* @see `punycode.ucs2.encode`
|
||||
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
||||
* @memberOf punycode.ucs2
|
||||
* @name decode
|
||||
* @param {String} string The Unicode input string (UCS-2).
|
||||
* @returns {Array} The new array of code points.
|
||||
*/
|
||||
function ucs2decode(string) {
|
||||
var output = [],
|
||||
counter = 0,
|
||||
length = string.length,
|
||||
value,
|
||||
extra;
|
||||
while (counter < length) {
|
||||
value = string.charCodeAt(counter++);
|
||||
if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
|
||||
// high surrogate, and there is a next character
|
||||
extra = string.charCodeAt(counter++);
|
||||
if ((extra & 0xFC00) == 0xDC00) { // low surrogate
|
||||
output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
|
||||
} else {
|
||||
// unmatched surrogate; only append this code unit, in case the next
|
||||
// code unit is the high surrogate of a surrogate pair
|
||||
output.push(value);
|
||||
counter--;
|
||||
}
|
||||
} else {
|
||||
output.push(value);
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string based on an array of numeric code points.
|
||||
* @see `punycode.ucs2.decode`
|
||||
* @memberOf punycode.ucs2
|
||||
* @name encode
|
||||
* @param {Array} codePoints The array of numeric code points.
|
||||
* @returns {String} The new Unicode string (UCS-2).
|
||||
*/
|
||||
function ucs2encode(array) {
|
||||
return map(array, function(value) {
|
||||
var output = '';
|
||||
if (value > 0xFFFF) {
|
||||
value -= 0x10000;
|
||||
output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
|
||||
value = 0xDC00 | value & 0x3FF;
|
||||
}
|
||||
output += stringFromCharCode(value);
|
||||
return output;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a basic code point into a digit/integer.
|
||||
* @see `digitToBasic()`
|
||||
* @private
|
||||
* @param {Number} codePoint The basic numeric code point value.
|
||||
* @returns {Number} The numeric value of a basic code point (for use in
|
||||
* representing integers) in the range `0` to `base - 1`, or `base` if
|
||||
* the code point does not represent a value.
|
||||
*/
|
||||
function basicToDigit(codePoint) {
|
||||
if (codePoint - 48 < 10) {
|
||||
return codePoint - 22;
|
||||
}
|
||||
if (codePoint - 65 < 26) {
|
||||
return codePoint - 65;
|
||||
}
|
||||
if (codePoint - 97 < 26) {
|
||||
return codePoint - 97;
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a digit/integer into a basic code point.
|
||||
* @see `basicToDigit()`
|
||||
* @private
|
||||
* @param {Number} digit The numeric value of a basic code point.
|
||||
* @returns {Number} The basic code point whose value (when used for
|
||||
* representing integers) is `digit`, which needs to be in the range
|
||||
* `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
|
||||
* used; else, the lowercase form is used. The behavior is undefined
|
||||
* if `flag` is non-zero and `digit` has no uppercase form.
|
||||
*/
|
||||
function digitToBasic(digit, flag) {
|
||||
// 0..25 map to ASCII a..z or A..Z
|
||||
// 26..35 map to ASCII 0..9
|
||||
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bias adaptation function as per section 3.4 of RFC 3492.
|
||||
* https://tools.ietf.org/html/rfc3492#section-3.4
|
||||
* @private
|
||||
*/
|
||||
function adapt(delta, numPoints, firstTime) {
|
||||
var k = 0;
|
||||
delta = firstTime ? floor(delta / damp) : delta >> 1;
|
||||
delta += floor(delta / numPoints);
|
||||
for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
|
||||
delta = floor(delta / baseMinusTMin);
|
||||
}
|
||||
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a Punycode string of ASCII-only symbols to a string of Unicode
|
||||
* symbols.
|
||||
* @memberOf punycode
|
||||
* @param {String} input The Punycode string of ASCII-only symbols.
|
||||
* @returns {String} The resulting string of Unicode symbols.
|
||||
*/
|
||||
function decode(input) {
|
||||
// Don't use UCS-2
|
||||
var output = [],
|
||||
inputLength = input.length,
|
||||
out,
|
||||
i = 0,
|
||||
n = initialN,
|
||||
bias = initialBias,
|
||||
basic,
|
||||
j,
|
||||
index,
|
||||
oldi,
|
||||
w,
|
||||
k,
|
||||
digit,
|
||||
t,
|
||||
/** Cached calculation results */
|
||||
baseMinusT;
|
||||
|
||||
// Handle the basic code points: let `basic` be the number of input code
|
||||
// points before the last delimiter, or `0` if there is none, then copy
|
||||
// the first basic code points to the output.
|
||||
|
||||
basic = input.lastIndexOf(delimiter);
|
||||
if (basic < 0) {
|
||||
basic = 0;
|
||||
}
|
||||
|
||||
for (j = 0; j < basic; ++j) {
|
||||
// if it's not a basic code point
|
||||
if (input.charCodeAt(j) >= 0x80) {
|
||||
error('not-basic');
|
||||
}
|
||||
output.push(input.charCodeAt(j));
|
||||
}
|
||||
|
||||
// Main decoding loop: start just after the last delimiter if any basic code
|
||||
// points were copied; start at the beginning otherwise.
|
||||
|
||||
for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
|
||||
|
||||
// `index` is the index of the next character to be consumed.
|
||||
// Decode a generalized variable-length integer into `delta`,
|
||||
// which gets added to `i`. The overflow checking is easier
|
||||
// if we increase `i` as we go, then subtract off its starting
|
||||
// value at the end to obtain `delta`.
|
||||
for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
|
||||
|
||||
if (index >= inputLength) {
|
||||
error('invalid-input');
|
||||
}
|
||||
|
||||
digit = basicToDigit(input.charCodeAt(index++));
|
||||
|
||||
if (digit >= base || digit > floor((maxInt - i) / w)) {
|
||||
error('overflow');
|
||||
}
|
||||
|
||||
i += digit * w;
|
||||
t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
|
||||
|
||||
if (digit < t) {
|
||||
break;
|
||||
}
|
||||
|
||||
baseMinusT = base - t;
|
||||
if (w > floor(maxInt / baseMinusT)) {
|
||||
error('overflow');
|
||||
}
|
||||
|
||||
w *= baseMinusT;
|
||||
|
||||
}
|
||||
|
||||
out = output.length + 1;
|
||||
bias = adapt(i - oldi, out, oldi == 0);
|
||||
|
||||
// `i` was supposed to wrap around from `out` to `0`,
|
||||
// incrementing `n` each time, so we'll fix that now:
|
||||
if (floor(i / out) > maxInt - n) {
|
||||
error('overflow');
|
||||
}
|
||||
|
||||
n += floor(i / out);
|
||||
i %= out;
|
||||
|
||||
// Insert `n` at position `i` of the output
|
||||
output.splice(i++, 0, n);
|
||||
|
||||
}
|
||||
|
||||
return ucs2encode(output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a string of Unicode symbols (e.g. a domain name label) to a
|
||||
* Punycode string of ASCII-only symbols.
|
||||
* @memberOf punycode
|
||||
* @param {String} input The string of Unicode symbols.
|
||||
* @returns {String} The resulting Punycode string of ASCII-only symbols.
|
||||
*/
|
||||
function encode(input) {
|
||||
var n,
|
||||
delta,
|
||||
handledCPCount,
|
||||
basicLength,
|
||||
bias,
|
||||
j,
|
||||
m,
|
||||
q,
|
||||
k,
|
||||
t,
|
||||
currentValue,
|
||||
output = [],
|
||||
/** `inputLength` will hold the number of code points in `input`. */
|
||||
inputLength,
|
||||
/** Cached calculation results */
|
||||
handledCPCountPlusOne,
|
||||
baseMinusT,
|
||||
qMinusT;
|
||||
|
||||
// Convert the input in UCS-2 to Unicode
|
||||
input = ucs2decode(input);
|
||||
|
||||
// Cache the length
|
||||
inputLength = input.length;
|
||||
|
||||
// Initialize the state
|
||||
n = initialN;
|
||||
delta = 0;
|
||||
bias = initialBias;
|
||||
|
||||
// Handle the basic code points
|
||||
for (j = 0; j < inputLength; ++j) {
|
||||
currentValue = input[j];
|
||||
if (currentValue < 0x80) {
|
||||
output.push(stringFromCharCode(currentValue));
|
||||
}
|
||||
}
|
||||
|
||||
handledCPCount = basicLength = output.length;
|
||||
|
||||
// `handledCPCount` is the number of code points that have been handled;
|
||||
// `basicLength` is the number of basic code points.
|
||||
|
||||
// Finish the basic string - if it is not empty - with a delimiter
|
||||
if (basicLength) {
|
||||
output.push(delimiter);
|
||||
}
|
||||
|
||||
// Main encoding loop:
|
||||
while (handledCPCount < inputLength) {
|
||||
|
||||
// All non-basic code points < n have been handled already. Find the next
|
||||
// larger one:
|
||||
for (m = maxInt, j = 0; j < inputLength; ++j) {
|
||||
currentValue = input[j];
|
||||
if (currentValue >= n && currentValue < m) {
|
||||
m = currentValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
|
||||
// but guard against overflow
|
||||
handledCPCountPlusOne = handledCPCount + 1;
|
||||
if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
|
||||
error('overflow');
|
||||
}
|
||||
|
||||
delta += (m - n) * handledCPCountPlusOne;
|
||||
n = m;
|
||||
|
||||
for (j = 0; j < inputLength; ++j) {
|
||||
currentValue = input[j];
|
||||
|
||||
if (currentValue < n && ++delta > maxInt) {
|
||||
error('overflow');
|
||||
}
|
||||
|
||||
if (currentValue == n) {
|
||||
// Represent delta as a generalized variable-length integer
|
||||
for (q = delta, k = base; /* no condition */; k += base) {
|
||||
t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
|
||||
if (q < t) {
|
||||
break;
|
||||
}
|
||||
qMinusT = q - t;
|
||||
baseMinusT = base - t;
|
||||
output.push(
|
||||
stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
|
||||
);
|
||||
q = floor(qMinusT / baseMinusT);
|
||||
}
|
||||
|
||||
output.push(stringFromCharCode(digitToBasic(q, 0)));
|
||||
bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
|
||||
delta = 0;
|
||||
++handledCPCount;
|
||||
}
|
||||
}
|
||||
|
||||
++delta;
|
||||
++n;
|
||||
|
||||
}
|
||||
return output.join('');
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a Punycode string representing a domain name or an email address
|
||||
* to Unicode. Only the Punycoded parts of the input will be converted, i.e.
|
||||
* it doesn't matter if you call it on a string that has already been
|
||||
* converted to Unicode.
|
||||
* @memberOf punycode
|
||||
* @param {String} input The Punycoded domain name or email address to
|
||||
* convert to Unicode.
|
||||
* @returns {String} The Unicode representation of the given Punycode
|
||||
* string.
|
||||
*/
|
||||
function toUnicode(input) {
|
||||
return mapDomain(input, function(string) {
|
||||
return regexPunycode.test(string)
|
||||
? decode(string.slice(4).toLowerCase())
|
||||
: string;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a Unicode string representing a domain name or an email address to
|
||||
* Punycode. Only the non-ASCII parts of the domain name will be converted,
|
||||
* i.e. it doesn't matter if you call it with a domain that's already in
|
||||
* ASCII.
|
||||
* @memberOf punycode
|
||||
* @param {String} input The domain name or email address to convert, as a
|
||||
* Unicode string.
|
||||
* @returns {String} The Punycode representation of the given domain name or
|
||||
* email address.
|
||||
*/
|
||||
function toASCII(input) {
|
||||
return mapDomain(input, function(string) {
|
||||
return regexNonASCII.test(string)
|
||||
? 'xn--' + encode(string)
|
||||
: string;
|
||||
});
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/** Define the public API */
|
||||
punycode = {
|
||||
/**
|
||||
* A string representing the current Punycode.js version number.
|
||||
* @memberOf punycode
|
||||
* @type String
|
||||
*/
|
||||
'version': '1.4.1',
|
||||
/**
|
||||
* An object of methods to convert from JavaScript's internal character
|
||||
* representation (UCS-2) to Unicode code points, and back.
|
||||
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
||||
* @memberOf punycode
|
||||
* @type Object
|
||||
*/
|
||||
'ucs2': {
|
||||
'decode': ucs2decode,
|
||||
'encode': ucs2encode
|
||||
},
|
||||
'decode': decode,
|
||||
'encode': encode,
|
||||
'toASCII': toASCII,
|
||||
'toUnicode': toUnicode
|
||||
};
|
||||
|
||||
/** Expose `punycode` */
|
||||
// Some AMD build optimizers, like r.js, check for specific condition patterns
|
||||
// like the following:
|
||||
if (
|
||||
typeof define == 'function' &&
|
||||
typeof define.amd == 'object' &&
|
||||
define.amd
|
||||
) {
|
||||
define('punycode', function() {
|
||||
return punycode;
|
||||
});
|
||||
} else if (freeExports && freeModule) {
|
||||
if (module.exports == freeExports) {
|
||||
// in Node.js, io.js, or RingoJS v0.8.0+
|
||||
freeModule.exports = punycode;
|
||||
} else {
|
||||
// in Narwhal or RingoJS v0.7.0-
|
||||
for (key in punycode) {
|
||||
punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// in Rhino or a web browser
|
||||
root.punycode = punycode;
|
||||
}
|
||||
|
||||
}(this));
|
12
node_modules/request/node_modules/tough-cookie/LICENSE
generated
vendored
Normal file
12
node_modules/request/node_modules/tough-cookie/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
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.
|
507
node_modules/request/node_modules/tough-cookie/README.md
generated
vendored
Normal file
507
node_modules/request/node_modules/tough-cookie/README.md
generated
vendored
Normal file
|
@ -0,0 +1,507 @@
|
|||
[RFC6265](https://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js
|
||||
|
||||
[](https://nodei.co/npm/tough-cookie/)
|
||||
|
||||
[](https://travis-ci.org/salesforce/tough-cookie)
|
||||
|
||||
# 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.
|
||||
|
||||
## Version Support
|
||||
|
||||
Support for versions of node.js will follow that of the [request](https://www.npmjs.com/package/request) module.
|
||||
|
||||
# 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 parameters 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. This call is currently a wrapper around [`psl`](https://www.npmjs.com/package/psl)'s [get() method](https://www.npmjs.com/package/psl#pslgetdomain).
|
||||
|
||||
### `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'])];
|
||||
```
|
||||
|
||||
_Note:_ in version 2.3.3, tough-cookie limited the number of spaces before the `=` to 256 characters. This limitation has since been removed.
|
||||
See [Issue 92](https://github.com/salesforce/tough-cookie/issues/92)
|
||||
|
||||
### 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` parameter -- 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.
|
||||
|
||||
## Community Cookie Stores
|
||||
|
||||
These are some Store implementations authored and maintained by the community. They aren't official and we don't vouch for them but you may be interested to have a look:
|
||||
|
||||
- [`db-cookie-store`](https://github.com/JSBizon/db-cookie-store): SQL including SQLite-based databases
|
||||
- [`file-cookie-store`](https://github.com/JSBizon/file-cookie-store): Netscape cookie file format on disk
|
||||
- [`redis-cookie-store`](https://github.com/benkroeger/redis-cookie-store): Redis
|
||||
- [`tough-cookie-filestore`](https://github.com/mitsuru/tough-cookie-filestore): JSON on disk
|
||||
- [`tough-cookie-web-storage-store`](https://github.com/exponentjs/tough-cookie-web-storage-store): DOM localStorage and sessionStorage
|
||||
|
||||
|
||||
# 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.
|
||||
```
|
1431
node_modules/request/node_modules/tough-cookie/lib/cookie.js
generated
vendored
Normal file
1431
node_modules/request/node_modules/tough-cookie/lib/cookie.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
176
node_modules/request/node_modules/tough-cookie/lib/memstore.js
generated
vendored
Normal file
176
node_modules/request/node_modules/tough-cookie/lib/memstore.js
generated
vendored
Normal file
|
@ -0,0 +1,176 @@
|
|||
/*!
|
||||
* 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)+' }';
|
||||
};
|
||||
|
||||
// Use the new custom inspection symbol to add the custom inspect function if
|
||||
// available.
|
||||
if (util.inspect.custom) {
|
||||
MemoryCookieStore.prototype[util.inspect.custom] = MemoryCookieStore.prototype.inspect;
|
||||
}
|
||||
|
||||
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);
|
||||
};
|
61
node_modules/request/node_modules/tough-cookie/lib/pathMatch.js
generated
vendored
Normal file
61
node_modules/request/node_modules/tough-cookie/lib/pathMatch.js
generated
vendored
Normal file
|
@ -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;
|
56
node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js
generated
vendored
Normal file
56
node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js
generated
vendored
Normal file
|
@ -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-psl');
|
||||
|
||||
// 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;
|
38
node_modules/request/node_modules/tough-cookie/lib/pubsuffix-psl.js
generated
vendored
Normal file
38
node_modules/request/node_modules/tough-cookie/lib/pubsuffix-psl.js
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*!
|
||||
* Copyright (c) 2018, 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 psl = require('psl');
|
||||
|
||||
function getPublicSuffix(domain) {
|
||||
return psl.get(domain);
|
||||
}
|
||||
|
||||
exports.getPublicSuffix = getPublicSuffix;
|
71
node_modules/request/node_modules/tough-cookie/lib/store.js
generated
vendored
Normal file
71
node_modules/request/node_modules/tough-cookie/lib/store.js
generated
vendored
Normal file
|
@ -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)');
|
||||
};
|
94
node_modules/request/node_modules/tough-cookie/package.json
generated
vendored
Normal file
94
node_modules/request/node_modules/tough-cookie/package.json
generated
vendored
Normal file
|
@ -0,0 +1,94 @@
|
|||
{
|
||||
"_from": "tough-cookie@~2.4.3",
|
||||
"_id": "tough-cookie@2.4.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
|
||||
"_location": "/request/tough-cookie",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "tough-cookie@~2.4.3",
|
||||
"name": "tough-cookie",
|
||||
"escapedName": "tough-cookie",
|
||||
"rawSpec": "~2.4.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~2.4.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/request"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",
|
||||
"_shasum": "53f36da3f47783b0925afa06ff9f3b165280f781",
|
||||
"_spec": "tough-cookie@~2.4.3",
|
||||
"_where": "E:\\github\\setup-java\\node_modules\\request",
|
||||
"author": {
|
||||
"name": "Jeremy Stashewsky",
|
||||
"email": "jstash@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/salesforce/tough-cookie/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Alexander Savin"
|
||||
},
|
||||
{
|
||||
"name": "Ian Livingstone"
|
||||
},
|
||||
{
|
||||
"name": "Ivan Nikulin"
|
||||
},
|
||||
{
|
||||
"name": "Lalit Kapoor"
|
||||
},
|
||||
{
|
||||
"name": "Sam Thompson"
|
||||
},
|
||||
{
|
||||
"name": "Sebastian Mayr"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"psl": "^1.1.24",
|
||||
"punycode": "^1.4.1"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "RFC6265 Cookies and Cookie Jar for node.js",
|
||||
"devDependencies": {
|
||||
"async": "^1.4.2",
|
||||
"nyc": "^11.6.0",
|
||||
"string.prototype.repeat": "^0.2.0",
|
||||
"vows": "^0.8.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"homepage": "https://github.com/salesforce/tough-cookie",
|
||||
"keywords": [
|
||||
"HTTP",
|
||||
"cookie",
|
||||
"cookies",
|
||||
"set-cookie",
|
||||
"cookiejar",
|
||||
"jar",
|
||||
"RFC6265",
|
||||
"RFC2965"
|
||||
],
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "./lib/cookie",
|
||||
"name": "tough-cookie",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/salesforce/tough-cookie.git"
|
||||
},
|
||||
"scripts": {
|
||||
"cover": "nyc --reporter=lcov --reporter=html vows test/*_test.js",
|
||||
"test": "vows test/*_test.js"
|
||||
},
|
||||
"version": "2.4.3"
|
||||
}
|
117
node_modules/request/package.json
generated
vendored
Normal file
117
node_modules/request/package.json
generated
vendored
Normal file
|
@ -0,0 +1,117 @@
|
|||
{
|
||||
"_from": "request@^2.87.0",
|
||||
"_id": "request@2.88.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
|
||||
"_location": "/request",
|
||||
"_phantomChildren": {
|
||||
"psl": "1.2.0"
|
||||
},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "request@^2.87.0",
|
||||
"name": "request",
|
||||
"escapedName": "request",
|
||||
"rawSpec": "^2.87.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^2.87.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/jsdom"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz",
|
||||
"_shasum": "9c2fca4f7d35b592efe57c7f0a55e81052124fef",
|
||||
"_spec": "request@^2.87.0",
|
||||
"_where": "E:\\github\\setup-java\\node_modules\\jsdom",
|
||||
"author": {
|
||||
"name": "Mikeal Rogers",
|
||||
"email": "mikeal.rogers@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "http://github.com/request/request/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"aws-sign2": "~0.7.0",
|
||||
"aws4": "^1.8.0",
|
||||
"caseless": "~0.12.0",
|
||||
"combined-stream": "~1.0.6",
|
||||
"extend": "~3.0.2",
|
||||
"forever-agent": "~0.6.1",
|
||||
"form-data": "~2.3.2",
|
||||
"har-validator": "~5.1.0",
|
||||
"http-signature": "~1.2.0",
|
||||
"is-typedarray": "~1.0.0",
|
||||
"isstream": "~0.1.2",
|
||||
"json-stringify-safe": "~5.0.1",
|
||||
"mime-types": "~2.1.19",
|
||||
"oauth-sign": "~0.9.0",
|
||||
"performance-now": "^2.1.0",
|
||||
"qs": "~6.5.2",
|
||||
"safe-buffer": "^5.1.2",
|
||||
"tough-cookie": "~2.4.3",
|
||||
"tunnel-agent": "^0.6.0",
|
||||
"uuid": "^3.3.2"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Simplified HTTP request client.",
|
||||
"devDependencies": {
|
||||
"bluebird": "^3.2.1",
|
||||
"browserify": "^13.0.1",
|
||||
"browserify-istanbul": "^2.0.0",
|
||||
"buffer-equal": "^1.0.0",
|
||||
"codecov": "^3.0.4",
|
||||
"coveralls": "^3.0.2",
|
||||
"function-bind": "^1.0.2",
|
||||
"istanbul": "^0.4.0",
|
||||
"karma": "^3.0.0",
|
||||
"karma-browserify": "^5.0.1",
|
||||
"karma-cli": "^1.0.0",
|
||||
"karma-coverage": "^1.0.0",
|
||||
"karma-phantomjs-launcher": "^1.0.0",
|
||||
"karma-tap": "^3.0.1",
|
||||
"phantomjs-prebuilt": "^2.1.3",
|
||||
"rimraf": "^2.2.8",
|
||||
"server-destroy": "^1.0.1",
|
||||
"standard": "^9.0.0",
|
||||
"tape": "^4.6.0",
|
||||
"taper": "^0.5.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
},
|
||||
"files": [
|
||||
"lib/",
|
||||
"index.js",
|
||||
"request.js"
|
||||
],
|
||||
"greenkeeper": {
|
||||
"ignore": [
|
||||
"hawk",
|
||||
"har-validator"
|
||||
]
|
||||
},
|
||||
"homepage": "https://github.com/request/request#readme",
|
||||
"keywords": [
|
||||
"http",
|
||||
"simple",
|
||||
"util",
|
||||
"utility"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"main": "index.js",
|
||||
"name": "request",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/request/request.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "standard",
|
||||
"test": "npm run lint && npm run test-ci && npm run test-browser",
|
||||
"test-browser": "node tests/browser/start.js",
|
||||
"test-ci": "taper tests/test-*.js",
|
||||
"test-cov": "istanbul cover tape tests/test-*.js"
|
||||
},
|
||||
"version": "2.88.0"
|
||||
}
|
1551
node_modules/request/request.js
generated
vendored
Normal file
1551
node_modules/request/request.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue