We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c47a92b commit f176462Copy full SHA for f176462
lib/uri/rfc2396_parser.rb
@@ -263,7 +263,7 @@ def make_regexp(schemes = nil)
263
unless schemes
264
@regexp[:ABS_URI_REF]
265
else
266
- /(?=#{Regexp.union(*schemes)}:)#{@pattern[:X_ABS_URI]}/x
+ /(?=(?i:#{Regexp.union(*schemes).source}):)#{@pattern[:X_ABS_URI]}/x
267
end
268
269
test/uri/test_parser.rb
@@ -113,4 +113,12 @@ def test_rfc3986_port_check
113
114
115
116
+
117
+ def test_rfc2822_make_regexp
118
+ parser = URI::RFC2396_Parser.new
119
+ regexp = parser.make_regexp("HTTP")
120
+ assert_match(regexp, "HTTP://EXAMPLE.COM/")
121
+ assert_match(regexp, "http://example.com/")
122
+ refute_match(regexp, "https://example.com/")
123
+ end
124
0 commit comments