Skip to content

Commit 2145695

Browse files
committed
fix wrong base url when there's multiple url redirect
1 parent 5f736fd commit 2145695

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

android/src/main/java/vn/hunghd/flutterdownloader/DownloadWorker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ private void downloadFile(Context context, String fileURL, String savedDir, Stri
284284
log("Response with redirection code");
285285
location = httpConn.getHeaderField("Location");
286286
log("Location = " + location);
287-
base = new URL(fileURL);
287+
base = new URL(url);
288288
next = new URL(base, location); // Deal with relative URLs
289289
url = next.toExternalForm();
290290
log("New url: " + url);

0 commit comments

Comments
 (0)