mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Handle case where streaming respone has invalid length (#250)
This commit is contained in:
parent
20de6e03e6
commit
e9d9cf5322
2 changed files with 8 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue