Skip to content

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

Open
masterkain wants to merge 1 commit intoruby-oauth:mainfrom
masterkain:feat/fix-ruby4-cgi-warning
Open

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

Conversation

@masterkain
Copy link

@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

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).

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.

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