-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] Do not swallow trailing =
in cookie value
#51819
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
[HttpFoundation] Do not swallow trailing =
in cookie value
#51819
Conversation
=
in cookie value
Or should this be fixed inside HeaderUtils::split() method? |
I guess we have similar bugs in other places using |
So do you have a proposal on where to fix this? |
Well, HeaderUtils should be the place to fix it, but not sure we can fix it with the existing signature (unless we hardcode a special behavior for |
The bug is clearly in HeaderUtils, see
|
Will check on Monday 👍🏻 |
7cf16b0
to
360e0ad
Compare
Review please |
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.
The whole logic is opaque to me 😓
f2d7a47
to
ed51a41
Compare
469f98b
to
59d6acf
Compare
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.
I rewrote the implementation, it now makes sense, at least to me :)
AND, it handles more edge cases.
59d6acf
to
77ca01c
Compare
Thank you Nicolas!! 👏 |
@@ -46,13 +46,15 @@ public static function provideHeaderToSplit(): array | |||
|
|||
[[['foo_cookie', 'foo=1&bar=2&baz=3'], ['expires', 'Tue, 22-Sep-2020 06:27:09 GMT'], ['path', '/']], 'foo_cookie=foo=1&bar=2&baz=3; expires=Tue, 22-Sep-2020 06:27:09 GMT; path=/', ';='], | |||
[[['foo_cookie', 'foo=='], ['expires', 'Tue, 22-Sep-2020 06:27:09 GMT'], ['path', '/']], 'foo_cookie=foo==; expires=Tue, 22-Sep-2020 06:27:09 GMT; path=/', ';='], |
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.
[[['foo_cookie', 'foo=='], ['expires', 'Tue, 22-Sep-2020 06:27:09 GMT'], ['path', '/']], 'foo_cookie=foo==; expires=Tue, 22-Sep-2020 06:27:09 GMT; path=/', ';='], | |
[[['foo_cookie', 'foo==='], ['expires', 'Tue, 22-Sep-2020 06:27:09 GMT'], ['path', '/']], 'foo_cookie=foo===; expires=Tue, 22-Sep-2020 06:27:09 GMT; path=/', ';='], | |
[[['foo_cookie', 'foo=='], ['expires', 'Tue, 22-Sep-2020 06:27:09 GMT'], ['path', '/']], 'foo_cookie=foo==; expires=Tue, 22-Sep-2020 06:27:09 GMT; path=/', ';='], |
Does this pass as well?
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.
yes
Thank you @OskarStark. |
Thank you, as you did the reimplementation 👍 |
cc @pschultz as you opened the bug report