Skip to content

Commit 6237a8c

Browse files
authored
Merge pull request #1296 from rantianhua/fix/1295
fix: close automation redirects of HttpUrlConnection
2 parents 91228db + f1cbeff commit 6237a8c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/src/main/java/com/liulishuo/filedownloader/connection/FileDownloadUrlConnection.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ public FileDownloadUrlConnection(URL url, Configuration configuration) throws IO
4646
} else {
4747
mConnection = url.openConnection();
4848
}
49+
if (mConnection instanceof HttpURLConnection) {
50+
((HttpURLConnection) mConnection).setInstanceFollowRedirects(false);
51+
}
4952

5053
if (configuration != null) {
5154
if (configuration.readTimeout != null) {

0 commit comments

Comments
 (0)