diff --git a/classlib/src/main/java/org/teavm/classlib/java/net/impl/TXHRURLConnection.java b/classlib/src/main/java/org/teavm/classlib/java/net/impl/TXHRURLConnection.java index 7e5afb842..0f993069d 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/net/impl/TXHRURLConnection.java +++ b/classlib/src/main/java/org/teavm/classlib/java/net/impl/TXHRURLConnection.java @@ -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()];