-
Notifications
You must be signed in to change notification settings - Fork 1
Bump net-http from 0.6.0 to 0.9.1 #864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
gem compare net-http 0.6.0 0.9.1Compared versions: ["0.6.0", "0.9.1"]
DIFFERENT date:
0.6.0: 2024-12-02 00:00:00 UTC
0.9.1: 1980-01-02 00:00:00 UTC
DIFFERENT metadata:
0.6.0: {"homepage_uri" => "https://github.com/ruby/net-http", "source_code_uri" => "https://github.com/ruby/net-http"}
0.9.1: {"changelog_uri" => "https://github.com/ruby/net-http/releases", "homepage_uri" => "https://github.com/ruby/net-http", "source_code_uri" => "https://github.com/ruby/net-http"}
DIFFERENT required_ruby_version:
0.6.0: >= 2.6.0
0.9.1: >= 2.7.0
DIFFERENT rubygems_version:
0.6.0: 3.5.11
0.9.1: 3.6.9
DIFFERENT version:
0.6.0: 0.6.0
0.9.1: 0.9.1
DIFFERENT files:
0.6.0->0.9.1:
* Deleted:
Gemfile
Rakefile
bin/console
bin/setup
net-http.gemspec
* Added:
.document +5/-0
* Changed:
lib/net/http.rb +73/-45
lib/net/http/exceptions.rb +2/-1
lib/net/http/generic_request.rb +30/-15
lib/net/http/header.rb +8/-4
lib/net/http/requests.rb +15/-1
lib/net/http/response.rb +2/-1
lib/net/http/responses.rb +70/-2
DIFFERENT runtime dependencies:
0.6.0->0.9.1:
* Updated:
uri from: [">= 0"] to: [">= 0.11.1"]
DIFFERENT Gemfile dependencies
0.6.0->0.9.1:
* Deleted
rake [">= 0"] (runtime)
test-unit [">= 0"] (runtime)
test-unit-ruby-core [">= 0"] (runtime)
webrick [">= 0"] (runtime) |
gem compare --diff net-http 0.6.0 0.9.1Compared versions: ["0.6.0", "0.9.1"]
DIFFERENT files:
0.6.0->0.9.1:
* Deleted:
Gemfile
Rakefile
bin/console
bin/setup
net-http.gemspec
* Added:
.document
--- /tmp/20260104-374-4i9o3a 2026-01-04 17:28:43.579380076 +0000
+++ /tmp/d20260104-374-bxgng/net-http-0.9.1/.document 2026-01-04 17:28:43.576380083 +0000
@@ -0,0 +1,5 @@
+BSDL
+COPYING
+README.md
+doc/
+lib/
* Changed:
lib/net/http.rb
--- /tmp/d20260104-374-bxgng/net-http-0.6.0/lib/net/http.rb 2026-01-04 17:28:43.574380088 +0000
+++ /tmp/d20260104-374-bxgng/net-http-0.9.1/lib/net/http.rb 2026-01-04 17:28:43.578380078 +0000
@@ -478,2 +478 @@
- # - {#started?}[rdoc-ref:Net::HTTP#started?]
- # (aliased as {#active?}[rdoc-ref:Net::HTTP#active?]):
+ # - {#started?}[rdoc-ref:Net::HTTP#started?]:
@@ -559,2 +558 @@
- # - {#request_get}[rdoc-ref:Net::HTTP#request_get]
- # (aliased as {#get2}[rdoc-ref:Net::HTTP#get2]):
+ # - {#request_get}[rdoc-ref:Net::HTTP#request_get]:
@@ -564,2 +562 @@
- # - {#request_head}[rdoc-ref:Net::HTTP#request_head]
- # (aliased as {#head2}[rdoc-ref:Net::HTTP#head2]):
+ # - {#request_head}[rdoc-ref:Net::HTTP#request_head]:
@@ -569,2 +566 @@
- # - {#request_post}[rdoc-ref:Net::HTTP#request_post]
- # (aliased as {#post2}[rdoc-ref:Net::HTTP#post2]):
+ # - {#request_post}[rdoc-ref:Net::HTTP#request_post]:
@@ -608,2 +604 @@
- # - {#proxy_address}[rdoc-ref:Net::HTTP#proxy_address]
- # (aliased as {#proxyaddr}[rdoc-ref:Net::HTTP#proxyaddr]):
+ # - {#proxy_address}[rdoc-ref:Net::HTTP#proxy_address]:
@@ -721,2 +716 @@
- # (aliased as {::is_version_1_2?}[rdoc-ref:Net::HTTP.is_version_1_2?]
- # and {::version_1_2}[rdoc-ref:Net::HTTP.version_1_2]):
+ # (aliased as {::version_1_2}[rdoc-ref:Net::HTTP.version_1_2]):
@@ -733 +727 @@
- VERSION = "0.6.0"
+ VERSION = "0.9.1"
@@ -1187,0 +1182 @@
+ @tcpsocket_supports_open_timeout = nil
@@ -1329,0 +1325,3 @@
+
+ # Sets whether the proxy uses SSL;
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
@@ -1536 +1534 @@
- ] # :nodoc:
+ ].freeze # :nodoc:
@@ -1538 +1536 @@
- SSL_IVNAMES = SSL_ATTRIBUTES.map { |a| "@#{a}".to_sym } # :nodoc:
+ SSL_IVNAMES = SSL_ATTRIBUTES.map { |a| "@#{a}".to_sym }.freeze # :nodoc:
@@ -1555 +1553 @@
- # See {OpenSSL::SSL::SSLContext#ciphers=}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#method-i-ciphers-3D].
+ # See {OpenSSL::SSL::SSLContext#ciphers=}[OpenSSL::SSL::SSL::Context#ciphers=].
@@ -1559 +1557 @@
- # See {OpenSSL::SSL::SSLContext#add_certificate}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#method-i-add_certificate].
+ # See {OpenSSL::SSL::SSLContext#add_certificate}[OpenSSL::SSL::SSL::Context#add_certificate].
@@ -1569 +1567 @@
- # See {OpenSSL::SSL::SSLContext#ssl_version=}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#method-i-ssl_version-3D].
+ # See {OpenSSL::SSL::SSLContext#ssl_version=}[OpenSSL::SSL::SSL::Context#ssl_version=].
@@ -1573 +1571 @@
- # See {OpenSSL::SSL::SSLContext#min_version=}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#method-i-min_version-3D].
+ # See {OpenSSL::SSL::SSLContext#min_version=}[OpenSSL::SSL::SSL::Context#min_version=].
@@ -1577 +1575 @@
- # See {OpenSSL::SSL::SSLContext#max_version=}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#method-i-max_version-3D].
+ # See {OpenSSL::SSL::SSLContext#max_version=}[OpenSSL::SSL::SSL::Context#max_version=].
@@ -1593 +1591 @@
- # See {OpenSSL::SSL::SSLContext#verify_hostname=}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#attribute-i-verify_mode].
+ # See {OpenSSL::SSL::SSLContext#verify_hostname=}[OpenSSL::SSL::SSL::Context#verify_hostname=].
@@ -1640,0 +1639,15 @@
+ # Finishes the \HTTP session:
+ #
+ # http = Net::HTTP.new(hostname)
+ # http.start
+ # http.started? # => true
+ # http.finish # => nil
+ # http.started? # => false
+ #
+ # Raises IOError if not in a session.
+ def finish
+ raise IOError, 'HTTP session not yet started' unless started?
+ do_finish
+ end
+
+ # :stopdoc:
@@ -1663,6 +1676,5 @@
- s = Timeout.timeout(@open_timeout, Net::OpenTimeout) {
- begin
- TCPSocket.open(conn_addr, conn_port, @local_host, @local_port)
- rescue => e
- raise e, "Failed to open TCP connection to " +
- "#{conn_addr}:#{conn_port} (#{e.message})"
+ begin
+ s = timeouted_connect(conn_addr, conn_port)
+ rescue => e
+ if (defined?(IO::TimeoutError) && e.is_a?(IO::TimeoutError)) || e.is_a?(Errno::ETIMEDOUT) # for compatibility with previous versions
+ e = Net::OpenTimeout.new(e)
@@ -1670 +1682,3 @@
- }
+ raise e, "Failed to open TCP connection to " +
+ "#{conn_addr}:#{conn_port} (#{e.message})"
+ end
@@ -1763 +1777,18 @@
- def on_connect
+ tcp_socket_parameters = TCPSocket.instance_method(:initialize).parameters
+ TCP_SOCKET_NEW_HAS_OPEN_TIMEOUT = if tcp_socket_parameters != [[:rest]]
+ tcp_socket_parameters.include?([:key, :open_timeout])
+ else
+ # Use Socket.tcp to find out since there is no parameters information for TCPSocket#initialize
+ # See discussion in https://github.com/ruby/net-http/pull/224
+ Socket.method(:tcp).parameters.include?([:key, :open_timeout])
+ end
+ private_constant :TCP_SOCKET_NEW_HAS_OPEN_TIMEOUT
+
+ def timeouted_connect(conn_addr, conn_port)
+ if TCP_SOCKET_NEW_HAS_OPEN_TIMEOUT
+ TCPSocket.open(conn_addr, conn_port, @local_host, @local_port, open_timeout: @open_timeout)
+ else
+ Timeout.timeout(@open_timeout, Net::OpenTimeout) {
+ TCPSocket.open(conn_addr, conn_port, @local_host, @local_port)
+ }
+ end
@@ -1765 +1796 @@
- private :on_connect
+ private :timeouted_connect
@@ -1767,12 +1798 @@
- # Finishes the \HTTP session:
- #
- # http = Net::HTTP.new(hostname)
- # http.start
- # http.started? # => true
- # http.finish # => nil
- # http.started? # => false
- #
- # Raises IOError if not in a session.
- def finish
- raise IOError, 'HTTP session not yet started' unless started?
- do_finish
+ def on_connect
@@ -1779,0 +1800 @@
+ private :on_connect
@@ -1829,0 +1851,2 @@
+ # :startdoc:
+
@@ -1923,0 +1947 @@
+ # :stopdoc:
@@ -1926 +1950,2 @@
- require 'cgi/util'
+ require 'cgi/escape'
+ require 'cgi/util' unless defined?(CGI::EscapeExt)
@@ -1950,0 +1976 @@
+ # :startdoc:
@@ -2405 +2431,3 @@
- IDEMPOTENT_METHODS_ = %w/GET HEAD PUT DELETE OPTIONS TRACE/ # :nodoc:
+ # :stopdoc:
+
+ IDEMPOTENT_METHODS_ = %w/GET HEAD PUT DELETE OPTIONS TRACE/.freeze # :nodoc:
@@ -2562 +2590 @@
- # for backward compatibility until Ruby 3.5
+ # for backward compatibility until Ruby 4.0
lib/net/http/exceptions.rb
--- /tmp/d20260104-374-bxgng/net-http-0.6.0/lib/net/http/exceptions.rb 2026-01-04 17:28:43.574380088 +0000
+++ /tmp/d20260104-374-bxgng/net-http-0.9.1/lib/net/http/exceptions.rb 2026-01-04 17:28:43.578380078 +0000
@@ -6 +6 @@
- module HTTPExceptions
+ module HTTPExceptions # :nodoc:
@@ -14,0 +15 @@
+ # :stopdoc:
lib/net/http/generic_request.rb
--- /tmp/d20260104-374-bxgng/net-http-0.6.0/lib/net/http/generic_request.rb 2026-01-04 17:28:43.574380088 +0000
+++ /tmp/d20260104-374-bxgng/net-http-0.9.1/lib/net/http/generic_request.rb 2026-01-04 17:28:43.578380078 +0000
@@ -22 +22 @@
- hostname = uri_or_path.hostname
+ hostname = uri_or_path.host
@@ -25,2 +24,0 @@
- host = @uri.hostname.dup
- host << ":" << @uri.port.to_s if @uri.port != @uri.default_port
@@ -31 +28,0 @@
- host = nil
@@ -54 +51 @@
- self['Host'] ||= host if host
+ self['Host'] ||= @uri.authority if @uri
@@ -104,0 +102,25 @@
+ # Returns a string representation of the request with the details for pp:
+ #
+ # require 'pp'
+ # post = Net::HTTP::Post.new(uri)
+ # post.inspect # => "#<Net::HTTP::Post POST>"
+ # post.pretty_inspect
+ # # => #<Net::HTTP::Post
+ # POST
+ # path="/"
+ # headers={"accept-encoding" => ["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],
+ # "accept" => ["*/*"],
+ # "user-agent" => ["Ruby"],
+ # "host" => ["www.ruby-lang.org"]}>
+ #
+ def pretty_print(q)
+ q.object_group(self) {
+ q.breakable
+ q.text @method
+ q.breakable
+ q.text "path="; q.pp @path
+ q.breakable
+ q.text "headers="; q.pp to_hash
+ }
+ end
+
@@ -223 +245 @@
- host.sub!(/:.*/m, '')
+ host = URI.parse("//#{host}").host # Remove a port component from the existing Host header
@@ -241,0 +264,2 @@
+ # :stopdoc:
+
@@ -263 +286,0 @@
- supply_default_content_type
@@ -274 +296,0 @@
- supply_default_content_type
@@ -376,6 +397,0 @@
- def supply_default_content_type
- return if content_type()
- warn 'net/http: Content-Type did not set; using application/x-www-form-urlencoded', uplevel: 1 if $VERBOSE
- set_content_type 'application/x-www-form-urlencoded'
- end
-
@@ -414 +429,0 @@
-
lib/net/http/header.rb
--- /tmp/d20260104-374-bxgng/net-http-0.6.0/lib/net/http/header.rb 2026-01-04 17:28:43.574380088 +0000
+++ /tmp/d20260104-374-bxgng/net-http-0.9.1/lib/net/http/header.rb 2026-01-04 17:28:43.578380078 +0000
@@ -181,0 +182 @@
+ # The maximum length of HTTP header keys.
@@ -182,0 +184 @@
+ # The maximum length of HTTP header values.
@@ -269,0 +272 @@
+ # :stopdoc:
@@ -296,0 +300 @@
+ # :startdoc:
@@ -493 +497 @@
- def capitalize(name)
+ def capitalize(name) # :nodoc:
@@ -960 +964 @@
- def basic_encode(account, password)
+ def basic_encode(account, password) # :nodoc:
@@ -965 +969 @@
-# Returns whether the HTTP session is to be closed.
+ # Returns whether the HTTP session is to be closed.
@@ -973 +977 @@
-# Returns whether the HTTP session is to be kept alive.
+ # Returns whether the HTTP session is to be kept alive.
lib/net/http/requests.rb
--- /tmp/d20260104-374-bxgng/net-http-0.6.0/lib/net/http/requests.rb 2026-01-04 17:28:43.575380085 +0000
+++ /tmp/d20260104-374-bxgng/net-http-0.9.1/lib/net/http/requests.rb 2026-01-04 17:28:43.578380078 +0000
@@ -31,0 +32 @@
+ # :stopdoc:
@@ -62,0 +64 @@
+ # :stopdoc:
@@ -97,0 +100 @@
+ # :stopdoc:
@@ -132,0 +136 @@
+ # :stopdoc:
@@ -164,0 +169 @@
+ # :stopdoc:
@@ -195,0 +201 @@
+ # :stopdoc:
@@ -226,0 +233 @@
+ # :stopdoc:
@@ -260,0 +268 @@
+ # :stopdoc:
@@ -287,0 +296 @@
+ # :stopdoc:
@@ -310,0 +320 @@
+ # :stopdoc:
@@ -333,0 +344 @@
+ # :stopdoc:
@@ -356,0 +368 @@
+ # :stopdoc:
@@ -379,0 +392 @@
+ # :stopdoc:
@@ -402,0 +416 @@
+ # :stopdoc:
@@ -425,0 +440 @@
+ # :stopdoc:
@@ -430 +444,0 @@
-
lib/net/http/response.rb
--- /tmp/d20260104-374-bxgng/net-http-0.6.0/lib/net/http/response.rb 2026-01-04 17:28:43.575380085 +0000
+++ /tmp/d20260104-374-bxgng/net-http-0.9.1/lib/net/http/response.rb 2026-01-04 17:28:43.579380076 +0000
@@ -155,0 +156 @@
+ # :stopdoc:
@@ -262 +263 @@
- def inspect
+ def inspect # :nodoc:
lib/net/http/responses.rb
--- /tmp/d20260104-374-bxgng/net-http-0.6.0/lib/net/http/responses.rb 2026-01-04 17:28:43.575380085 +0000
+++ /tmp/d20260104-374-bxgng/net-http-0.9.1/lib/net/http/responses.rb 2026-01-04 17:28:43.579380076 +0000
@@ -6,0 +7 @@
+ # Unknown HTTP response
@@ -7,0 +9 @@
+ # :stopdoc:
@@ -21,0 +24 @@
+ # :stopdoc:
@@ -36,0 +40 @@
+ # :stopdoc:
@@ -51,0 +56 @@
+ # :stopdoc:
@@ -65,0 +71 @@
+ # :stopdoc:
@@ -79,0 +86 @@
+ # :stopdoc:
@@ -96,0 +104 @@
+ # :stopdoc:
@@ -113,0 +122 @@
+ # :stopdoc:
@@ -129,0 +139 @@
+ # :stopdoc:
@@ -147,0 +158 @@
+ # :stopdoc:
@@ -164,0 +176 @@
+ # :stopdoc:
@@ -181,0 +194 @@
+ # :stopdoc:
@@ -198,0 +212 @@
+ # :stopdoc:
@@ -217,0 +232 @@
+ # :stopdoc:
@@ -234,0 +250 @@
+ # :stopdoc:
@@ -252,0 +269 @@
+ # :stopdoc:
@@ -270,0 +288 @@
+ # :stopdoc:
@@ -287,0 +306 @@
+ # :stopdoc:
@@ -306,0 +326 @@
+ # :stopdoc:
@@ -323,0 +344 @@
+ # :stopdoc:
@@ -340,0 +362 @@
+ # :stopdoc:
@@ -358,0 +381 @@
+ # :stopdoc:
@@ -375,0 +399 @@
+ # :stopdoc:
@@ -392,0 +417 @@
+ # :stopdoc:
@@ -409,0 +435 @@
+ # :stopdoc:
@@ -425,0 +452 @@
+ # :stopdoc:
@@ -442,0 +470 @@
+ # :stopdoc:
@@ -458,0 +487 @@
+ # :stopdoc:
@@ -474,0 +504 @@
+ # :stopdoc:
@@ -490,0 +521 @@
+ # :stopdoc:
@@ -506,0 +538 @@
+ # :stopdoc:
@@ -523,0 +556 @@
+ # :stopdoc:
@@ -539,0 +573 @@
+ # :stopdoc:
@@ -555,0 +590 @@
+ # :stopdoc:
@@ -572,0 +608 @@
+ # :stopdoc:
@@ -588,0 +625 @@
+ # :stopdoc:
@@ -604,0 +642 @@
+ # :stopdoc:
@@ -621,0 +660 @@
+ # :stopdoc:
@@ -638,0 +678 @@
+ # :stopdoc:
@@ -655,0 +696 @@
+ # :stopdoc:
@@ -672,0 +714 @@
+ # :stopdoc:
@@ -688,0 +731 @@
+ # :stopdoc:
@@ -705,0 +749 @@
+ # :stopdoc:
@@ -723,0 +768 @@
+ # :stopdoc:
@@ -739,0 +785 @@
+ # :stopdoc:
@@ -756,0 +803 @@
+ # :stopdoc:
@@ -776,0 +824 @@
+ # :stopdoc:
@@ -792,0 +841 @@
+ # :stopdoc:
@@ -807,0 +857 @@
+ # :stopdoc:
@@ -823,0 +874 @@
+ # :stopdoc:
@@ -842,0 +894 @@
+ # :stopdoc:
@@ -858,0 +911 @@
+ # :stopdoc:
@@ -874,0 +928 @@
+ # :stopdoc:
@@ -891,0 +946 @@
+ # :stopdoc:
@@ -908,0 +964 @@
+ # :stopdoc:
@@ -928,0 +985 @@
+ # :stopdoc:
@@ -945,0 +1003 @@
+ # :stopdoc:
@@ -962,0 +1021 @@
+ # :stopdoc:
@@ -979,0 +1039 @@
+ # :stopdoc:
@@ -996,0 +1057 @@
+ # :stopdoc:
@@ -1013,0 +1075 @@
+ # :stopdoc:
@@ -1029,0 +1092 @@
+ # :stopdoc:
@@ -1045,0 +1109 @@
+ # :stopdoc:
@@ -1061,0 +1126 @@
+ # :stopdoc:
@@ -1078,0 +1144 @@
+ # :stopdoc:
@@ -1094,0 +1161 @@
+ # :stopdoc:
@@ -1100,0 +1168 @@
+ # :stopdoc:
@@ -1107 +1175 @@
- }
+ }.freeze
@@ -1173 +1241 @@
- }
+ }.freeze |
Looks like this affected a non-trivia amount of people: ruby/net-http#205, ruby/net-http#207 I don't think we're at risk but good to be aware. We have been lacking test coverage before: https://patrik.codes/2022/octokit |
|
I tried logout and login after deploying this, no problems. |
Update the
net-httpgem usingbundle update --conservative.RubyGems.org: https://rubygems.org/gems/net-http/versions/0.9.1
Homepage: https://github.com/ruby/net-http
Changelog: https://github.com/ruby/net-http/releases
Releases: