Skip to content

Commit 1278340

Browse files
committed
Fix downloading BuildManifest when direct download is not available (for real this time)
1 parent 3957bce commit 1278340

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/airsquared/blobsaver/app/Network.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ private void ensureOpen() throws IOException {
174174
if (pos > 0)
175175
connection.addRequestProperty("Range", "bytes=" + pos + "-");
176176
ch = Channels.newChannel(connection.getInputStream());
177-
if (connection instanceof HttpURLConnection c && c.getResponseCode() != 200) {
177+
if (connection instanceof HttpURLConnection c && (c.getResponseCode() < 200 || c.getResponseCode() > 299)) {
178178
throw new IOException("HTTP Response was " + c.getResponseCode() + " " + Utils.defIfNull(c.getResponseMessage(), ""));
179179
}
180180
String resp = connection.getHeaderField("Content-Range");

0 commit comments

Comments
 (0)