mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 21:47:42 -05:00
Fix broken etag handling. Maybe fixes #802
This commit is contained in:
@@ -161,13 +161,6 @@ public class Download {
|
||||
eTag = readEtag(output);
|
||||
}
|
||||
|
||||
try {
|
||||
createParentDirs(output.toFile());
|
||||
Files.deleteIfExists(output);
|
||||
} catch (IOException e) {
|
||||
throw error(e, "Failed to prepare path for download");
|
||||
}
|
||||
|
||||
final HttpRequest httpRequest = eTag
|
||||
.map(this::getETagRequest)
|
||||
.orElseGet(this::getRequest);
|
||||
@@ -186,6 +179,13 @@ public class Download {
|
||||
}
|
||||
|
||||
if (success) {
|
||||
try {
|
||||
createParentDirs(output.toFile());
|
||||
Files.deleteIfExists(output);
|
||||
} catch (IOException e) {
|
||||
throw error(e, "Failed to prepare path for download");
|
||||
}
|
||||
|
||||
final long length = Long.parseLong(response.headers().firstValue("Content-Length").orElse("-1"));
|
||||
AtomicLong totalBytes = new AtomicLong(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user