WebSocket-Node
WebSocket-Node copied to clipboard
Refactor Cookie-handling code into module or delegate to another NPM module
Why not provide them as a simple string like in a http header?
The current format requires me to do an additional transformation which I'd like to avoid.
Because parsing the cookies allows me to enforce validation of correct formats. I feel that libraries like this have a responsibility to enforce correct RFC-compliant usage.
True, the format of the parsed cookies isn't the most convenient, but the transform you're doing is super lightweight and fast.
Also, I'm not 100% certain my memory is correct, but the spec may allow multiple cookies with the same name, the same way that HTTP allows multiple headers with the same name.