-
-
Notifications
You must be signed in to change notification settings - Fork 14
fix: handle invalid dates properly #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Closes #262 Signed-off-by: flakey5 <[email protected]>
|
Maybe I'm missing something, but the fix doesn't look right. At least in Node.js, an invalid date is still an instance of Date. |
MattIPv4
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @targos noted, checking if a date is an instance of Date does not tell you whether its invalid or not -- you need check using the global isNaN.
isNaN(new Date()); // false
isNaN(new Date("aaa")); // true|
Could a test or two be added for these headers when they're set to valid + invalid values in requests? |
cc @flakey5 |
Signed-off-by: flakey5 <[email protected]>
Signed-off-by: flakey5 <[email protected]>
Co-authored-by: Matt Cowley <[email protected]>
Signed-off-by: flakey5 <[email protected]>
Signed-off-by: flakey5 <[email protected]>
ovflowd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome stuff!
Closes #262