Skip to content

fix: reject non-string cookie values#181

Open
raashish1601 wants to merge 1 commit into
pillarjs:masterfrom
raashish1601:codex/reject-non-string-cookie-values
Open

fix: reject non-string cookie values#181
raashish1601 wants to merge 1 commit into
pillarjs:masterfrom
raashish1601:codex/reject-non-string-cookie-values

Conversation

@raashish1601

Copy link
Copy Markdown

Summary

Reject non-string cookie values instead of treating falsy non-string values like 0 and false as an empty string.

null and undefined still keep the existing delete-cookie behavior. String values such as '0' continue to serialize normally.

Fixes #101.

Validation

  • npx mocha --require test/support/env --reporter spec --bail --check-leaks test/cookie.js
  • npx eslint index.js test/cookie.js
  • npm test
  • npm run lint
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cookie set to '' when pass the value as 0

1 participant