From: "jhilden (Jakob Hilden)" Date: 2012-06-22T21:05:57+09:00 Subject: [ruby-core:45783] [Ruby 1.8 - Bug #5950] open-uri: https redirect fix Issue #5950 has been updated by jhilden (Jakob Hilden). Seems like a duplicate of http://bugs.ruby-lang.org/issues/859 ---------------------------------------- Bug #5950: open-uri: https redirect fix https://bugs.ruby-lang.org/issues/5950#change-27362 Author: azet (Aaron Zauner) Status: Open Priority: Low Assignee: Category: lib Target version: Ruby 1.8.7 ruby -v: ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux] 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 --snip-- # 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 # file:///etc/passwd. # 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 =~ uri2.scheme) end --snip-- -- http://bugs.ruby-lang.org/