Skip to content

Commit

Permalink
More horror related to #1
Browse files Browse the repository at this point in the history
  • Loading branch information
bsittler committed Aug 16, 2016
1 parent 4c57137 commit eaee6c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ if (self.document) (function() {
let httpOnly = !!options.httpOnly;
if (value == null && maxAge == null && expires == null) maxAge = 0;
value = value == null ? '' : String(value);
if (name === '' && value === '') throw new SyntaxError('Cookies must have a nonempty name or value');
if (name === '' && value.indexOf('=') !== '-1') {
throw new SyntaxError('Character "=" is not allowed in cookie value with empty name');
}
if (value.match(DISALLOWED_IN_COOKIE_VALUE_RE) || value !== decodeURIComponent(encodeURIComponent(value))) {
// Does not match document.cookie behavior!
throw new SyntaxError('Unsupported character in cookie value');
Expand Down

0 comments on commit eaee6c7

Please sign in to comment.