-
Notifications
You must be signed in to change notification settings - Fork 275
Http2 bug workaround #1060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Http2 bug workaround #1060
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, once the explanation comment has been added.
@@ -243,25 +243,20 @@ private <RequestT, ResponseT, ErrorT> TransportHttpClient.Request prepareTranspo | |||
Map<String, String> params = endpoint.queryParameters(request); | |||
|
|||
List<ByteBuffer> bodyBuffers = null; | |||
HeaderMap headers = DefaultHeaders; | |||
HeaderMap headers = JsonContentTypeHeaders; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a note here explaining why we set the content-type even for requests with no body. It will be useful for our future selves!
Elasticsearch issue that required this fix: elastic/elasticsearch#133408 |
* http2 issue workaround * adding comment
* http2 issue workaround * adding comment
* http2 issue workaround * adding comment Co-authored-by: Laura Trotta <[email protected]>
* http2 issue workaround * adding comment Co-authored-by: Laura Trotta <[email protected]>
This provides a workaround for a bug which affects empty body requests when sent with the Rest5Client configured to support http2.
The issue was introduced server side by elastic/elasticsearch#129302 and results in empty body requests causing the following exception:
Invalid media-type value on headers [Accept, Content-Type]
.(bonus: log fixes for Rest5Client)