1
0
mirror of https://github.com/SKCraft/Launcher.git synced 2025-01-08 19:38:58 +01:00

Fix NPE in HttpDownloader if server does not send Accept-Ranges header

This commit is contained in:
Henry Le Grys 2021-03-10 13:17:55 +00:00
parent cf7e12b4d1
commit cdb32a3fe7

View File

@ -350,7 +350,7 @@ public class HttpRequest implements Closeable, ProgressObservable {
} }
public Optional<PartialDownloadInfo> canRetryPartial() { public Optional<PartialDownloadInfo> canRetryPartial() {
if (conn.getHeaderField("Accept-Ranges").equals("bytes")) { if ("bytes".equals(conn.getHeaderField("Accept-Ranges"))) {
return Optional.of(new PartialDownloadInfo(contentLength, readBytes)); return Optional.of(new PartialDownloadInfo(contentLength, readBytes));
} }