Skip to content

[9.3] Backports #2984 - Fixes header conflict on Serverless#2986

Merged
picandocodigo merged 2 commits into
9.3from
backport_2984_9.3
Jun 17, 2026
Merged

[9.3] Backports #2984 - Fixes header conflict on Serverless#2986
picandocodigo merged 2 commits into
9.3from
backport_2984_9.3

Conversation

@picandocodigo

Copy link
Copy Markdown
Member

When a client also sets the Elastic-Api-Version header (required for Elasticsearch Serverless), serverless rejects the request with HTTP 400: The request includes both the [Elastic-Api-Version] header and a [compatible-with] parameter, but it is not valid to include both of these in a request

These two versioning mechanisms serve different deployment models and are mutually exclusive on the server side:

  • compatible-with=N: REST API compatibility for self-managed/hosted major version upgrades
  • Elastic-Api-Version: 2023-10-31: date-based API versioning for serverless

With this change, set_content_type! checks if Elastic-Api-Version is already present in transport_options[:headers] for adding compatible-with headers.

Addresses #2983

Use safe navigation operator to check for API version header

Co-authored-by: Kaise 69120390+kaisecheng@users.noreply.github.com

[Tests] Skips jbuilder for specific version of JRuby

There is a dependency issue with JBuilder and JRuby 9.4.15.0 at the moment. This breaks the build unrelated to recent changes. A patch release is needed, so will investigate.

NoMethodError: undefined method `[]' for Fiber:Class

When a client also sets the Elastic-Api-Version header (required for
Elasticsearch Serverless), serverless rejects the request with HTTP
400: The request includes both the [Elastic-Api-Version] header and a
[compatible-with] parameter, but it is not valid to include both of
these in a request

These two versioning mechanisms serve different deployment models and
are mutually exclusive on the server side:

* compatible-with=N: REST API compatibility for self-managed/hosted major version upgrades
* Elastic-Api-Version: 2023-10-31: date-based API versioning for serverless

With this change, set_content_type! checks if Elastic-Api-Version is
already present in transport_options[:headers]  for adding
compatible-with headers.

Addresses #2983

Use safe navigation operator to check for API version header

Co-authored-by: Kaise <69120390+kaisecheng@users.noreply.github.com>

[Tests] Skips jbuilder for specific version of JRuby

There is a dependency issue with JBuilder and JRuby 9.4.15.0 at the
moment. This breaks the build unrelated to recent changes. A patch
release is needed, so will investigate.

NoMethodError: undefined method `[]' for Fiber:Class
@picandocodigo picandocodigo merged commit 379d0f0 into 9.3 Jun 17, 2026
13 checks passed
@picandocodigo picandocodigo deleted the backport_2984_9.3 branch June 17, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant