Comments (4)
Oh boy. I guess that's what I get for using the built in Date
parser. I suspect it's choking on the dashes in 26-Mar-2020
. Amusingly, Firefox mis-interprets them as negatives:
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.
from set-cookie-parser.
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 Date
object was just a convenient hack that seemed to work well enough until now. I'm not entirely against implementing it, although I'm a little divided as to weather or not it should be the default.
from set-cookie-parser.
It seems that replacing the dashes with slashes could work
https://stackoverflow.com/questions/8831338/date-issue-in-firefox/8831539
from set-cookie-parser.
Related Issues (20)
- Is it better to decode values defaultly? HOT 1
- Proposition: maxAge shoud be returned in ms, not in seconds. HOT 2
- Incompatibility with Fetch API HOT 15
- Reverse mechanism? HOT 1
- set-cookie-header -> set-cookie-parser HOT 1
- Split cookies string HOT 4
- const keyword in strict mode breaks Safari 9.x HOT 4
- Feature Request: Get cookie by name HOT 1
- map option does not work in 2.2.1 HOT 2
- Thanks for the RN explanation
- Add sameSite option HOT 7
- export the parseString function HOT 3
- How could access Set-Cookie from header? HOT 1
- parseCookieString doesn't return map HOT 6
- Returning Empty Object Error? HOT 2
- Document how stringify set-cookie-parser object HOT 3
- distribute ESM version HOT 6
- Invalid handling of cookies with invalid name-value-pair in set-cookie string HOT 9
- Add support for getSetCookie() method HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from set-cookie-parser.