Skip to content

Commit 91675da

Browse files
committed
Stop using the deprecated URI.parser
1 parent 20d1b98 commit 91675da

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/active_resource/connection.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def initialize(site, format = ActiveResource::Formats::JsonFormat, logger: nil)
4444
def site=(site)
4545
@site = site.is_a?(URI) ? site : URI.parse(site)
4646
@ssl_options ||= {} if @site.is_a?(URI::HTTPS)
47-
@user = URI.parser.unescape(@site.user) if @site.user
48-
@password = URI.parser.unescape(@site.password) if @site.password
47+
@user = URI::DEFAULT_PARSER.unescape(@site.user) if @site.user
48+
@password = URI::DEFAULT_PARSER.unescape(@site.password) if @site.password
4949
end
5050

5151
# Set the proxy for remote service.
@@ -174,8 +174,8 @@ def http
174174

175175
def new_http
176176
if @proxy
177-
user = URI.parser.unescape(@proxy.user) if @proxy.user
178-
password = URI.parser.unescape(@proxy.password) if @proxy.password
177+
user = URI::DEFAULT_PARSER.unescape(@proxy.user) if @proxy.user
178+
password = URI::DEFAULT_PARSER.unescape(@proxy.password) if @proxy.password
179179
Net::HTTP.new(@site.host, @site.port, @proxy.host, @proxy.port, user, password)
180180
else
181181
Net::HTTP.new(@site.host, @site.port)

0 commit comments

Comments
 (0)