@tinyhttp/cookie
Advanced tools
Comparing version 0.5.1 to 0.5.2
# @tinyhttp/cookie | ||
## 0.5.2 | ||
### Patch Changes | ||
- Strip some bytes | ||
## 0.5.1 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@tinyhttp/cookie", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "HTTP cookie parser and serializer for Node.js", |
@@ -44,5 +44,3 @@ const pairSplitRegExp = /; */ | ||
// skip things that don't look like key=value | ||
if (eqIdx < 0) { | ||
continue | ||
} | ||
if (eqIdx < 0) continue | ||
@@ -76,11 +74,7 @@ const key = pair.substr(0, eqIdx).trim() | ||
if (!fieldContentRegExp.test(name)) { | ||
throw new TypeError('argument name is invalid') | ||
} | ||
if (!fieldContentRegExp.test(name)) throw new TypeError('argument name is invalid') | ||
const value = opt.encode(val) | ||
if (value && !fieldContentRegExp.test(value)) { | ||
throw new TypeError('argument val is invalid') | ||
} | ||
if (value && !fieldContentRegExp.test(value)) throw new TypeError('argument val is invalid') | ||
@@ -92,5 +86,3 @@ let str = name + '=' + value | ||
if (isNaN(maxAge) || !isFinite(maxAge)) { | ||
throw new TypeError('option maxAge is invalid') | ||
} | ||
if (isNaN(maxAge) || !isFinite(maxAge)) throw new TypeError('option maxAge is invalid') | ||
@@ -101,5 +93,3 @@ str += '; Max-Age=' + Math.floor(maxAge) | ||
if (opt.domain) { | ||
if (!fieldContentRegExp.test(opt.domain)) { | ||
throw new TypeError('option domain is invalid') | ||
} | ||
if (!fieldContentRegExp.test(opt.domain)) throw new TypeError('option domain is invalid') | ||
@@ -125,9 +115,5 @@ str += '; Domain=' + opt.domain | ||
if (opt.httpOnly) { | ||
str += '; HttpOnly' | ||
} | ||
if (opt.httpOnly) str += '; HttpOnly' | ||
if (opt.secure) { | ||
str += '; Secure' | ||
} | ||
if (opt.secure) str += '; Secure' | ||
@@ -134,0 +120,0 @@ if (opt.sameSite) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21300
347