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