cookies
Advanced tools
Comparing version 0.9.0 to 0.9.1
@@ -0,1 +1,6 @@ | ||
0.9.1 / 2024-01-01 | ||
================== | ||
* Fix incorrectly disallowing equals sign in cookie value | ||
0.9.0 / 2023-12-28 | ||
@@ -2,0 +7,0 @@ ================== |
14
index.js
@@ -43,8 +43,14 @@ /*! | ||
/** | ||
* RegExp to match basic restricted characters for loose validation. | ||
* RegExp to match basic restricted name characters for loose validation. | ||
*/ | ||
var RESTRICTED_CHARS_REGEXP = /[;=]/ | ||
var RESTRICTED_NAME_CHARS_REGEXP = /[;=]/ | ||
/** | ||
* RegExp to match basic restricted value characters for loose validation. | ||
*/ | ||
var RESTRICTED_VALUE_CHARS_REGEXP = /[;]/ | ||
/** | ||
* RegExp to match Same-Site cookie attribute value. | ||
@@ -148,7 +154,7 @@ */ | ||
function Cookie(name, value, attrs) { | ||
if (!fieldContentRegExp.test(name) || RESTRICTED_CHARS_REGEXP.test(name)) { | ||
if (!fieldContentRegExp.test(name) || RESTRICTED_NAME_CHARS_REGEXP.test(name)) { | ||
throw new TypeError('argument name is invalid'); | ||
} | ||
if (value && (!fieldContentRegExp.test(value) || RESTRICTED_CHARS_REGEXP.test(value))) { | ||
if (value && (!fieldContentRegExp.test(value) || RESTRICTED_VALUE_CHARS_REGEXP.test(value))) { | ||
throw new TypeError('argument value is invalid'); | ||
@@ -155,0 +161,0 @@ } |
{ | ||
"name": "cookies", | ||
"description": "Cookies, optionally signed using Keygrip.", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"author": "Jed Schmidt <tr@nslator.jp> (http://jed.is)", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
22367
228