Review Section 5.1.1. Dates by colincasey · Pull Request #547 · salesforce/tough-cookie (original) (raw)
Updates parseDate.ts with improved comments and clarifications regarding the RFC6265 compliance.
Adds tests for date parsing edge cases and boundaries:
- Year boundaries (e.g., 1600, 9999, 10000)
- Day-of-month limits (e.g., 0, 32)
- Time component boundaries (e.g., 24:00:00, 23:60:00)
- Month edge cases (e.g., single character months, invalid abbreviations)
- Invalid date combinations as per RFC6265
- Handling of duplicate tokens and consecutive delimiters
Closes #511
Also disabled no-control-regex rule since control characters are used throughout the spec.
colincasey added a commit that referenced this pull request
Reorganize the flat it.each in domainMatch.spec.ts into grouped describe blocks for better readability and alignment with RFC 6265 Section 5.1.3 structure:
- null and undefined inputs (library-specific behavior)
- canonicalization (mixed case, leading dots, non-ASCII/punycode)
- identical strings (RFC condition 1)
- suffix matching with dot boundary (RFC condition 2)
- IP address rejection (RFC condition 2's IP check)
No test cases added or removed — purely structural reorganization. This follows the pattern established in PR #547 for date tests.
Part of #513
colincasey added a commit that referenced this pull request
- refactor: restructure domainMatch tests into describe blocks
Reorganize the flat it.each in domainMatch.spec.ts into grouped describe blocks for better readability and alignment with RFC 6265 Section 5.1.3 structure:
- null and undefined inputs (library-specific behavior)
- canonicalization (mixed case, leading dots, non-ASCII/punycode)
- identical strings (RFC condition 1)
- suffix matching with dot boundary (RFC condition 2)
- IP address rejection (RFC condition 2's IP check)
No test cases added or removed — purely structural reorganization. This follows the pattern established in PR #547 for date tests.
Part of #513
- Add edge case tests for domainMatch (#513)
Add tests for empty string inputs, localhost identity match, dot-only inputs, and canonicalize=false parameter behavior.
Note: ('..', '.') returns true because canonicalization strips the leading dot from '..' leaving '.', which matches identity.
- Annotate domainMatch.ts with RFC section references
Update JSDoc and inline comments to reference specific sections of draft-ietf-httpbis-rfc6265bis-22, note rfc6265bis compatibility in the remarks block, and clearly label library-specific behavior that goes beyond the RFC algorithm. No behavioral changes.
- Regenerate API docs with bis-22 compatibility note for domainMatch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})