-
Notifications
You must be signed in to change notification settings - Fork 202
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
base: master
Are you sure you want to change the base?
Conversation
…tion cast in downloader thread. Also allow up to 2 redirects.
There was a problem hiding this 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; |
There was a problem hiding this comment.
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")) { |
There was a problem hiding this comment.
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.
Ensure appropiate procotol variable is referenced to determine connection cast in downloader thread.
Also allow up to 2 redirects.