Feature #859: open-uri doesn't allow redirection to https
open-uri: https redirect fix
open-uri raises an exception if a http/s redirect refers to https.
original mail to the maintainer with a quickfix: https://gist.github.com/1704932
this is taken from the original ruby open-uri class,¶
fixed this to support secure socket http redirects:¶
def OpenURI.redirectable?(uri1, uri2) # :nodoc:
# This test is intended to forbid a redirection from http://... to
# However this is ad hoc. It should be extensible/configurable.
uri1.scheme.downcase == uri2.scheme.downcase ||
(/\A(?:http|ftp|https)\z/i =~ uri1.scheme && /\A(?:http|ftp|https)\z/i =~