Skip to content

Conversation

@sleaze
Copy link

@sleaze sleaze commented Dec 12, 2016

Ensure appropiate procotol variable is referenced to determine connection cast in downloader thread.

Also allow up to 2 redirects.

…tion cast

in downloader thread.

Also allow up to 2 redirects.
Copy link
Collaborator

@metaprime metaprime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add more description about what issue this is fixing? Could you provide a URL which results in this code path, or add a test?


URL urlToDownload = this.url;
boolean redirected = false;
boolean redirectedAgain = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use a counter instead of two separate booleans?

// Setup HTTP request
HttpURLConnection huc;
if (this.url.toString().startsWith("https")) {
if (urlToDownload.toString().startsWith("https")) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this set somewhere besides urlToDownload = this.url? If not, this is basically just renaming the variable used, correct? Just want to make sure.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants