cookies
Advanced tools
Comparing version 0.7.3 to 0.8.0
@@ -0,1 +1,13 @@ | ||
0.8.0 / 2019-10-11 | ||
================== | ||
* Fix check for default `secure` option behavior | ||
* Fix `maxAge` option preventing cookie deletion | ||
* Support `"none"` in `sameSite` option | ||
* deps: depd@~2.0.0 | ||
- Replace internal `eval` usage with `Function` constructor | ||
- Use instance methods on `process` to check for listeners | ||
* deps: keygrip@~1.1.0 | ||
- Use `tsscmp` module for timing-safe signature verification | ||
0.7.3 / 2018-11-04 | ||
@@ -2,0 +14,0 @@ ================== |
16
index.js
@@ -29,3 +29,3 @@ /*! | ||
var sameSiteRegExp = /^(?:lax|strict)$/i | ||
var SAME_SITE_REGEXP = /^(?:lax|none|strict)$/i | ||
@@ -98,4 +98,5 @@ function Cookies(request, response, options) { | ||
cookie.secure = secure | ||
if (opts && "secure" in opts) cookie.secure = opts.secure | ||
cookie.secure = opts && opts.secure !== undefined | ||
? opts.secure | ||
: secure | ||
@@ -130,4 +131,2 @@ if (opts && "secureProxy" in opts) { | ||
value || (this.expires = new Date(0)) | ||
this.name = name | ||
@@ -140,2 +139,7 @@ this.value = value || "" | ||
if (!this.value) { | ||
this.expires = new Date(0) | ||
this.maxAge = null | ||
} | ||
if (this.path && !fieldContentRegExp.test(this.path)) { | ||
@@ -149,3 +153,3 @@ throw new TypeError('option path is invalid'); | ||
if (this.sameSite && this.sameSite !== true && !sameSiteRegExp.test(this.sameSite)) { | ||
if (this.sameSite && this.sameSite !== true && !SAME_SITE_REGEXP.test(this.sameSite)) { | ||
throw new TypeError('option sameSite is invalid') | ||
@@ -152,0 +156,0 @@ } |
{ | ||
"name": "cookies", | ||
"description": "Cookies, optionally signed using Keygrip.", | ||
"version": "0.7.3", | ||
"version": "0.8.0", | ||
"author": "Jed Schmidt <tr@nslator.jp> (http://jed.is)", | ||
@@ -12,12 +12,12 @@ "contributors": [ | ||
"dependencies": { | ||
"depd": "~1.1.2", | ||
"keygrip": "~1.0.3" | ||
"depd": "~2.0.0", | ||
"keygrip": "~1.1.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "3.19.0", | ||
"express": "4.16.4", | ||
"istanbul": "0.4.5", | ||
"mocha": "5.2.0", | ||
"restify": "6.4.0", | ||
"supertest": "3.3.0" | ||
"eslint": "4.19.1", | ||
"express": "4.17.1", | ||
"mocha": "6.2.1", | ||
"nyc": "14.1.1", | ||
"restify": "8.4.0", | ||
"supertest": "4.0.2" | ||
}, | ||
@@ -36,5 +36,5 @@ "files": [ | ||
"test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/", | ||
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/", | ||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/" | ||
"test-ci": "nyc --reporter=text npm test", | ||
"test-cov": "nyc --reporter=html --reporter=text npm test" | ||
} | ||
} |
19617
177
+ Addeddepd@2.0.0(transitive)
+ Addedkeygrip@1.1.0(transitive)
+ Addedtsscmp@1.0.6(transitive)
- Removeddepd@1.1.2(transitive)
- Removedkeygrip@1.0.3(transitive)
Updateddepd@~2.0.0
Updatedkeygrip@~1.1.0