From e7f4b3555d0bf7ed12d6bb84d369d7fd50a2ace4 Mon Sep 17 00:00:00 2001 From: Stephen Baldwin Date: Fri, 31 Oct 2025 13:56:31 -0700 Subject: [PATCH] [PROTON-2907] Check what parser URI::DEFAULT_PARSER is set to instead of ruby version --- ruby/lib/core/uri.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby/lib/core/uri.rb b/ruby/lib/core/uri.rb index c1f5671d7..ef21b4692 100644 --- a/ruby/lib/core/uri.rb +++ b/ruby/lib/core/uri.rb @@ -47,7 +47,7 @@ module Qpid::Proton private # Make sure to allow empty hostnames, Ruby 2.0.0 does not. DEFAULT_URI_PARSER = - if RUBY_VERSION >= '3.4' + if defined?(URI::RFC3986_Parser) && URI::DEFAULT_PARSER.is_a?(URI::RFC3986_Parser) URI::RFC2396_Parser.new(:HOSTNAME => /(?:#{URI::PATTERN::HOSTNAME})|/) else URI::Parser.new(:HOSTNAME => /(?:#{URI::PATTERN::HOSTNAME})|/)