Skip to content

Conversation

@xuan-cao-swi
Copy link
Contributor

This PR tries to use URI.encode/decode_uri_component to replace CGI.escape/unescape.

Although cgi/escape is present in Ruby 4.0.0, it is not available in Ruby versions less than 4.0.0. We can use cgi/escape once all Ruby 3 versions are deprecated, if required.

The difference between these two implementation is the treatment for asterisk (*), which CGI encode to %2A, but URI preserve * (see more in #2016).

CGI will silence the invalid char encode/decode, while URI will raise the error.

@xuan-cao-swi xuan-cao-swi changed the title fix!: replace cgi fix!: replace cgi with uri for encode and decode Jan 15, 2026
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.

1 participant