[Gem] Fixes header conflict on Serverless#2984
Merged
Merged
Conversation
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
kaisecheng
reviewed
Jun 17, 2026
Co-authored-by: Kaise <[email protected]>
kaisecheng
approved these changes
Jun 17, 2026
kaisecheng
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. Thank you for the quick fix. Red CI is unrelated to this change.
Contributor
Author
|
@kaisecheng thanks! Yes, the issue is with the dependency on JBuilder and specifically JRuby 9.4.15.0. I'll look into it and try to get a green build or skip for this particular version of JRuby in the meantime. |
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
added a commit
that referenced
this pull request
Jun 17, 2026
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 <[email protected]> [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
added a commit
that referenced
this pull request
Jun 17, 2026
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 <[email protected]> [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
added a commit
that referenced
this pull request
Jun 17, 2026
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 <[email protected]> [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
added a commit
that referenced
this pull request
Jun 17, 2026
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 <[email protected]> [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
added a commit
that referenced
this pull request
Jun 17, 2026
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 <[email protected]> [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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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