From fd9a03f3b8efc6bd10b2583225f80d7bc0dc7916 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Tue, 17 Nov 2026 08:02:42 +0000 Subject: [PATCH] chore(ruby): Drop Ruby < 2.6 guard around Net::HTTP#write_timeout Net::HTTP#write_timeout= exists since Ruby 2.6 and every gem requires Ruby >= 2.7, so the respond_to? guard and the matching spec version check are always true. --- sentry-ruby/lib/sentry/transport/http_transport.rb | 2 +- sentry-ruby/spec/sentry/transport/http_transport_spec.rb | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sentry-ruby/lib/sentry/transport/http_transport.rb b/sentry-ruby/lib/sentry/transport/http_transport.rb index 88902557f..99a78002f 100644 --- a/sentry-ruby/lib/sentry/transport/http_transport.rb +++ b/sentry-ruby/lib/sentry/transport/http_transport.rb @@ -93,7 +93,7 @@ def conn connection.use_ssl = server.scheme == "https" connection.read_timeout = @transport_configuration.timeout - connection.write_timeout = @transport_configuration.timeout if connection.respond_to?(:write_timeout) + connection.write_timeout = @transport_configuration.timeout connection.open_timeout = @transport_configuration.open_timeout ssl_configuration.each do |key, value| diff --git a/sentry-ruby/spec/sentry/transport/http_transport_spec.rb b/sentry-ruby/spec/sentry/transport/http_transport_spec.rb index bd722d28f..4af0534ae 100644 --- a/sentry-ruby/spec/sentry/transport/http_transport_spec.rb +++ b/sentry-ruby/spec/sentry/transport/http_transport_spec.rb @@ -156,10 +156,7 @@ sentry_stub_request(fake_response) do |_, http_obj| expect(http_obj.read_timeout).to eq(10) - - if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.6") - expect(http_obj.write_timeout).to eq(10) - end + expect(http_obj.write_timeout).to eq(10) end subject.send_data(data)