bastodon/config/initializers/open_uri_redirection.rb

8 lines
240 B
Ruby

require 'open-uri'
module OpenURI
def OpenURI.redirectable?(uri1, uri2) # :nodoc:
uri1.scheme.downcase == uri2.scheme.downcase ||
(/\A(?:http|https|ftp)\z/i =~ uri1.scheme && /\A(?:http|https|ftp)\z/i =~ uri2.scheme)
end
end