mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 05:26:47 +00:00
Handle case where streaming respone has invalid length (#250)
This commit is contained in:
parent
20de6e03e6
commit
e9d9cf5322
@ -1,6 +1,11 @@
|
||||
## InvenTree App Release Notes
|
||||
---
|
||||
|
||||
### 0.10.0 - February 2023
|
||||
---
|
||||
|
||||
- Bug fix for empty HttpResponse from server
|
||||
|
||||
### 0.9.2 - December 2022
|
||||
---
|
||||
|
||||
|
@ -117,12 +117,14 @@ class InvenTreeFileService extends FileService {
|
||||
}
|
||||
|
||||
final HttpClientResponse httpResponse = await req.close();
|
||||
|
||||
final http.StreamedResponse _response = http.StreamedResponse(
|
||||
httpResponse.timeout(Duration(seconds: 60)), httpResponse.statusCode,
|
||||
contentLength: httpResponse.contentLength,
|
||||
contentLength: httpResponse.contentLength < 0 ? 0 : httpResponse.contentLength,
|
||||
reasonPhrase: httpResponse.reasonPhrase,
|
||||
isRedirect: httpResponse.isRedirect,
|
||||
);
|
||||
|
||||
return HttpGetResponse(_response);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user