SigHelper: Use 'URI.parse' instead of 'URI.new'

Co-authored-by: Brahim Hadriche <brahim.hadriche@gmail.com>
This commit is contained in:
Samantaz Fox 2024-07-04 15:47:19 +00:00
parent 0fc4034f42
commit 9713a54f67
No known key found for this signature in database
GPG Key ID: F42821059186176E

View File

@ -274,10 +274,10 @@ class Invidious::SigHelper
when .starts_with?('/')
@socket = UNIXSocket.new(host_or_path)
when .starts_with?("tcp://")
uri = URI.new(host_or_path)
uri = URI.parse(host_or_path)
@socket = TCPSocket.new(uri.host.not_nil!, uri.port.not_nil!)
else
uri = URI.new("tcp://#{host_or_path}")
uri = URI.parse("tcp://#{host_or_path}")
@socket = TCPSocket.new(uri.host.not_nil!, uri.port.not_nil!)
end