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

111 fixed, updated OkHttp 3.2.0->3.9.0 #236

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

Conversation

YuraLaguta
Copy link

No description provided.

@codecov-io
Copy link

codecov-io commented Oct 31, 2017

Codecov Report

Merging #236 into master will decrease coverage by 1.79%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master     #236     +/-   ##
===========================================
- Coverage     36.98%   35.18%   -1.8%     
  Complexity       45       45             
===========================================
  Files            39       39             
  Lines           530      540     +10     
  Branches         27       28      +1     
===========================================
- Hits            196      190      -6     
- Misses          325      341     +16     
  Partials          9        9
Impacted Files Coverage Δ Complexity Δ
...ava/com/artemzin/qualitymatters/api/ApiModule.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...alitymatters/network/OkHttpInterceptorsModule.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...artemzin/qualitymatters/network/NetworkModule.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...alitymatters/network/HostSelectionInterceptor.java 0% <0%> (ø) 0 <0> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8626c5c...402a135. Read the comment docs.

@dsrees dsrees mentioned this pull request Nov 3, 2017
Copy link
Owner

@artem-zinnatullin artem-zinnatullin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments :)

*/
public final class HostSelectionInterceptor implements Interceptor {
/**
* Using static variable in order to avoid adding this interceptor to ApplicationComponent

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment seems to be out of sync with code

}

@Override
public okhttp3.Response intercept(@NonNull Chain chain) throws IOException {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import Response?

HttpUrl newUrl = request.url().newBuilder()
.host(uri.getHost())
.port(uri.getPort())
.scheme("http") //in order to avoid SSL Handshake failure

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow wow, this is pretty dangerous code in case if someone will copy-paste it and use to switch to lets say "staging/prod" environment in the app

I'd prefer to store schema in base url that we want to swap to, maybe use HttpUrl class instead of String and get basic info like host, schema and port


import static org.assertj.core.api.Assertions.assertThat;

public class ChangeableBaseUrlTest {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we should have test for interceptor then

public List<Interceptor> provideOkHttpInterceptors(@NonNull HttpLoggingInterceptor httpLoggingInterceptor) {
return singletonList(httpLoggingInterceptor);
public List<Interceptor> provideOkHttpInterceptors(@NonNull HttpLoggingInterceptor httpLoggingInterceptor,
@NonNull HostSelectionInterceptor hostSelectionInterceptor) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that the proper indentation for this project?

@@ -0,0 +1,2 @@
# OkHttp3
-dontwarn okhttp3.**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll need more rules. there's one more for the publicsuffixdatabase thing. they've got it documented.

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.

4 participants