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

Resolve #383 redirect with protocol change #396

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ath0mas
Copy link
Contributor

@ath0mas ath0mas commented Jan 17, 2021

Fix #383

@ath0mas
Copy link
Contributor Author

ath0mas commented Jan 17, 2021

More results for this spec :

  • fail with plugin 3.1.0 and 3.1.1(dev)
  • success with 2.5.1, as we expected :) given okhttp setting analysis explained in issue

@silkimen
Copy link
Owner

Thanks for looking into this issue!



when followRedirects=true and still receiving a redirect response, do manual recursion using "Location" header as the new url
@ath0mas ath0mas marked this pull request as ready for review January 20, 2021 22:58
@ath0mas
Copy link
Contributor Author

ath0mas commented Jan 20, 2021

My fix is running well with the original tests table and with the spec added here 2 days ago.
Even for me it seems naive or basic so any feedback, change suggestion or contribution would be very welcome!

Should it manage a maximum number of redirections? add a user option like the okhttp followSslRedirects? catch invalid url? match a more reduced set of redirect response codes?
Is that secure enough? given the answers I linked in the parent issue - headers to cleanup? fine for other methods than Get with or without body param? ...etc

@b4rtaz
Copy link

b4rtaz commented Mar 23, 2021

When this PR joins to repo?

@silkimen
Copy link
Owner

silkimen commented Jul 7, 2021

Hey guys, sorry for late response.

I think this implementation is very dangerous. As far as I understand, you do not check if the redirect URL requests a HTTPS upgrade (requesting HTTP --> redirected to HTTPS) or a downgrade (requesting HTTPS --> redirected to HTTP).

Downgrades shouldn't be allowed, or at least it should be configurable to prevent that.

@silkimen silkimen force-pushed the master branch 3 times, most recently from e8a8d65 to 0ccf64e Compare July 22, 2021 13:40
@silkimen silkimen force-pushed the master branch 8 times, most recently from 1a1c9e0 to ed08534 Compare March 30, 2022 14:19
@silkimen silkimen force-pushed the master branch 7 times, most recently from 449aa28 to 6fc8a7e Compare December 29, 2022 03:59
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.

[Bug] [Android] not following redirects for http/https URLs since version 3
3 participants