Skip to content
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

Allow parsing cookies with space in the value #14455

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

anton7c3
Copy link
Contributor

@anton7c3 anton7c3 commented Apr 8, 2024

Fixes #14435.

Move parse_set_cookie example to the correct location.

src/http/cookie.cr Outdated Show resolved Hide resolved
@bararchy
Copy link
Contributor

bararchy commented Apr 8, 2024

Looks good to me and fixes the current issue I'm seeing (#14435)

@anton7c3 anton7c3 force-pushed the master branch 3 times, most recently from c748b0d to 912f1c1 Compare April 15, 2024 14:53
@anton7c3 anton7c3 requested a review from hovsater April 15, 2024 14:54
src/http/cookie.cr Outdated Show resolved Hide resolved
@beta-ziliani beta-ziliani added this to the 1.13.0 milestone May 29, 2024
Copy link
Contributor

@ysbaddaden ysbaddaden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just left a question about a convoluted case (spaces around the quotes), otherwise 👍

@straight-shoota straight-shoota removed this from the 1.13.0 milestone Jun 1, 2024
@straight-shoota straight-shoota added this to the 1.13.0 milestone Jun 25, 2024
@straight-shoota straight-shoota changed the title fix(http/cookies): allow spaces to be present in the cookie value Allow parsing cookies with space in the value Jun 26, 2024
@straight-shoota straight-shoota merged commit 1ac3280 into crystal-lang:master Jun 26, 2024
61 checks passed
akadusei added a commit to akadusei/lucky that referenced this pull request Aug 12, 2024
```
Failures:

  1) Lucky::CookieJar raises a nicer error for invalid cookie values
     Failure/Error: expect_raises(Lucky::InvalidCookieValueError, "Cookie value for 'cookie' is invalid") do

       Expected Lucky::InvalidCookieValueError but nothing was raised

Error:      # spec/lucky/cookies/cookie_jar_spec.cr:41
```

Crystal v1.13 accepts space in cookie values as valid.

See <crystal-lang/crystal#14455>.
jwoertink pushed a commit to luckyframework/lucky that referenced this pull request Aug 12, 2024
* Fix invalid query string for array params

* Add spec expectation

* Add check for correctness of values returned from array query params

* Fix failed specs in Crystal v1.13

```
Failures:

  1) Lucky::CookieJar raises a nicer error for invalid cookie values
     Failure/Error: expect_raises(Lucky::InvalidCookieValueError, "Cookie value for 'cookie' is invalid") do

       Expected Lucky::InvalidCookieValueError but nothing was raised

Error:      # spec/lucky/cookies/cookie_jar_spec.cr:41
```

Crystal v1.13 accepts space in cookie values as valid.

See <crystal-lang/crystal#14455>.
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.

Allow space in cookie value for Set-Cookie header
8 participants