Skip to content

Fix https->http redirects.#366

Open
sleaze wants to merge 1 commit into
4pr0n:masterfrom
sleaze:sleaze/fix-https-to-http-redirects
Open

Fix https->http redirects.#366
sleaze wants to merge 1 commit into
4pr0n:masterfrom
sleaze:sleaze/fix-https-to-http-redirects

Conversation

@sleaze

@sleaze sleaze commented Dec 12, 2016

Copy link
Copy Markdown

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.

@metaprime metaprime left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
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