D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
cpanel
/
ea-nodejs10
/
lib
/
node_modules
/
npm
/
node_modules
/
request
/
lib
/
Filename :
cookies.js
back
Copy
'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) }
Name
Size
Last Modified
Owner
Permissions
Actions
auth.js
4.662
KB
September 13 2023 2:48:05
root
0644
cookies.js
0.951
KB
September 13 2023 2:48:05
root
0644
getProxyFromURI.js
2.188
KB
September 13 2023 2:48:05
root
0644
har.js
4.693
KB
September 13 2023 2:48:05
root
0644
hawk.js
2.686
KB
September 13 2023 2:48:05
root
0644
helpers.js
1.378
KB
September 13 2023 2:48:05
root
0644
multipart.js
2.611
KB
September 13 2023 2:48:05
root
0644
oauth.js
4.039
KB
September 13 2023 2:48:05
root
0644
querystring.js
1.303
KB
September 13 2023 2:48:05
root
0644
redirect.js
4.526
KB
September 13 2023 2:48:05
root
0644
tunnel.js
4.313
KB
September 13 2023 2:48:05
root
0644
2017 © D7net | D704T team