aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-07 07:14:30 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-07 07:14:30 +0000
commit7a65b1c0234f07c980d317702a3ebcf6cab00e7d (patch)
tree18108eff0a645227ed38bb793ae24692bce3a0c5
parent50ee8644efa965e7a9d22f16fb74de938c13967a (diff)
downloadruby-7a65b1c0234f07c980d317702a3ebcf6cab00e7d.tar.gz
lib/open-uri.rb: Allow http to https redirection.
* lib/open-uri.rb: Allow http to https redirection. Note that https to http is still forbidden. [ruby-core:20485] [Feature #859] by Roman Shterenzon. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--lib/open-uri.rb2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e6ef460fce..d3a71288fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Sep 7 16:00:45 2016 Tanaka Akira <akr@fsij.org>
+
+ * lib/open-uri.rb: Allow http to https redirection.
+ Note that https to http is still forbidden.
+ [ruby-core:20485] [Feature #859] by Roman Shterenzon.
+
Wed Sep 7 14:56:59 2016 Kazuki Tsujimoto <kazuki@callcc.net>
* lib/csv.rb (CSV::{Row,Table}#{each,delete_if}): returns an enumerator
diff --git a/lib/open-uri.rb b/lib/open-uri.rb
index 489b83ac98..2414f5101c 100644
--- a/lib/open-uri.rb
+++ b/lib/open-uri.rb
@@ -249,7 +249,7 @@ module OpenURI
# (RFC 2109 4.3.1, RFC 2965 3.3, RFC 2616 15.1.3)
# 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)
+ (/\A(?:http|ftp)\z/i =~ uri1.scheme && /\A(?:https?|ftp)\z/i =~ uri2.scheme)
end
def OpenURI.open_http(buf, target, proxy, options) # :nodoc: