diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/open-uri.rb | 3 | ||||
-rw-r--r-- | test/open-uri/test_open-uri.rb | 4 |
3 files changed, 7 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Fri Aug 8 17:19:57 2014 SHIBATA Hiroshi <[email protected]> + + * lib/open-uri.rb: remove needless condition for old ruby version. + * test/open-uri/test_open-uri.rb: ditto. + Fri Aug 8 16:40:59 2014 SHIBATA Hiroshi <[email protected]> * lib/irb/init.rb: removed unreachable code. diff --git a/lib/open-uri.rb b/lib/open-uri.rb index f9822a9847..b793828063 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -256,8 +256,7 @@ module OpenURI raise "Non-HTTP proxy URI: #{proxy_uri}" if proxy_uri.class != URI::HTTP end - if target.userinfo && "1.9.0" <= RUBY_VERSION - # don't raise for 1.8 because compatibility. + if target.userinfo raise ArgumentError, "userinfo not supported. [RFC3986]" end diff --git a/test/open-uri/test_open-uri.rb b/test/open-uri/test_open-uri.rb index ff7fc3376e..4073754bd7 100644 --- a/test/open-uri/test_open-uri.rb +++ b/test/open-uri/test_open-uri.rb @@ -401,9 +401,7 @@ class TestOpenURI < Test::Unit::TestCase end def test_userinfo - if "1.9.0" <= RUBY_VERSION - assert_raise(ArgumentError) { open("http://user:[email protected]/") {} } - end + assert_raise(ArgumentError) { open("http://user:[email protected]/") {} } end def test_progress |