Skip to content

Commit

Permalink
Merge pull request #1620 from yahonda/address_uri_rfc_3986_parser_war…
Browse files Browse the repository at this point in the history
…nings

Address `warning: URI::RFC3986_PARSER` warnings
  • Loading branch information
radar authored Jan 21, 2025
2 parents 73db11a + a2da80f commit 182f2be
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/mail/utilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ def uri_unescape( str )
end

def uri_parser
@uri_parser ||= URI.const_defined?(:DEFAULT_PARSER) ? URI::DEFAULT_PARSER : URI
@uri_parser ||= if URI.const_defined?(:DEFAULT_PARSER)
defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::DEFAULT_PARSER
else
URI
end
end

# Matches two objects with their to_s values case insensitively
Expand Down Expand Up @@ -464,7 +468,7 @@ def Utilities.param_encode(str)
end

def Utilities.uri_parser
URI::DEFAULT_PARSER
defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::DEFAULT_PARSER
end

# Pick a Ruby encoding corresponding to the message charset. Most
Expand Down

0 comments on commit 182f2be

Please sign in to comment.