aboutsummaryrefslogtreecommitdiffstats
path: root/lib/open-uri.rb
Commit message (Collapse)AuthorAgeFilesLines
* * lib/open-uri.rb: Use `userinfo` for authenticated proxy.hsbt2016-03-301-0/+3
| | | | | | | | [fix GH-1148] Patch by @SokichiFujita * test/open-uri/test_open-uri.rb: ditto. [fix GH-1309] Patch by @jdamick git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stdlib: avoid extra calls to eliminate "\n" from Base64normal2016-01-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | We may use the '0' (zero) to avoid adding the line feed. Furthermore, the '*' (asterisk) modifier is not needed for a single-element arrays. * ext/psych/lib/psych/visitors/yaml_tree.rb (visit_String): eliminate chomp * lib/net/http.rb (connect): eliminate delete * lib/net/http/header.rb (basic_encode): ditto * lib/net/imap.rb (authenticate): eliminate gsub (self.encode_utf7): shorten delete arg * lib/net/smtp.rb (base64_encode): eliminate gsub * lib/open-uri.rb (OpenURI.open_http): eliminate delete * lib/rss/rss.rb: ditto * lib/securerandom.rb (base64): ditto (urlsafe_base64): eliminate delete! * lib/webrick/httpauth/digestauth.rb (split_param_value): eliminate chop * lib/webrick/httpproxy.rb (do_CONNECT): eliminate delete (setup_upstream_proxy_authentication): ditto [ruby-core:72666] [Feature #11938] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/ftp.rb (initialize): Connections are in passive mode pershugo2015-11-111-1/+1
| | | | | | | | | default now. The default mode can be changed by Net::FTP.default_passive=. * lib/net/ftp.rb (default_passive=, default_passive): new methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: Remove indicator for "frozen_string_literal: true".akr2015-11-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/pp.rb: Ditto. * lib/prettyprint.rb: Ditto. * lib/resolv.rb: Ditto. * lib/securerandom.rb: Ditto. * lib/tmpdir.rb: Ditto. * lib/unicode_normalize/tables.rb: Ditto. * test/net/ftp/test_buffered_socket.rb: Ditto. * test/net/ftp/test_mlsx_entry.rb: Ditto. * test/open-uri/test_open-uri.rb: Ditto. * test/open-uri/test_ssl.rb: Ditto. * test/pathname/test_pathname.rb: Ditto. * test/test_pp.rb: Ditto. * test/test_prettyprint.rb: Ditto. * tool/transcode-tblgen.rb: Ditto. * ext/pathname/lib/pathname.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: Specify frozen_string_literal: true.akr2015-10-181-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (OpenURI.open_http): refactoring of r48941.usa2014-12-241-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (OpenURI.open_http): accept multiple certs path inusa2014-12-231-5/+8
| | | | | | | | | ssl_ca_certs. * tool/downloader.rb: use certs of rubygems for downloading gems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* open-uri: accept :open_timeout optionnormal2014-10-101-0/+11
| | | | | | | | | | * lib/open-uri.rb (OpenURI::Options): add :open_timeout default * (def OpenURI.open_http): check :open_timeout option * (module OpenURI): rdoc for :open_timeout * test/open-uri/test_open-uri.rb (test_open_timeout): new test [Feature #10361] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: remove needless condition for old ruby version.hsbt2014-08-081-2/+1
| | | | | | * test/open-uri/test_open-uri.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (OpenURI.open_uri): Call StringIO#close only ifakr2014-05-051-1/+1
| | | | | | | | the StringIO object is not closed yet. Reported by Jordi Massaguer Pla. [ruby-core:42538] [Bug #6010] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: [DOC] use lower case version of core classes, samezzak2014-02-071-2/+3
| | | | | | | as commit r44878, based on patch by Jonathan Jackson [Bug #9483] [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: Make proxy disabling working again.akr2014-01-181-1/+1
| | | | | | | Fixed by Christophe Philemotte. [ruby-core:59650] [Bug #9385] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/smtp.rb: [DOC] Remove dead link to RAA by Giorgos Tsiftsiszzak2014-01-131-1/+1
| | | | | | | | Fixes the following bugs: [Bug #9152] [Bug #9268] [Bug #9394] * lib/open-uri.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (meta_add_field): : Re-implemented.akr2013-10-261-0/+4
| | | | | | | | [ruby-core:58017] [Bug #9051] patch by Eamonn Webster. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: Support multiple fields with same fieldakr2013-04-091-11/+22
| | | | | | | | | | | name (like Set-Cookie). (OpenURI::Meta#metas): New accessor to obtain fields as a Hash from field name (string) to field values (array of strings). [ruby-core:37734] [Bug #4964] reported by ren li. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: Documentation for OpenURIzzak2012-10-201-8/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: use respond_to? to test Tempfile.akr2012-07-231-2/+2
| | | | | | | | [ruby-dev:45995] [Bug #6781] reported by hsbt (Hiroshi SHIBATA). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/http.rb: Net::HTTP now automatically detects and usesdrbrain2012-07-201-78/+0
| | | | | | | | | | | | | | | | | | | | | | proxies from the environment. A proxy may also be specified as before. Net::HTTP::Proxy still creates anonymous classes, but these classes are only used to store configuration information. When an HTTP instance is created the configuration is now copied. Additionally, Net::HTTP::ProxyDelta is no longer used by Net::HTTP [Feature #6546] * lib/open-uri.rb: Moved URI::Generic#find_proxy to uri/generic. * lib/uri/generic.rb: Imported find_proxy from open-uri. * test/open-uri/test_open-uri.rb: Moved proxy-discovery tests to URI. * test/uri/test_generic.rb: Imported proxy-discovery tests from open-uri. * test/net/http/test_http.rb: Added tests for proxy behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: delete space.ayumin2012-07-171-1/+1
| | | | | | * test/psych/test_alias_and_anchor.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: call io.close! for Tempfile.akr2012-07-171-1/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: Fix indentation of OpenURI::OpenRead#open. Use ++drbrain2011-08-261-27/+35
| | | | | | | instead of `' for method arguments in open-uri.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/pathname/lib/pathname.rb: Fix typos and grammar mistakes. Patchdrbrain2011-08-261-29/+27
| | | | | | | | | | | | | | | | by Luke Gruber. [#5203] * ext/pty/lib/expect.rb: ditto * lib/mathn.rb: ditto * lib/net/http.rb: ditto * lib/open-uri.rb: ditto * lib/ostruct.rb: ditto * lib/tempfile.rb: ditto * lib/thread.rb: ditto * lib/weakref.rb: ditto * sample/webrick/httpproxy.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update comment.akr2011-05-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/resolv-replace.rb: suppress warning.akr2010-10-291-3/+3
| | | | | | | | * lib/open-uri.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/generic.rb (URI::Generic#hostname): new method.akr2010-10-061-7/+7
| | | | | | | | | | | | | | (URI::Generic#hostname=): ditto. * lib/open-uri.rb: use URI#hostname * lib/net/http.rb: ditto. [ruby-core:32056] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix a typo.akr2009-11-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (OpenURI::Meta#content_type_parse): strip quotes.akr2009-09-131-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (URI::FTP#buffer_open): fix the %2F handling.akr2009-09-121-2/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (URI::FTP#buffer_open): use the port specified inakr2009-09-121-1/+2
| | | | | | | the URI. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (OpenURI.redirectable?): reverted https redirection.akr2009-01-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (OpenURI.redirectable?): permit https redirection.akr2008-12-271-1/+1
| | | | | | | patch from Roman Shterenzon. [ruby-core:20485] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: remove debug code introduced by previous change.akr2008-10-051-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (OpenURI.open_uri): set encoding to strio.naruse2008-10-051-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* trailing spaces removed.akr2008-09-141-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rdoc.rb: massive spelling correction patch from Evan Farrarmatz2008-06-041-1/+1
| | | | | | <evanfarrar at gmail.com> in [ruby-doc:1382] applied. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (OpenURI::Meta#meta_setup_encoding): use ASCII-8BITakr2008-02-281-5/+7
| | | | | | | for charset unspecified non-text data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (OpenURI::Meta#meta_setup_encoding): setup encodingakr2008-02-281-1/+20
| | | | | | | | | by charset. (OpenURI::Meta#meta_add_field): call meta_setup_encoding when content-type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (OpenURI.open_http): rescue URI::InvalidURIError byakr2008-02-081-1/+6
| | | | | | | URI.parse for location URI. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/text.rb, lib/rubygems/open-uri.rb, lib/open-uri.rb,naruse2008-01-231-1/+1
| | | | | | | test/logger/test_logger.rb, test/ruby/test_regexp.rb: fix tests. [ruby-dev:33336] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (OpenURI::Buffer): use Meta ===. [ruby-core:14295]akr2007-12-241-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix method redefined warning in open-uri.rb. [ruby-core:14304].drbrain2007-12-231-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: :redirect option implemented to disable redirects.akr2007-10-281-0/+24
| | | | | | | (OpenURI::HTTPRedirect): new exception class for redirection. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (OpenURI.open_http): fix :ssl_ca_cert option.akr2007-10-131-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/http.rb: remove enable_post_connection_check flag.gotoyuzo2007-10-071-5/+0
| | | | | | | * lib/open-uri.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/http.rb: an SSL verification (the server hostname shouldgotoyuzo2007-09-231-10/+5
| | | | | | | | | | | | | | | | be matched with its certificate's commonName) is added. this verification can be skipped by "Net::HTTP#enable_post_connection_check=(false)". suggested by Chris Clark <cclark at isecpartners.com> * lib/net/open-uri.rb: use Net::HTTP#enable_post_connection_check to perform SSL post connection check. * ext/openssl/lib/openssl/ssl.c (OpenSSL::SSL::SSLSocket#post_connection_check): refine error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: add :ftp_active_mode option.akr2007-08-291-1/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: make ftp passive mode to avoid NAT problem.akr2007-08-131-0/+1
| | | | | | | [ruby-dev:31377] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (URI::Generic#find_proxy): use ENV.to_hash to accessakr2007-07-131-1/+1
| | | | | | | | http_proxy environment variable to avoid case insensitive environment search. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (OpenURI::OpenURI.open_uri): revert last change to conform ↵matz2007-01-311-3/+0
| | | | | | RFC3986. [ruby-dev:30230] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (OpenURI::OpenURI.open_uri): use user andmatz2007-01-311-0/+3
| | | | | | | password from URI unless http_basic_authentication is specified explicitly. [ruby-core:10114] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e