Skip to content

Conversation

@vcsjones
Copy link
Member

@vcsjones vcsjones commented Dec 9, 2025

Ruby 4.0 (currently preview 2) has removed the default dependency on CGI:

CGI library is removed from the default gems. Now we only provide cgi/escape for the following methods:

We use CGI::Cookie

@parsed_cookie ||= CGI::Cookie.parse(raw_cookie)

So we should take an explicit dependency on the cgi gem.

Copilot AI review requested due to automatic review settings December 9, 2025 22:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an explicit dependency on the cgi gem to ensure compatibility with Ruby 4.0, which has removed cgi from its default gems (except for cgi/escape). Since the codebase uses CGI::Cookie.parse (which is NOT part of cgi/escape) and CGI.unescape in lib/secure_headers/headers/cookie.rb, this dependency is necessary for the gem to function properly with Ruby 4.0.

Key Changes:

  • Added cgi gem as a runtime dependency with version constraint ~> 0.5.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants