android: fix begin not getting called

This commit is contained in:
Kesha Antonov
2024-01-25 15:50:14 +03:00
parent 80ead45970
commit b9e9a4c3d2

View File

@@ -37,9 +37,11 @@ public class OnBegin extends Thread {
con.getInputStream().close();
WritableMap params = Arguments.createMap();
int contentLength = Integer.valueOf(headersMap.getString("Content-Length"));
params.putString("id", config.id);
params.putMap("headers", headersMap);
params.putInt("expectedBytes", Integer.valueOf(headersMap.getString("Content-Length")));
params.putInt("expectedBytes", contentLength);
ee.emit("downloadBegin", params);
} catch (Exception e) {