mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-12 18:25:26 +00:00
Handle case where streaming respone has invalid length (#250)
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user