Committed by
GitHub
Merge pull request #1151 from Katekko/fix/content-length
Fix content length equals null, need to be zero instead
Showing
1 changed file
with
2 additions
and
1 deletions
@@ -139,7 +139,7 @@ class GetHttpClient { | @@ -139,7 +139,7 @@ class GetHttpClient { | ||
139 | url: uri, | 139 | url: uri, |
140 | headers: headers, | 140 | headers: headers, |
141 | bodyBytes: bodyStream, | 141 | bodyBytes: bodyStream, |
142 | - contentLength: bodyBytes.length, | 142 | + contentLength: bodyBytes?.length ?? 0, |
143 | followRedirects: followRedirects, | 143 | followRedirects: followRedirects, |
144 | maxRedirects: maxRedirects, | 144 | maxRedirects: maxRedirects, |
145 | decoder: decoder, | 145 | decoder: decoder, |
@@ -251,6 +251,7 @@ class GetHttpClient { | @@ -251,6 +251,7 @@ class GetHttpClient { | ||
251 | url: uri, | 251 | url: uri, |
252 | headers: headers, | 252 | headers: headers, |
253 | decoder: decoder ?? (defaultDecoder as Decoder<T>), | 253 | decoder: decoder ?? (defaultDecoder as Decoder<T>), |
254 | + contentLength: 0, | ||
254 | )); | 255 | )); |
255 | } | 256 | } |
256 | 257 |
-
Please register or login to post a comment