summaryrefslogtreecommitdiff
path: root/test/open-uri
Commit message (Collapse)AuthorAgeFilesLines
* Add :ssl_min_version and :ssl_max_version optionsKazuki Yamaguchi2022-10-121-19/+18
| | | | | | Replace :ssl_version option with these two new options. These provide access to OpenSSL::SSL::SSLContext#{min,max}_version=, which is the recommended way to specify SSL/TLS protocol versions.
* [ruby/open-uri] fix: added test case that validates that bad TLS version is ↵Nishant Patel2022-10-061-10/+20
| | | | | | silently ignored https://github.com/ruby/open-uri/commit/4b91b11730
* [ruby/open-uri] feat: allow option to pass version of SSL / TLS to use ↵Nishant Patel2022-10-061-0/+10
| | | | | | during communication. Allow versions are OpenSSL::SSL::SSLContext::METHODS https://github.com/ruby/open-uri/commit/8729858517
* [ruby/open-uri] Use omit instead of skip for test-unitHiroshi SHIBATA2022-10-061-2/+2
| | | | https://github.com/ruby/open-uri/commit/63f466d6ed
* [ruby/open-uri] Run global constant count test only under Ruby 3.2Hiroshi SHIBATA2022-10-061-0/+1
| | | | https://github.com/ruby/open-uri/commit/a8f1605ae9
* [ruby/open-uri] Avoid busting the global constant cacheJean Boussier2022-10-061-1/+9
| | | | | | | | | | `Object#extend(mod)` bump the global constant cache if the module has constants of its own. So by moving these constants outside of `Meta` we avoid bumping the cache. https://github.com/ruby/open-uri/commit/363c399bac
* Guard for the ftp protocol feature of OpenURIHiroshi SHIBATA2021-05-271-122/+128
|
* Fix some typos by spell checkerRyuta Kamizono2021-04-261-1/+1
|
* Remove the deprecated override of Kernel#open in open-uriJeremy Evans2020-08-161-12/+0
| | | | This was deprecated in 2.7 to resolve [Misc #15893].
* The default charset of text/* media type is UTF-8.Tanaka Akira2019-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks for the patch gareth (Gareth Adams). [Bug #15933] ------- Combines two small, but very related changes 1: Treat HTTPS the same as HTTP Previously, OpenURI followed guidance in RFC2616/3.7.1: > When no explicit charset parameter is provided by the sender, media > subtypes of the "text" type are defined to have a default charset > value of "ISO-8859-1" when received via HTTP. However this RFC was written before TLS was established and OpenURI was never updated to treat HTTPS traffic the same way. So, HTTPS documents received a different default to HTTP documents. This commit removes the scheme check so that all text/* documents processed by OpenURI are treated the same way. In theory this processing gets applied to FTP URIs too, but there's no mechanism in OpenURI for FTP documents to have Content-Type metadata appended to them, so this ends up being a no-op. 2: Change default charset for text/* to UTF-8 Replaces the default ISO-8859-1 charset previously defined in RFC2616 (now obsoleted) with a UTF-8 charset as defined in RFC6838. Fixes: https://bugs.ruby-lang.org/issues/15933
* Warn open-uri's "open" method at Kernel.Tanaka Akira2019-07-142-55/+67
| | | | | | Use URI.open instead. Thanks for the patch by jeremyevans0 (Jeremy Evans) [Misc #15893].
* open-uri: Regenerate server certificates for testsYusuke Endoh2019-05-271-124/+217
| | | | | OpenSSL 1.1.1 requires 2048 bits or more. This change will fix: https://rubyci.org/logs/rubyci.s3.amazonaws.com/debian/ruby-master/log/20190527T003004Z.fail.html.gz#test%2Fopen-uri
* open-uri defines URI.open defined as an alias.akr2017-12-211-0/+10
| | | | | | | | open-uri's Kernel.open will be deprecated in future. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/open-uri.rb: accept :encoding option as well as encoding in mode string.akr2017-10-211-0/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r57323nobu2017-01-141-4/+4
| | | | | | | | StringIO.new makes the buffer IO.default_external, while StringIO.new("".dup) makes source encoding which is defaulted to UTF-8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* StringIO.new makes a RW buffernobu2017-01-141-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* open-uri: don't use OpenSSL::TestUtils from open-uri testsrhe2016-11-291-4/+35
| | | | | | Follow net/http. Define own test DH parameters and use. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2016-06-071-7/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* open-uri: regenerate server certificates used in testsrhe2016-06-071-80/+76
| | | | | | | | | | | * test/open-uri/test_ssl.rb: Regenerate test certificates. The test CA certificate was incorrectly generated. A CA certificate must have the basic constraints extension with cA bit set to TRUE. OpenSSL <= 1.0.2 allowed the error when the certificate is in the trusted store but OpenSSL 1.1.0 no longer does. [ruby-core:75225] [Feature #12324] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: Use `userinfo` for authenticated proxy.hsbt2016-03-301-0/+36
| | | | | | | | [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
* leakchecker.rb: remove temporary measurenobu2016-01-052-0/+4
| | | | | | | | | | | | | * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#watcher): make watcher thread restartable. * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#terminate): new method to terminate watcher thread. * test/lib/leakchecker.rb (LeakChecker#find_threads): revert r46941. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test: use String#b instead of dup.force_encodingnobu2015-12-141-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb: Remove indicator for "frozen_string_literal: true".akr2015-11-102-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-182-8/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use assert_raisenobu2015-06-021-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* skip old OpenSSLnobu2014-12-131-1/+4
| | | | | | | * test/open-uri/test_ssl.rb, test/webrick/test_httpproxy.rb: also depends on test/openssl/utils.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/net/http/test_https.rbusa2014-12-091-4/+8
| | | | | | | | | | | | (TestNetHTTPS#test_certificate_verify_failure): on Windows, Errno::ECONNRESET will be raised when the verify is failure at the client side, and it'll be eaten by WEBrick. * test/open-uri/test_ssl.rb (TestOpenURISSL#test_validation_failure): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/open-uri: Test server log in server thread.akr2014-11-092-124/+93
| | | | | | | | * test/webrick: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/webrick: Store log in an array.akr2014-11-092-15/+21
| | | | | | | | | | * test/net/http: Ditto. * test/open-uri: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use assert_join_threads.akr2014-11-082-66/+219
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/open-uri/test_open-uri.rb: Check empty webrick log.akr2014-11-061-10/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/open-uri/test_open-uri.rb: Don't ignore webrick's log.akr2014-11-051-5/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* open-uri: accept :open_timeout optionnormal2014-10-101-0/+18
| | | | | | | | | | * 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-3/+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
* support RFC3986 [Feature #2542]naruse2014-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | * lib/uri/common.rb (URI::REGEXP): move to lib/uri/rfc2396_parser.rb. * lib/uri/common.rb (URI::Parser): ditto. * lib/uri/common.rb (URI.split): use RFC3986_Parser. * lib/uri/common.rb (URI.parse): ditto. * lib/uri/common.rb (URI.join): ditto. * lib/uri/common.rb (URI.extract): deprecated. * lib/uri/common.rb (URI.regexp): ditto. * lib/uri/rfc2396_parser.rb: added. * lib/uri/rfc3986_parser.rb: added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* suppress warnings: using default DH parameters.naruse2014-06-221-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Join threads.akr2014-05-312-14/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/open-uri.rb (OpenURI.open_uri): Call StringIO#close only ifakr2014-05-051-0/+23
| | | | | | | | 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: Support multiple fields with same fieldakr2013-04-091-0/+15
| | | | | | | | | | | 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
* * test/open-uri/test_open-uri.rb (TestOpenURI#test_read_timeout): thisusa2012-08-231-1/+1
| | | | | | | | test expects that the server thread will be killed in sleep, but 0.01 sec is too short to reach there. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/http.rb: Net::HTTP now automatically detects and usesdrbrain2012-07-201-35/+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/net/http/response.rb: Automatically inflate gzip anddrbrain2012-07-191-4/+4
| | | | | | | | | | | | | | | | deflate-encoded response bodies. [Feature #6942] * lib/net/http/generic_request.rb: Automatically accept gzip and deflate content-encoding for requests. [Feature #6494] * lib/net/http/request.rb: Updated documentation for #6494. * lib/net/http.rb: Updated documentation for #6492 and #6494, removed Content-Encoding handling now present in Net::HTTPResponse. * test/net/http/test_httpresponse.rb: Tests for #6492 * test/net/http/test_http_request.rb: Tests for #6494 * test/open-uri/test_open-uri.rb (test_content_encoding): Updated test for automatic content-encoding handling. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test: fix test conditionsnobu2012-05-081-2/+5
| | | | | | | | | | | | | | * test/csv/test_features.rb (TestCSV#test_gzip_reader_bug_fix): test only if zlib is available. * test/csv/test_features.rb (TestCSV#test_gzip_writer_bug_fix): ditto. * test/open-uri/test_open-uri.rb (TestOpenURI#test_content_encoding): ditto. * test/rexml/test_order.rb (OrderTester#test_more_ordering): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Wait until the server stops.naruse2012-04-231-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* skip OpenSSL dependent tests if not availablenobu2012-04-231-3/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Wait until the proxy stops.naruse2012-04-221-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* r35304 changes the exception.naruse2012-04-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Wait the server until it stops.naruse2012-04-101-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use mount_proc to avoid the delay of writing data to files.naruse2012-04-042-13/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Sleep 0.5sec to wait the file is written on server.naruse2012-04-041-5/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e