-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
[React-Native] cannot parse expires #35
Comments
Oh boy. I guess that's what I get for using the built in new Date('Thu, 26-Mar-2020 07:55:35 GMT')
//> Date Wed Mar 26 -2020 02:59:33 GMT-0456 (Eastern Standard Time) Chrome and, by extension, Node.js handle it correctly. As does Safari on mac (13.0.5) and in the iOS simulator (13.2.2). I kind of expected/hoped Safari would give the same error you were getting so that I could at least have a straightforward way or reproducing & testing it :( Do you know much about automated testing for React Native? If you could make me a test-case that reproduces the error? That would help. |
For context, here is the official algorithm for how to parse the expires field: https://tools.ietf.org/html/rfc6265#section-5.1.1 - using the |
It seems that replacing the dashes with slashes could work |
Note to self: tough-cookie has a spec-compliant parser: https://github.com/salesforce/tough-cookie/blob/v4.1.3/lib/cookie.js#L193 (apparently moving to here for the next version: https://github.com/salesforce/tough-cookie/blob/master/lib/cookie/parseDate.ts |
returns Invalid Date for Expires=Thu, 26-Mar-2020 07:55:35 GMT as an example
The text was updated successfully, but these errors were encountered: