Skip to content

Commit cd3c020

Browse files
authored
Pass PostData to BoundConfigurationContent when TransferEncodingChunked is enabled (#189)
As titled. Closes #188
1 parent af2863c commit cd3c020

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Elastic.Transport/Components/TransportClient/Content/RequestDataContent.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ private static void OnStreamAvailable(BoundConfiguration boundConfiguration, Pos
6666
}
6767

6868
/// <summary> Constructor used in asynchronous paths. </summary>
69-
public BoundConfigurationContent(BoundConfiguration boundConfiguration, CancellationToken token)
69+
public BoundConfigurationContent(BoundConfiguration boundConfiguration, PostData? postData, CancellationToken token)
7070
{
7171
_boundConfiguration = boundConfiguration;
72+
_postData = postData;
7273
_token = token;
7374

7475
Headers.TryAddWithoutValidation("Content-Type", boundConfiguration.ContentType);

src/Elastic.Transport/Components/TransportClient/HttpRequestInvoker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ private static void SetContent(HttpRequestMessage message, BoundConfiguration bo
462462
private static async Task SetContentAsync(HttpRequestMessage message, BoundConfiguration boundConfiguration, PostData postData, CancellationToken cancellationToken)
463463
{
464464
if (boundConfiguration.TransferEncodingChunked)
465-
message.Content = new BoundConfigurationContent(boundConfiguration, cancellationToken);
465+
message.Content = new BoundConfigurationContent(boundConfiguration, postData, cancellationToken);
466466
else
467467
{
468468
var stream = boundConfiguration.MemoryStreamFactory.Create();

0 commit comments

Comments
 (0)