2017-03-18 21:51:20 +00:00
|
|
|
require 'open-uri'
|
|
|
|
|
|
|
|
module OpenURI
|
2018-10-04 15:38:04 +00:00
|
|
|
def self.redirectable?(uri1, uri2) # :nodoc:
|
2018-10-08 02:50:11 +00:00
|
|
|
uri1.scheme.casecmp(uri2.scheme).zero? ||
|
2021-01-22 09:09:08 +00:00
|
|
|
(/\A(?:http|https|ftp)\z/i.match?(uri1.scheme) && /\A(?:http|https|ftp)\z/i.match?(uri2.scheme))
|
2017-03-18 21:51:20 +00:00
|
|
|
end
|
|
|
|
end
|