Skip to content

Commit 605a303

Browse files
authored
fix: replace deprecated CGI.parse with URI.decode_www_form for Ruby 4.0 compatibility (#453)
Ruby 4.0 removed CGI.parse from the standard library. Use URI.decode_www_form instead, which is part of the core URI library and provides identical functionality.
1 parent c719e8f commit 605a303

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lib/yt/models/resumable_session.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
require 'cgi'
21
require 'yt/models/base'
32

43
module Yt
@@ -30,7 +29,7 @@ def upload_thumbnail(file)
3029
private
3130

3231
def session_params
33-
CGI::parse(@uri.query).tap{|hash| hash.each{|k,v| hash[k] = v.first}}
32+
URI.decode_www_form(@uri.query || "").to_h
3433
end
3534

3635
# @note: YouTube documentation states that a valid upload returns an HTTP

0 commit comments

Comments
 (0)