Repository navigation
fix: disable Expect: 100-continue for the Curl client of elastic/transport - #2322
Open
andrii-pukhalevych wants to merge 1 commit into
Open
andrii-pukhalevych wants to merge 1 commit into
andrii-pukhalevych wants to merge 1 commit into
Conversation
…sport For a body over 1 MB curl adds `Expect: 100-continue` on its own, and `Elastic\Transport\Client\Curl` takes the interim `100 Continue` answer for the response: status 100 with no headers, so every such request fails with "No Content-Type specified in the response". Keep the header out of the requests when that client is in use, and cover it with a unit test and a functional test with a 1.2 MB search. Fixes ruflin#2321
andrii-pukhalevych
force-pushed
the
fix-curl-100-continue
branch
from
October 22, 2026 14:57
96fb4f9 to
495d4f1
Compare
ruflin
reviewed
Oct 28, 2026
| * and the Curl client of elastic/transport takes "100 Continue" for the response | ||
| */ | ||
| if ($this->isCurlHttpClient($transport)) { | ||
| $transport->setHeader('Expect', ''); |
Owner
There was a problem hiding this comment.
This means if a user set their own Expect header, it would be reset? Likely a rare edge case.
Author
There was a problem hiding this comment.
Surprisely yes. And it's real project where this happens.
Owner
|
Related: the root-cause fix is now a draft PR upstream, elastic/elastic-transport-php#48 ( This PR is still worth having for users on older |
Owner
|
@andrii-pukhalevych Could you take a look at elastic/elastic-transport-php#48 I had sent my agent to create it ;-) |
This branch has not been deployed
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.
For a body over 1 MB curl adds
Expect: 100-continueon its own, andElastic\Transport\Client\Curltakes the interim100 Continueanswer for the response: status 100 with no headers, so every such request fails with "No Content-Type specified in the response".Keep the header out of the requests when that client is in use, and cover it with a unit test and a functional test with a 1.2 MB search.
Fixes #2321