You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// HttpClient doesn't rewind streams and we have to explicitly do so.
38
-
varms=newMemoryStream();
39
-
awaitoriginalRequest.Content.CopyToAsync(ms);
40
-
ms.Position=0;
41
-
newRequest.Content=newStreamContent(ms);
42
-
// Attempt to copy request content headers with a single retry.
43
-
// HttpHeaders dictionary is not thread-safe when targeting anything below .NET 7. For more information, see https://github.com/dotnet/runtime/issues/61798.
44
-
intretryCount=0;
45
-
intmaxRetryCount=2;
46
-
while(retryCount<maxRetryCount)
37
+
// Try cloning request content; otherwise, skip due to https://github.com/dotnet/corefx/pull/19082 in .NET 4.x.
38
+
try
47
39
{
48
-
try
40
+
// HttpClient doesn't rewind streams and we have to explicitly do so.
// Attempt to copy request content headers with a single retry.
46
+
// HttpHeaders dictionary is not thread-safe when targeting anything below .NET 7. For more information, see https://github.com/dotnet/runtime/issues/61798.
0 commit comments