Skip to content

Use cgi/escape instead of full cgi library - #95

Merged
tagliala merged 1 commit into
masterfrom
fix/ruby-4-cgi-warning
Jul 27, 2026
Merged

Use cgi/escape instead of full cgi library#95
tagliala merged 1 commit into
masterfrom
fix/ruby-4-cgi-warning

Conversation

@tagliala

Copy link
Copy Markdown
Member

Ruby 4.0 removed the bundled CGI gem, causing a warning when require 'cgi' is used. The cgi/escape module has been available since Ruby 2.0 and provides only CGI.escape and CGI.unescape, which is all this file needs.

Ruby 4.0 removed the bundled CGI gem, causing a warning when
`require 'cgi'` is used. The cgi/escape module has been available
since Ruby 2.0 and provides only CGI.escape and CGI.unescape,
which is all this file needs.

Copilot AI left a comment

Copy link
Copy Markdown

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 updates Hawk’s HTTP instrumentation to avoid requiring Ruby’s full cgi library (which emits warnings on Ruby 4.0 due to CGI being extracted from stdlib), while still supporting URL escaping/unescaping used for log output.

Changes:

  • Replaces require 'cgi' with a narrower require intended to only load escaping helpers.

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

Comment thread lib/hawk/http/instrumentation.rb
@tagliala
tagliala force-pushed the fix/ruby-4-cgi-warning branch from 4a5d0b5 to d112ec0 Compare July 27, 2026 14:13
@tagliala
tagliala merged commit d3265ff into master Jul 27, 2026
62 checks passed
@tagliala
tagliala deleted the fix/ruby-4-cgi-warning branch July 27, 2026 14:16
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.

3 participants