Skip to content

Commit 5bf8e06

Browse files
Ruby 3.4 URI module compatibility
1 parent 1029ca2 commit 5bf8e06

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/amq/uri.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def self.parse(connection_string)
3434
opts[:scheme] = uri.scheme
3535
opts[:user] = ::CGI::unescape(uri.user) if uri.user
3636
opts[:pass] = ::CGI::unescape(uri.password) if uri.password
37-
opts[:host] = uri.host if uri.host
37+
opts[:host] = uri.host if uri.host and uri.host != ""
3838
opts[:port] = uri.port || AMQP_DEFAULT_PORTS[uri.scheme]
3939
opts[:ssl] = uri.scheme.to_s.downcase =~ /amqps/i # TODO: rename to tls
4040
if uri.path =~ %r{^/(.*)}

spec/amq/uri_parsing_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
let(:uri) { "amqp://" }
3131

3232
# Note that according to the ABNF, the host component may not be absent, but it may be zero-length.
33-
it "falls back to default nil host" do
33+
it "falls back to a blank value" do
3434
expect(subject[:host]).to be_nil
3535
end
3636
end

0 commit comments

Comments
 (0)