We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81d3eed commit 6175d14Copy full SHA for 6175d14
nanoFramework.System.Net.Http/Http/StreamContent.cs
@@ -81,12 +81,19 @@ protected override void SerializeToStream(Stream stream)
81
byte[] buffer = new byte[2048];
82
int read;
83
int totalRead = 0;
84
- int contentLength = (int)Headers.ContentLength;
+ long contentLength = Headers.ContentLength;
85
86
// occurrs when there is not Content_Length header (i.e. chunked response)
87
if (contentLength < 0)
88
{
89
- contentLength = int.MaxValue;
+ if (TryComputeLength(out long possibleLength))
90
+ {
91
+ contentLength = possibleLength;
92
+ }
93
+ else
94
95
+ contentLength = int.MaxValue;
96
97
}
98
99
while (totalRead < contentLength)
0 commit comments