2017-03-18 14:51:20 -07:00
|
|
|
require 'open-uri'
|
|
|
|
|
|
|
|
module OpenURI
|
2018-10-04 08:38:04 -07:00
|
|
|
def self.redirectable?(uri1, uri2) # :nodoc:
|
2018-10-07 19:50:11 -07:00
|
|
|
uri1.scheme.casecmp(uri2.scheme).zero? ||
|
2017-03-18 14:51:20 -07:00
|
|
|
(/\A(?:http|https|ftp)\z/i =~ uri1.scheme && /\A(?:http|https|ftp)\z/i =~ uri2.scheme)
|
|
|
|
end
|
|
|
|
end
|