[9.3] Backports #2984 - Fixes header conflict on Serverless#2986
Merged
Conversation
eb32798 to
7f78d8d
Compare
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
7f78d8d to
15ece5a
Compare
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
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