Skip to content

Commit a765197

Browse files
authored
Merge branch 'dev' into po/BYOT
2 parents a693fae + ebbe1b5 commit a765197

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/Authentication/Authentication/Helpers/HttpMessageFormatter.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ protected override async Task SerializeToStreamAsync(Stream stream, TransportCon
182182
{
183183
var readStream = await _streamTask.Value;
184184
ValidateStreamForReading(readStream);
185-
await Content.CopyToAsync(stream);
185+
if (!_contentConsumed)
186+
{
187+
await Content.CopyToAsync(stream);
188+
}
186189
}
187190
}
188191

tools/Custom/HttpMessageFormatter.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,7 @@ internal class HttpMessageFormatter : HttpContent
5050
// Set of header fields that should not get serialized
5151
private static readonly HashSet<string> _neverSerializedHeaderFields = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
5252
{
53-
"SdkVersion",
54-
"FeatureFlag",
55-
"Authorization",
56-
"Cache-Control",
57-
"Transfer-Encoding",
58-
"Duration",
59-
"Strict-Transport-Security",
60-
"Date"
53+
"Authorization"
6154
};
6255

6356
private bool _contentConsumed;
@@ -209,7 +202,10 @@ protected override async Task SerializeToStreamAsync(Stream stream, TransportCon
209202
{
210203
Stream readStream = await _streamTask.Value;
211204
ValidateStreamForReading(readStream);
212-
await Content.CopyToAsync(stream);
205+
if (!_contentConsumed)
206+
{
207+
await Content.CopyToAsync(stream);
208+
}
213209
}
214210
}
215211

0 commit comments

Comments
 (0)