Skip to content

Commit 182f2be

Browse files
authored
Merge pull request #1620 from yahonda/address_uri_rfc_3986_parser_warnings
Address `warning: URI::RFC3986_PARSER` warnings
2 parents 73db11a + a2da80f commit 182f2be

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/mail/utilities.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,11 @@ def uri_unescape( str )
165165
end
166166

167167
def uri_parser
168-
@uri_parser ||= URI.const_defined?(:DEFAULT_PARSER) ? URI::DEFAULT_PARSER : URI
168+
@uri_parser ||= if URI.const_defined?(:DEFAULT_PARSER)
169+
defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::DEFAULT_PARSER
170+
else
171+
URI
172+
end
169173
end
170174

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

466470
def Utilities.uri_parser
467-
URI::DEFAULT_PARSER
471+
defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::DEFAULT_PARSER
468472
end
469473

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

0 commit comments

Comments
 (0)