Skip to content

Instantly share code, notes, and snippets.

@ABrambleNinja
ABrambleNinja / open_uri.rb
Last active December 18, 2015 22:39 — forked from zaius/open_uri.rb
# Allow open-uri to follow unsafe redirects (i.e. https to http).
# Relevant issue:
# http://redmine.ruby-lang.org/issues/3719
# Source here:
# https://github.com/ruby/ruby/blob/trunk/lib/open-uri.rb
module OpenURI
class <<self
alias_method :open_uri_original, :open_uri
alias_method :redirectable_cautious?, :redirectable?