Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the new url after 302 redirect happening. #415

Closed
hufozhu opened this issue Nov 30, 2016 · 2 comments
Closed

How to get the new url after 302 redirect happening. #415

hufozhu opened this issue Nov 30, 2016 · 2 comments
Labels

Comments

@hufozhu
Copy link

hufozhu commented Nov 30, 2016

Hi,

Recently, we get a lot of broken files after downloaded, so we want to check if the download urls are redirected and record the true download url when we get a broken file. Any idea about how to implement this? Thanks very much.

@Jacksgong
Copy link
Collaborator

In the old version(before v1.3.9), the redirect have been handled by okHttp(we will use the final url to fetch data-stream after redirect).

But in the latest version, since FileDownloader no longer dependent the okHttp, and the default connection component is FileDownloadUrlConnection which just use URL#openConnection, it doesn't handle redirect-state.

So in the current latest version, you can wrap your own FileDownloadConnection to handle redirect by yourself, please move to the doc.

@Jacksgong
Copy link
Collaborator

Jacksgong commented Jan 9, 2017

If you want to the FileDownloader uses okHttp like before v1.3.9, just use this repo or write your own FileDownloadConnection component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants