From abe2e49459711ed3431c776099111969ec8ee3d2 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Wed, 24 Jun 2026 15:07:35 +0100 Subject: [PATCH 1/4] Checks if @otel is defined --- lib/elastic/transport/client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/elastic/transport/client.rb b/lib/elastic/transport/client.rb index cd0dccc7..a3e83a4a 100644 --- a/lib/elastic/transport/client.rb +++ b/lib/elastic/transport/client.rb @@ -169,7 +169,7 @@ def initialize(arguments = {}, &block) def perform_request(method, path, params = {}, body = nil, headers = nil, opts = {}) method = @send_get_body_as if method == 'GET' && body validate_ca_fingerprints if @ca_fingerprint - if @otel + if defined?(@otel) && !@otel.nil? # If no endpoint is specified in the opts, use the HTTP method name span_name = opts[:endpoint] || method @otel.tracer.in_span(span_name) do |span| From 84a92e6f1484ad443ed1d1b9d0cb504e23d0ca17 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Wed, 24 Jun 2026 15:07:35 +0100 Subject: [PATCH 2/4] Removes outdated Oj code --- lib/elastic/transport/transport/base.rb | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/elastic/transport/transport/base.rb b/lib/elastic/transport/transport/base.rb index 19f8eeac..fb3b1af3 100644 --- a/lib/elastic/transport/transport/base.rb +++ b/lib/elastic/transport/transport/base.rb @@ -356,15 +356,10 @@ def perform_request(method, path, params = {}, body = nil, headers = nil, opts = end if response.body && - !response.body.empty? && - response.headers && - response.headers["content-type"] =~ /json/ - - # Prevent Float value from automatically becoming BigDecimal when using Oj - load_options = {} - load_options[:mode] = :compat if ::MultiJson.adapter.to_s == "MultiJson::Adapters::Oj" - - json = serializer.load(response.body, load_options) + !response.body.empty? && + response.headers && + response.headers['content-type'] =~ /json/ + json = serializer.load(response.body) end took = (json['took'] ? sprintf('%.3fs', json['took'] / 1000.0) : 'n/a') rescue 'n/a' __log_response(method, path, params, body, url, response, json, took, duration) unless ignore.include?(response.status.to_i) From 49940ddc9da6bb6614a80a4082823dd2deee8148 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Wed, 24 Jun 2026 15:17:25 +0100 Subject: [PATCH 3/4] Locks oj development dependency to >= 3.17.3 due to CVE --- Gemfile | 2 +- Gemfile-faraday1.gemfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 4c51d07a..898235a8 100644 --- a/Gemfile +++ b/Gemfile @@ -36,7 +36,7 @@ group :development, :test do gem 'async-http-faraday' gem 'curb' gem 'faraday-patron' - gem 'oj' + gem 'oj', '>= 3.17.3', '< 4' gem 'debug' end gem 'rspec' diff --git a/Gemfile-faraday1.gemfile b/Gemfile-faraday1.gemfile index 2e075980..be02d72c 100644 --- a/Gemfile-faraday1.gemfile +++ b/Gemfile-faraday1.gemfile @@ -36,7 +36,7 @@ group :development, :test do else gem 'curb' gem 'debug' - gem 'oj' + gem 'oj', '>= 3.17.3', '< 4' gem 'patron' end end From 572b900f7b4efdd631de6690414c9f6f6e388642 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Thu, 25 Jun 2026 10:07:32 +0100 Subject: [PATCH 4/4] [CI] Updates GitHub Actions --- .github/workflows/tests.yml | 6 +++--- Gemfile-faraday1.gemfile | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 54c062b7..1aa47966 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,8 +16,8 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['3.2', '3.3', '3.4', '4.0', 'jruby-9.3', 'jruby-9.4', 'jruby-10.0'] - es_version: ['8.19.14-SNAPSHOT', '9.2.8-SNAPSHOT', '9.3.3-SNAPSHOT', '9.4.0-SNAPSHOT'] + ruby: ['3.3', '3.4', '4.0', 'jruby-9.3', 'jruby-9.4', 'jruby-10.0'] + es_version: ['8.19.14-SNAPSHOT', '9.3.3-SNAPSHOT', '9.4.0-SNAPSHOT', '9.5.0-SNAPSHOT'] runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 @@ -54,7 +54,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['3.0', '3.1', '3.2', '3.3', 'jruby-9.3'] + ruby: ['3.3', '3.4', '4.0', 'jruby-9.3', 'jruby-9.4', 'jruby-10.0'] es_version: ['8.19.14-SNAPSHOT'] runs-on: ubuntu-latest steps: diff --git a/Gemfile-faraday1.gemfile b/Gemfile-faraday1.gemfile index be02d72c..889b5b9b 100644 --- a/Gemfile-faraday1.gemfile +++ b/Gemfile-faraday1.gemfile @@ -33,6 +33,7 @@ group :development, :test do if defined?(JRUBY_VERSION) gem 'manticore', platform: :jruby gem 'pry-nav' + gem 'base64' else gem 'curb' gem 'debug'