Граф коммитов

98 Коммитов

Автор SHA1 Сообщение Дата
otegami 903f3790ad [ruby/open-uri] Update error message for `request_specific_fields` option validation
Added `inspect` to the `request_specific_fields` value to provide
better visibility for users in the exception message.

https://github.com/ruby/open-uri/commit/f89ce5112d
2024-09-08 14:13:00 +00:00
otegami 0ac16215da [ruby/open-uri] Add test about `request_specific_fields` option
https://github.com/ruby/open-uri/commit/060886f312
2024-09-08 14:12:59 +00:00
Hiroshi SHIBATA af60317861 Removed needless block arguments 2024-07-17 17:37:57 +09:00
Hiroshi SHIBATA 2a12e4ffec To avoid fd leak with fetch request for SSL server 2024-07-17 17:37:57 +09:00
Hiroshi SHIBATA e09df57427 [ruby/open-uri] Try Windows tests again
https://github.com/ruby/open-uri/commit/50f265ba29
2024-07-09 07:27:48 +00:00
Hiroshi SHIBATA 5d82abdfc8 Removed duplicate server thread 2024-07-09 16:21:55 +09:00
Hiroshi SHIBATA e62ac3aac7 Reapply "Reverts related commits with https://github.com/ruby/open-uri/pull/37"
This reverts commit 02c4f0c89d.
2024-07-09 16:21:55 +09:00
Hiroshi SHIBATA 02c4f0c89d
Reverts related commits with https://github.com/ruby/open-uri/pull/37
It caused Timeout failure with RJIT and chkbuild

http://rubyci.s3.amazonaws.com/debian11/ruby-master/log/20240708T063006Z.fail.html.gz
https://github.com/ruby/ruby/actions/runs/9836594303/job/27152644853
2024-07-08 20:00:01 +09:00
Hiroshi SHIBATA a5f4014738
Load net-http explicitly for SimpleHTTPProxyServer 2024-07-08 17:05:12 +09:00
Hiroshi SHIBATA 4658d65242 Load socket explicitly for TCPServer 2024-07-08 15:15:46 +09:00
Hiroshi SHIBATA 95bf9049a7 Load OpenSSL on TestOpenURIUtils for with_https 2024-07-08 15:15:46 +09:00
Hiroshi SHIBATA dcc8e54234 [ruby/open-uri] Don't use Base64 library
https://github.com/ruby/open-uri/commit/c8c0452d53
2024-07-08 04:53:14 +00:00
Hiroshi SHIBATA bf898057b4 [ruby/open-uri] Test with Windows
https://github.com/ruby/open-uri/commit/2606892a43
2024-07-08 04:53:13 +00:00
Hiroshi SHIBATA 71490d2314 [ruby/open-uri] Move certificates under the TestOpenURIUtils
https://github.com/ruby/open-uri/commit/a28c2da5d2
2024-07-08 04:53:12 +00:00
Hiroshi SHIBATA 3d78e63312 [ruby/open-uri] Load stringio with the correct files
https://github.com/ruby/open-uri/commit/cb17a907a2
2024-07-08 04:53:12 +00:00
Hiroshi SHIBATA 09c52b91b9 [ruby/open-uri] Removed needless class definition and variables
https://github.com/ruby/open-uri/commit/ab0e916997
2024-07-08 04:53:12 +00:00
Hiroshi SHIBATA 61e00856c9 [ruby/open-uri] Don't use URI library
https://github.com/ruby/open-uri/commit/15989970b6
2024-07-08 04:53:11 +00:00
Hiroshi SHIBATA e6b6c2ba9d [ruby/open-uri] support CONNECT method for SimpleHTTPProxy
https://github.com/ruby/open-uri/commit/2e36793bd5
2024-07-08 04:53:11 +00:00
Hiroshi SHIBATA b782906400 [ruby/open-uri] Added SimpleHTTPSServer by TCPServer and OpenSSL
https://github.com/ruby/open-uri/commit/57c80e1576
2024-07-08 04:53:10 +00:00
Hiroshi SHIBATA debcf108fa [ruby/open-uri] Added SimpleHTTPProxyServer by TCPServer
https://github.com/ruby/open-uri/commit/ad47529306
2024-07-08 04:53:10 +00:00
Hiroshi SHIBATA a574e290c5 [ruby/open-uri] Extract SimpleHTTPServer and with_http to TestOpenURIUtils module for other tests
https://github.com/ruby/open-uri/commit/489a1e9006
2024-07-08 04:53:10 +00:00
Hiroshi SHIBATA 7a74dcedd3 [ruby/open-uri] Added SimpleHTTPSServer by TCPServer
https://github.com/ruby/open-uri/commit/a2b1ebe465
2024-07-08 04:53:09 +00:00
Hiroshi SHIBATA a105bf8169 [ruby/open-uri] Removed needless setup and teardown, tmpdir variables
https://github.com/ruby/open-uri/commit/b2d7fc4ff3
2024-07-08 04:53:09 +00:00
Hiroshi SHIBATA 846c45c2b4 [ruby/open-uri] Extract FTP tests from test_open-uri.rb
https://github.com/ruby/open-uri/commit/324111eb41
2024-07-08 04:53:09 +00:00
Hiroshi SHIBATA 6fb482d429 [ruby/open-uri] Extract HTTP Proxy tests from test_open-uri.rb
https://github.com/ruby/open-uri/commit/e9e6bd2779
2024-07-08 04:53:08 +00:00
Andrew Kane 41c00bc97e [ruby/open-uri] Set default for max_redirects and add exception class
https://github.com/ruby/open-uri/commit/dcdcb885cc
2023-12-07 07:00:54 +00:00
Andrew Kane d97479f9c9 [ruby/open-uri] Add :max_redirects option
https://github.com/ruby/open-uri/commit/7fd5ea09a7
2023-12-07 07:00:53 +00:00
Nobuyoshi Nakada fbe7962b54 [ruby/open-uri] Close leaked files
https://github.com/ruby/open-uri/commit/c52ee9e430
2023-08-24 05:14:56 +00:00
Jeremy Evans 43c2c1ed48 [ruby/open-uri] Make URI.open pass keywords
Fixes [Bug #19238]

https://github.com/ruby/open-uri/commit/f636d01b85
2023-08-23 21:30:16 +00:00
Kazuki Yamaguchi 4e29ca0c40
Add :ssl_min_version and :ssl_max_version options
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.
2022-10-12 10:36:51 +09:00
Nishant Patel 43e925090b [ruby/open-uri] fix: added test case that validates that bad TLS version is silently ignored
https://github.com/ruby/open-uri/commit/4b91b11730
2022-10-06 18:00:58 +09:00
Nishant Patel cdbaac3f4b [ruby/open-uri] feat: allow option to pass version of SSL / TLS to use during communication. Allow versions are OpenSSL::SSL::SSLContext::METHODS
https://github.com/ruby/open-uri/commit/8729858517
2022-10-06 18:00:57 +09:00
Hiroshi SHIBATA 7f80ec47c3 [ruby/open-uri] Use omit instead of skip for test-unit
https://github.com/ruby/open-uri/commit/63f466d6ed
2022-10-06 17:15:27 +09:00
Hiroshi SHIBATA cc5313ceab [ruby/open-uri] Run global constant count test only under Ruby 3.2
https://github.com/ruby/open-uri/commit/a8f1605ae9
2022-10-06 17:15:26 +09:00
Jean Boussier d15b38d944 [ruby/open-uri] Avoid busting the global constant cache
`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
2022-10-06 16:55:44 +09:00
Hiroshi SHIBATA 350bc29107 Guard for the ftp protocol feature of OpenURI 2021-05-27 14:42:11 +09:00
Ryuta Kamizono 33f2ff3bab Fix some typos by spell checker 2021-04-26 10:07:41 +09:00
Jeremy Evans a73b5cc556 Remove the deprecated override of Kernel#open in open-uri
This was deprecated in 2.7 to resolve [Misc #15893].
2020-08-16 07:41:40 -07:00
Tanaka Akira 8f7884761e The default charset of text/* media type is UTF-8.
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
2019-07-15 09:36:52 +09:00
Tanaka Akira 05aac90a1b Warn open-uri's "open" method at Kernel.
Use URI.open instead.

Thanks for the patch by jeremyevans0 (Jeremy Evans) [Misc #15893].
2019-07-14 17:18:17 +09:00
Yusuke Endoh 43730256e8 open-uri: Regenerate server certificates for tests
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
2019-05-27 12:58:08 +09:00
akr bf287424fd open-uri defines URI.open defined as an alias.
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
2017-12-21 14:15:04 +00:00
akr a2831955b2 lib/open-uri.rb: accept :encoding option as well as encoding in mode string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21 06:22:53 +00:00
nobu 3408e9e3c3 revert r57323
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
2017-01-14 09:38:56 +00:00
nobu c8a4b57254 StringIO.new makes a RW buffer
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-14 02:06:22 +00:00
rhe 0cc0080a49 open-uri: don't use OpenSSL::TestUtils from open-uri tests
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
2016-11-29 15:48:46 +00:00
svn 3cb56e8e3a * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-07 12:29:37 +00:00
rhe 06552d56d1 open-uri: regenerate server certificates used in tests
* 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
2016-06-07 12:29:36 +00:00
hsbt e79d163caf * lib/open-uri.rb: Use `userinfo` for authenticated proxy.
[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
2016-03-30 00:46:05 +00:00
nobu 8d66627161 leakchecker.rb: remove temporary measure
* 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
2016-01-05 06:09:17 +00:00