Skip to content

[PsrHttpMessageBridge] Fix conversion of partitioned cookies in the PSR-7 bridge #58010

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

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

stof
Copy link
Member

@stof stof commented Aug 14, 2024

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues n/a
License MIT

symfony/http-foundation supports partitioned cookies in 6.4+. However, the PSR-7 was failing to convert such partitioned cookies when creating an HttpFoundation Response because it used its own parsing logic for the Set-Cookie header instead of reusing the logic exposed by HttpFoundation (since Symfony 3.3), and that logic was outdated. I fixed that by using Cookie::fromString for the parsing of the cookie.

Note that the logic in the bridge was also only testing a few cases, while HttpFoundation has a more extensive test coverage for its parsing algorithm. And there is no reason to maintain such parsing twice (with totally different implementations)

@carsonbot carsonbot changed the title Fix conversion of partitioned cookies in the PSR-7 bridge [PsrHttpMessageBridge] Fix conversion of partitioned cookies in the PSR-7 bridge Aug 14, 2024
@carsonbot carsonbot added the Bug label Aug 14, 2024
@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "7.2" but it seems your PR description refers to branch "6.4".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@carsonbot carsonbot added this to the 7.2 milestone Aug 14, 2024
@fabpot fabpot changed the base branch from 7.2 to 6.4 August 14, 2024 16:52
@fabpot
Copy link
Member

fabpot commented Aug 14, 2024

Thank you @stof.

@fabpot fabpot merged commit ccdcd9b into symfony:6.4 Aug 14, 2024
9 of 10 checks passed
@stof stof deleted the cookie_conversion branch August 14, 2024 17:31
This was referenced Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants