Skip to content

Conversation

@emilhem
Copy link
Contributor

@emilhem emilhem commented Aug 1, 2016

Includes test!

We should look into all the places where the libCookie.parse and libCookie.serialize is used to ensure that the value isn't changed. Probably better not to use it at all!

emilhem added 2 commits August 1, 2016 12:05
The reason is that we change the cookie value by putting it though all the parsers (encodeURIComponent/decodeURIComponent).
We should never parse the cookie values ever, only its parameters!
@nfriedly
Copy link
Owner

nfriedly commented Aug 1, 2016

Oh, good catch. Maybe we should add a rawValue to set-cookie-parser and use that?

@emilhem
Copy link
Contributor Author

emilhem commented Aug 1, 2016

It's a good idea. Although the parser part of the name could be confusing if it returns a string.

Forgot to remove the decodeURIComponent.
@emilhem
Copy link
Contributor Author

emilhem commented Aug 1, 2016

There, I forgot to remove decodeURIComponent. It's not needed.

This way we are sure that we don't parse the cookie value.
This commit includes a replacement for libCookie.serialize to use serializeCookie instead.
It also removes libCookie completely.
@emilhem
Copy link
Contributor Author

emilhem commented Aug 1, 2016

Now libCookie is removed completely replaced by my new parseCookies function.

We no longer need this since we parse cookies ourself! :D
@nfriedly
Copy link
Owner

nfriedly commented Aug 1, 2016

Ok, let me look at this one a bit more.

weibeu added a commit to surepassio/node-unblocker that referenced this pull request Dec 2, 2020
Repository owner deleted a comment from MrMachi9 May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants