Skip to content

Commit d8fd39c

Browse files
committed
Handle to look up CGI::EscapeExt instead of using LoadError. cgi/escape is provided snce Ruby 2.3
1 parent be187b9 commit d8fd39c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/net/http.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,11 +1917,8 @@ def proxy_pass
19171917
private
19181918

19191919
def unescape(value)
1920-
begin
1921-
require "cgi/escape"
1922-
rescue LoadError
1923-
require "cgi/util"
1924-
end
1920+
require 'cgi/escape'
1921+
require 'cgi/util' unless defined?(CGI::EscapeExt)
19251922
CGI.unescape(value)
19261923
end
19271924

0 commit comments

Comments
 (0)