summaryrefslogtreecommitdiff
path: root/lib/net
AgeCommit message (Collapse)Author
2025-12-17[ruby/net-http] v0.9.1Hiroshi SHIBATA
https://github.com/ruby/net-http/commit/8cee86e939
2025-12-17[ruby/net-http] Freeze more constants for Ractor compatibilityKazuki Yamaguchi
Freeze Net::HTTP::SSL_ATTRIBUTES and IDEMPOTENT_METHODS_. Both constants have been marked as :nodoc:. Together with https://github.com/ruby/openssl/issues/521, this enables HTTPS clients in non-main Ractors on Ruby 4.0. https://github.com/ruby/net-http/commit/f24b3b358b
2025-12-17[ruby/net-http] v0.9.0Hiroshi SHIBATA
https://github.com/ruby/net-http/commit/3ccf0c8e6a
2025-12-17`Socket.tcp` and `TCPSocket.new` raises `IO::TiemoutError` with user ↵Misaki Shioi
specified timeout (#15602) * `Socket.tcp` and `TCPSocket.new` raises `IO::TiemoutError` with user specified timeout In https://github.com/ruby/ruby/pull/11880, `rsock_connect()` was changed to raise `IO::TimeoutError` when a user-specified timeout occurs. However, when `TCPSocket.new` attempts to connect to multiple destinations, it does not use `rsock_connect()`, and instead raises `Errno::ETIMEDOUT` on timeout. As a result, the exception class raised on timeout could differ depending on whether there were multiple destinations or not. To align this behavior with the implementation of `rsock_connect()`, this change makes `TCPSocket.new` raise `IO::TimeoutError` when a user-specified timeout occurs. Similarly, `Socket.tcp` is updated to raise `IO::TimeoutError` when a timeout occurs within the method. (Note that the existing behavior of `Addrinfo#connect_internal`, which Socket.tcp depends on internally and which raises `Errno::ETIMEDOUT` on timeout, is not changed.) * [ruby/net-http] Raise `Net::OpenTimeout` when `TCPSocket.open` raises `IO::TimeoutError`. With the changes in https://github.com/ruby/ruby/pull/15602, `TCPSocket.open` now raises `IO::TimeoutError` when a user-specified timeout occurs. This change updates #connect to handle this case accordingly. https://github.com/ruby/net-http/commit/f64109e1cf
2025-12-09[ruby/net-http] Check whether TCPSocket#initialize supports open_timeout ↵Benoit Daloze
once and without exceptions * See discussion in https://github.com/ruby/net-http/pull/224 * This check is known to work on at least CRuby, TruffleRuby and JRuby. * Exceptions show up with `ruby -d`/`$DEBUG == true` and would show for every Net::HTTP instance. https://github.com/ruby/net-http/commit/8c76f92779
2025-12-09Fixed by `misspell -w -error -source=text`Hiroshi SHIBATA
2025-12-05[ruby/net-http] open: Never call Timeout.timeout in rescue clauseDaisuke Aritomo
The try-open_timeout-then-fallback-to-timeout introduced in https://github.com/ruby/net-http/commit/1903cedd8cd0 works well, but when it errors due to any reason in Rubies which do not support `open_timeout`, it spits the rescued ArgumentError that is unrelated to user code and not actionable. Net::HTTP.start('foo.bar', 80) /.../net-http-0.8.0/lib/net/http.rb:1691:in 'TCPSocket#initialize': Failed to open TCP connection to foo.bar:80 (getaddrinfo(3): nodename nor servname provided, or not known) (Socket::ResolutionError) from /.../net-http-0.8.0/lib/net/http.rb:1691:in 'IO.open' from /.../net-http-0.8.0/lib/net/http.rb:1691:in 'block in Net::HTTP#connect' from /.../timeout-0.4.4/lib/timeout.rb:188:in 'block in Timeout.timeout' from /.../timeout-0.4.4/lib/timeout.rb:195:in 'Timeout.timeout' from /.../net-http-0.8.0/lib/net/http.rb:1690:in 'Net::HTTP#connect' from /.../net-http-0.8.0/lib/net/http.rb:1655:in 'Net::HTTP#do_start' from /.../net-http-0.8.0/lib/net/http.rb:1635:in 'Net::HTTP#start' from /.../net-http-0.8.0/lib/net/http.rb:1064:in 'Net::HTTP.start' (snip) /.../net-http-0.8.0/lib/net/http.rb:1682:in 'TCPSocket#initialize': unknown keyword: :open_timeout (ArgumentError) sock = TCPSocket.open(conn_addr, conn_port, @local_host, @local_port, open_timeout: @open_timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ from /.../net-http-0.8.0/lib/net/http.rb:1682:in 'IO.open' from /.../net-http-0.8.0/lib/net/http.rb:1682:in 'Net::HTTP#connect' from /.../net-http-0.8.0/lib/net/http.rb:1655:in 'Net::HTTP#do_start' from /.../net-http-0.8.0/lib/net/http.rb:1635:in 'Net::HTTP#start' from /.../net-http-0.8.0/lib/net/http.rb:1064:in 'Net::HTTP.start' (snip) ... 8 levels... This patch suppresses the ArgumentError by moving the retry out of the rescue clause. https://github.com/ruby/net-http/commit/86232d62f5
2025-11-13[ruby/net-http] releng v0.8.0Sorah Fukumori
https://github.com/ruby/net-http/commit/9d65391f54
2025-11-13[ruby/net-http] Drop support for Ruby 2.6Taketo Takashima
https://github.com/ruby/net-http/commit/a3a5bc45f6
2025-11-13[ruby/net-http] Fix handling of IPv6 literal hosts in `Net::HTTPGenericRequest`Taketo Takashima
Update uri dependency to version 0.11.0 or later to use `URI::HTTP#authority` and `URI#parse` without scheme https://github.com/ruby/net-http/commit/3d4f06bd7f Co-authored-by: 0x1eef <0x1eef@users.noreply.github.com> Co-authored-by: Sorah Fukumori <sora134@gmail.com>
2025-11-12[ruby/net-http] Replace Ruby 3.5 with Ruby 4.0Yasuo Honda
This commit updates the Ruby version to follow the commit in Ruby master branch. https://github.com/ruby/ruby/commit/6d81969b475262aba251e99b518181bdf7c5a523 https://github.com/ruby/net-http/commit/1e48cfaaf7
2025-11-10[ruby/net-http] [DOC] Suppress documentation for internalsNobuyoshi Nakada
https://github.com/ruby/net-http/commit/b7c586985a
2025-11-10[ruby/net-http] Remember if TCPSocket impl supports open_timeoutDaisuke Aritomo
For open_timeout support detection, the previous implementation relied on an ArgumentError being raised and then rescued. In Ruby, rescue is a rather expensive operation and should be avoided when possible. This patch reduces the number of begin-rescues by remembering if the TCPSocket implementation supports open_timeout. https://github.com/ruby/net-http/commit/06d982f3a1
2025-11-10[ruby/net-http] Ruby 2 compatDaisuke Aritomo
https://github.com/ruby/net-http/commit/09bf573dd5
2025-11-10[ruby/net-http] Replace Timeout.timeout with TCPSocket.open(open_timeout:) ↵Daisuke Aritomo
when available This patch replaces the implementation of #open_timeout from Timeout.timeout from the builtin timeout in TCPSocket.open, which was introduced in Ruby 3.5 (https://bugs.ruby-lang.org/issues/21347). The builtin timeout in TCPSocket.open is better in several ways than Timeout.timeout. It does not rely on a separate Ruby Thread for monitoring Timeout (which is what the timeout library internally does). Furthermore, it is compatible with Ractors, as opposed to Timeout.timeout (it internally uses Thread::Mutex which can not be used in non-main Ractors). This change allows the following code to work. require 'net/http' Ractor.new { uri = URI('http://example.com/') http = Net::HTTP.new(uri.host, uri.port) http.open_timeout = 1 http.get(uri.path) }.value In Ruby <3.5 environments where `TCPSocket.open` does not have the `open_timeout` option, I have kept the behavior unchanged. net/http will use `Timeout.timeout { TCPSocket.open }`. https://github.com/ruby/net-http/commit/728eb8fc42
2025-11-09Reapply "[ruby/net-http] [DOC] Suppress documentation for internals"Nobuyoshi Nakada
This reverts commit af610e107c3a7515228843eb6b1c5978f2ee2685. Reverted by a mistake.
2025-11-09Revert "[ruby/net-http] [DOC] Suppress documentation for internals"Nobuyoshi Nakada
This reverts commit 155cdce539a95b510a80a19e3840cde6b293cd4d.
2025-11-09[ruby/net-http] [DOC] Fix too stopped documentationsNobuyoshi Nakada
https://github.com/ruby/net-http/commit/58685b78ab
2025-11-09[ruby/net-http] [DOC] Suppress documentation for internalsNobuyoshi Nakada
https://github.com/ruby/net-http/commit/e4d80bd609
2025-11-09[ruby/net-http] Exclude unneeded filesNobuyoshi Nakada
https://github.com/ruby/net-http/commit/89e1ecb556
2025-11-09[ruby/net-protocol] [DOC] Suppress documentation for internalsNobuyoshi Nakada
https://github.com/ruby/net-protocol/commit/6c5734dc1e
2025-11-09[ruby/net-protocol] Exclude unneeded filesNobuyoshi Nakada
https://github.com/ruby/net-protocol/commit/8286341e8c
2025-10-31[ruby/net-http] v0.7.0Hiroshi SHIBATA
https://github.com/ruby/net-http/commit/ec9c70a6fb
2025-06-11[ruby/net-http] Support pretty_printNobuyoshi Nakada
https://github.com/ruby/net-http/commit/bfc60454f6
2025-06-11[ruby/net-http] Don't set content type by defaultHiroshi SHIBATA
Fixes https://github.com/ruby/net-http/issues/205 https://github.com/ruby/net-http/commit/002441da1e
2025-05-17[ruby/net-http] Freeze some constants to improve Ractor compatibilityDaisuke Aritomo
Freeze `Net::HTTP::SSL_IVNAMES`, `Net::HTTPResponse::CODE_CLASS_TO_OBJ` and `Net::HTTPResponse::CODE_TO_OBJ` to improve Ractor compatibility. This change allows the following code to work: Ractor.new { uri = URI.parse('http://example.com') http = Net::HTTP.new(uri.host, uri.port) http.open_timeout = nil http.read_timeout = nil http.get('/index.html') } https://github.com/ruby/net-http/commit/9f0f5e4b4d
2025-05-13Handle to look up CGI::EscapeExt instead of using LoadError. cgi/escape is ↵Hiroshi SHIBATA
provided snce Ruby 2.3 Notes: Merged: https://github.com/ruby/ruby/pull/13311
2025-05-09Use cgi/escape instead of cgi/utilHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/13275
2025-01-06[ruby/net-http] Provide a 'Changelog' link on rubygems.org/gems/net-httpMark Young
By providing a 'changelog_uri' in the metadata of the gemspec a 'Changelog' link will be shown on https://rubygems.org/gems/net-http which makes it quick and easy for someone to check on the changes introduced with a new version. Details of this functionality can be found on https://guides.rubygems.org/specification-reference/#metadata https://github.com/ruby/net-http/commit/eeb728fefe
2024-12-16Sync net-http commitsStan Lo
https://github.com/ruby/net-http/commit/9bcf818fd009eafb11107c7457aa56d533d16d94 https://github.com/ruby/net-http/commit/5e34e74261f40f4f10c93d7700761c437117f494 Notes: Merged: https://github.com/ruby/ruby/pull/12362
2024-12-02[ruby/net-http] Bump up 0.6.0Hiroshi SHIBATA
https://github.com/ruby/net-http/commit/6475fa68ba
2024-11-19[ruby/net-http] Need to restore under the Net namespaceHiroshi SHIBATA
https://github.com/ruby/net-http/commit/4650f86981
2024-11-19[ruby/net-http] Restore HTTPSession constant for backward compatibilityHiroshi SHIBATA
https://github.com/ruby/net-http/commit/37f17d29e0
2024-11-15[ruby/net-http] Remove deprecated constantsNobuyoshi Nakada
These constants, isolated in net/http/backward.rb, have not only been deprecated since 2001, but have also had a warning since 2021. https://github.com/ruby/net-http/commit/265bfa929f
2024-11-07[ruby/net-http] Bump up v0.5.0Hiroshi SHIBATA
https://github.com/ruby/net-http/commit/28a4bf9295
2024-07-11[ruby/net-http] implement talking SSL to the proxy tooEvgeni Golov
https://bugs.ruby-lang.org/issues/16482 https://github.com/ruby/net-http/commit/ae2d83f88b
2024-07-11[ruby/net-http] Add ability to configure default settings for new connectionsfatkodima
https://github.com/ruby/net-http/commit/fed3dcd0c2
2024-07-11[ruby/net-http] net/http.rb - derive SSL_IVNAMES from SSL_ATTRIBUTESMSP-Greg
https://github.com/ruby/net-http/commit/7191bb923b
2024-05-30[ruby/net-http] Update lib/net/http/header.rbBrandon Weaver
https://github.com/ruby/net-http/commit/826e008cfe Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2024-05-30[ruby/net-http] Replace Regexp in for headers for perfBrandon Weaver
https://github.com/ruby/net-http/commit/15f1349e4e
2024-05-30[ruby/net-http] Add Net::HTTP.put methodZopolis4
https://github.com/ruby/net-http/commit/6dc01c985b
2024-01-06[ruby/net-http] Tweak to Net::HTTP What's HereBurdetteLamar
https://github.com/ruby/net-http/commit/3bf641ca63
2024-01-05[ruby/net-http] Don't invoke response block more than once due to retryJeremy Evans
If a socket error occurs while performing a streaming download via the response block provided to transport_request, avoid calling the response block again as this would result in duplicate data received by the client. Fixes https://github.com/ruby/net-http/pull/86 Fixes https://github.com/ruby/net-http/pull/87 Fixes [Bug #11526] https://github.com/ruby/net-http/commit/114d01b092 Co-authored-by: Jeremy Stanley <jeremy@instructure.com>
2024-01-05[ruby/net-http] Bump version to 0.4.1Hiroshi SHIBATA
https://github.com/ruby/net-http/commit/21e226c0bc
2023-12-25[ruby/net-protocol] Provide a 'Changelog' link on rubygems.org/gems/net-protocolMark Young
By providing a 'changelog_uri' in the metadata of the gemspec a 'Changelog' link will be shown on https://rubygems.org/gems/net-protocol which makes it quick and easy for someone to check on the changes introduced with a new version. Details of this functionality can be found on https://guides.rubygems.org/specification-reference/ https://github.com/ruby/net-protocol/commit/46e78a2a0a
2023-11-07[ruby/net-protocol] Bump up 0.2.2Hiroshi SHIBATA
https://github.com/ruby/net-protocol/commit/2d3c4b43a8
2023-11-06[ruby/net-http] Bump up 0.4.0Hiroshi SHIBATA
https://github.com/ruby/net-http/commit/4be99c204c
2023-11-06[ruby/net-http] Removed obsolated Revision constantHiroshi SHIBATA
https://github.com/ruby/net-http/commit/c1c5638014
2023-10-30[ruby/net-http] fix no_proxy behaviourChristian van Rensen
https://github.com/ruby/net-http/commit/f4951dc42a
2023-10-05[ruby/net-http] Net::HTTPResponse nil checkingBrian Hawley
Fix nil handling in read_body and stream_check. Fixes: #70 https://github.com/ruby/net-http/commit/36f916ac18