method
redirectable?
v1_8_7_72 -
Show latest stable
- Class:
OpenURI
redirectable?(uri1, uri2)public
No documentation available.
# File lib/open-uri.rb, line 193
def OpenURI.redirectable?(uri1, uri2) # :nodoc:
# This test is intended to forbid a redirection from http://... to
# file:///etc/passwd.
# However this is ad hoc. It should be extensible/configurable.
uri1.scheme.downcase == uri2.scheme.downcase ||
(/\A(?:http|ftp)\z/i =~ uri1.scheme && /\A(?:http|ftp)\z/i =~ uri2.scheme)
end