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

Fix https->http redirects. #366

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix https->http redirects. #366

wants to merge 1 commit into from

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?

@@ -80,6 +80,7 @@ public void run() {

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?

@@ -90,7 +91,7 @@ public void run() {

// 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