Socket
Socket
Sign inDemoInstall

tough-cookie

Package Overview
Dependencies
0
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.0 to 2.2.0

21

lib/cookie.js

@@ -881,6 +881,14 @@ /*!

function CookieJar(store, rejectPublicSuffixes) {
if (rejectPublicSuffixes != null) {
this.rejectPublicSuffixes = rejectPublicSuffixes;
function CookieJar(store, options) {
if (typeof options === "boolean") {
options = {rejectPublicSuffixes: options};
} else if (options == null) {
options = {};
}
if (options.rejectPublicSuffixes != null) {
this.rejectPublicSuffixes = options.rejectPublicSuffixes;
}
if (options.looseMode != null) {
this.enableLooseMode = options.looseMode;
}

@@ -894,2 +902,3 @@ if (!store) {

CookieJar.prototype.rejectPublicSuffixes = true;
CookieJar.prototype.enableLooseMode = false;
var CAN_BE_SYNC = [];

@@ -907,6 +916,10 @@

var host = canonicalDomain(context.hostname);
var loose = this.enableLooseMode;
if (options.loose != null) {
loose = options.loose;
}
// S5.3 step 1
if (!(cookie instanceof Cookie)) {
cookie = Cookie.parse(cookie, { loose: options.loose });
cookie = Cookie.parse(cookie, { loose: loose });
}

@@ -913,0 +926,0 @@ if (!cookie) {

2

package.json

@@ -46,3 +46,3 @@ {

],
"version": "2.1.0",
"version": "2.2.0",
"homepage": "https://github.com/SalesforceEng/tough-cookie",

@@ -49,0 +49,0 @@ "repository": {

@@ -240,12 +240,12 @@ [RFC6265](https://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js

### `CookieJar([store],[rejectPublicSuffixes])`
### `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.
### Properties
The `options` object can be omitted and can have the following properties:
CookieJar object 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.
* _rejectPublicSuffixes_ - boolean - reject cookies with domains like "com" and "co.uk" (default: `true`)
Since eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods.

@@ -252,0 +252,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc