Skip to content

fix: require cgi/escape to avoid Ruby 4 CGI warning#700

Merged
pboling merged 1 commit intoruby-oauth:mainfrom
masterkain:feat/fix-ruby4-cgi-warning
Mar 9, 2026
Merged

fix: require cgi/escape to avoid Ruby 4 CGI warning#700
pboling merged 1 commit intoruby-oauth:mainfrom
masterkain:feat/fix-ruby4-cgi-warning

Conversation

@masterkain
Copy link
Copy Markdown
Contributor

@masterkain masterkain commented Mar 5, 2026

Summary

  • replace require "cgi" with require "cgi/escape" in lib/oauth2.rb
  • keep escape/unescape support while avoiding Ruby 4 warning about removed cgi stdlib

Reproduction

ruby -w -Ilib -e 'require "oauth2"'

Before this change on Ruby 4, warning includes:

CGI library is removed from Ruby 4.0

Verification

ruby -w -Ilib -e 'require "oauth2"; puts OAuth2::Version::VERSION'
bundle exec rspec spec/oauth2/strategy/auth_code_spec.rb spec/oauth2/strategy/implicit_spec.rb spec/oauth2/access_token_spec.rb

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d81a98b) to head (2babd4b).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #700   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          567       567           
  Branches       174       174           
=========================================
  Hits           567       567           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@pboling pboling left a comment

Choose a reason for hiding this comment

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

LGTM

@pboling pboling merged commit bc8046c into ruby-oauth:main Mar 9, 2026
35 of 39 checks passed
@pboling pboling self-assigned this Mar 9, 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.

2 participants