Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/uri/rfc2396_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def make_regexp(schemes = nil)
unless schemes
@regexp[:ABS_URI_REF]
else
/(?=#{Regexp.union(*schemes)}:)#{@pattern[:X_ABS_URI]}/x
/(?=(?i:#{Regexp.union(*schemes).source}):)#{@pattern[:X_ABS_URI]}/x
end
end

Expand Down
8 changes: 8 additions & 0 deletions test/uri/test_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,12 @@ def test_rfc3986_port_check
end
end
end

def test_rfc2822_make_regexp
parser = URI::RFC2396_Parser.new
regexp = parser.make_regexp("HTTP")
assert_match(regexp, "HTTP://EXAMPLE.COM/")
assert_match(regexp, "http://example.com/")
refute_match(regexp, "https://example.com/")
end
end
Loading