-
Notifications
You must be signed in to change notification settings - Fork 224
fix: Ignore global proxy settings if system thinks there's none #4744
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: Ignore global proxy settings if system thinks there's none #4744
Conversation
Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:
|
Bit of context: many applications set http_proxy to :0 in order to disable it. Android libraries understand this, rust however considers :0 to be an invalid entry and connections fail. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4744 +/- ##
===========================================
- Coverage 80.13% 80.12% -0.02%
===========================================
Files 2129 2129
Lines 56449 56453 +4
Branches 7055 7057 +2
===========================================
- Hits 45236 45233 -3
- Misses 8795 8799 +4
- Partials 2418 2421 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
.../impl/src/main/kotlin/io/element/android/libraries/matrix/impl/proxy/DefaultProxyProvider.kt
Show resolved
Hide resolved
Otherwise a :0 proxy would break in Rust SDK.
007e0f5
to
02c8c85
Compare
I did some further testing on the emulator:
So I think that an invalid |
I gave this a quick try and it seems like your implementation works fine, the
Isn't this what you already did in the PR? Unless I missed some corner case I think we can merge it as is, it's better than the current behaviour. |
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.
Thanks for the update @ShadowRZ , and thanks for the extra test @jmartinesp !
Content
Ignore global proxy settings from
Settings.Global.getString(context.contentResolver, Settings.Global.HTTP_PROXY)
if the system says we have no proxyMotivation and context
Closes #3447
See #3447 (comment) for technical details.
Screenshots / GIFs
Tests
adb shell settings put global http_proxy :0
We couldn't reach the homeserver
Tested devices
Checklist