When HTTP response invalid, return -1 as a responseCode

This commit is contained in:
Alexey Andreev 2018-01-09 22:15:37 +03:00
parent 8dea7e9035
commit ac236f1ff8

View File

@ -89,6 +89,9 @@ public class TXHRURLConnection extends THttpURLConnection {
responseCode = xhr.getStatus();
responseMessage = xhr.getStatusText();
if (responseCode == 0) {
responseCode = -1;
}
Int8Array array = Int8Array.create((ArrayBuffer) xhr.getResponse());
byte[] bytes = new byte[array.getLength()];