[3-1-stable] Replace usage of CGI::Cookie#2328
Merged
ioquatix merged 1 commit intorack:3-1-stablefrom May 17, 2025
Merged
Conversation
Contributor
|
Are you planing to do a 2.x backport or should I? |
jeremyevans
approved these changes
May 12, 2025
Contributor
Author
|
@byroot I wasn't thinking about that, pelase do. |
In Ruby 3.5, `cgi` will only contain functions related to escaping/unescaping. https://bugs.ruby-lang.org/issues/21258 This is not an exact replicate of course, (`CGI::Cookie`) has some validations and coerces on setters but considering for that purpose this is, they don't seem necessary? During construction of the object rack already does conversions as necessary and setters don't make much sense, and aren't documented/tested for. Although, for improved backwards compatibility, it wouldn't be much effort to make them `attr_accesor` instead.
Earlopain
commented
May 17, 2025
| cookie_bits = cookie_filling.split(';') | ||
| cookie_attributes = Hash.new | ||
| cookie_attributes.store('value', cookie_bits[0].strip) | ||
| cookie_attributes.store('value', Array(cookie_bits[0].strip)) |
Contributor
Author
There was a problem hiding this comment.
CGI::Cookie does this in its constructor (it's also a subclass of Array). It's required for the wrapper so value[0] doesn't just return a single char.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's #2327, but for the latest stable version (:
cc @byroot