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

downloadFile does not follow redirects on Android #71

Closed
cancan101 opened this issue Apr 11, 2016 · 3 comments
Closed

downloadFile does not follow redirects on Android #71

cancan101 opened this issue Apr 11, 2016 · 3 comments

Comments

@cancan101
Copy link
Contributor

Right now downloadFile does not follow redirects on Android where it does on iOS.

@cancan101
Copy link
Contributor Author

I added this hack to download and it "works" though it is a hack:

      if(statusCode == 302) {
        String location = headers.get("Location").get(0);
        param.src = new URL(location);
        download(param, res);
        return;
      }

@cancan101
Copy link
Contributor Author

In investigating further it looks looks like HttpURLConnection on Android won't follow redirects from HTTP to HTTPS:

This implementation doesn't follow redirects from HTTPS to HTTP or vice versa.

whereas it seems the library on iOS does.

@johanneslumpe
Copy link
Collaborator

This should work as of version 1.5.0.

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

No branches or pull requests

2 participants