diff --git a/launcher/src/main/java/com/skcraft/launcher/util/HttpRequest.java b/launcher/src/main/java/com/skcraft/launcher/util/HttpRequest.java index bef8ea9..0823669 100644 --- a/launcher/src/main/java/com/skcraft/launcher/util/HttpRequest.java +++ b/launcher/src/main/java/com/skcraft/launcher/util/HttpRequest.java @@ -328,6 +328,11 @@ public class HttpRequest implements Closeable, ProgressObservable { readBytes += len; checkInterrupted(); } + + if (contentLength >= 0 && contentLength != readBytes) { + throw new IOException(String.format("Connection closed with %d bytes transferred, expected %d", + readBytes, contentLength)); + } } finally { close(); }