From dcac24bff6c4c353a60f5c98e1069bf3801d7e99 Mon Sep 17 00:00:00 2001 From: Yuta Kurotaki Date: Mon, 8 May 2023 22:17:20 +0900 Subject: [PATCH] Checking userinfo with the uri method (#233) --- lib/eth/client/http.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/eth/client/http.rb b/lib/eth/client/http.rb index 96ced341..3f9cef61 100644 --- a/lib/eth/client/http.rb +++ b/lib/eth/client/http.rb @@ -46,7 +46,7 @@ def initialize(host) @host = uri.host @port = uri.port @ssl = uri.scheme == "https" - if Regexp.new(":.*@.*:", Regexp::IGNORECASE).match host + if !(uri.user.nil? && uri.password.nil?) @user = uri.user @password = uri.password @uri = URI("#{uri.scheme}://#{uri.user}:#{uri.password}@#{@host}:#{@port}#{uri.path}")