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

Bump okhttp from 3.14.2 to 4.2.2 #593

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<spotbugs.version>3.1.12</spotbugs.version>
<spotbugs-maven-plugin.failOnError>true</spotbugs-maven-plugin.failOnError>
<hamcrest.version>2.2</hamcrest.version>
<okhttp3.version>3.14.2</okhttp3.version>
<okhttp3.version>4.2.2</okhttp3.version>
<okio.version>2.4.1</okio.version>
<jacoco.coverage.target.class>.80</jacoco.coverage.target.class>
<jacoco.coverage.target.method>0.20</jacoco.coverage.target.method>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,16 @@ static long contentLength(Headers headers) {
}

static String responseSourceHeader(Response response) {
if (response.networkResponse() == null) {
Response networkResponse = response.networkResponse();
if (networkResponse == null) {
return response.cacheResponse() == null
? "NONE"
: "CACHE " + response.code();
} else {
return response.cacheResponse() == null
? "NETWORK " + response.code()
: "CONDITIONAL_CACHE " + networkResponse.code();
}
return response.cacheResponse() == null
? "NETWORK " + response.code()
: "CONDITIONAL_CACHE " + response.networkResponse().code();
}

static String statusLineToString(Response response) {
Expand Down Expand Up @@ -351,6 +353,8 @@ static final class OkHttpURLConnection extends HttpURLConnection implements Call
call.cancel();
}

@SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE",
justification = "hasBody checks for this")
@Override public InputStream getErrorStream() {
try {
Response response = getResponse(true);
Expand Down Expand Up @@ -422,6 +426,8 @@ Headers getHeaders() throws IOException {
return toMultimap(requestHeaders.build(), null);
}

@SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE",
justification = "Good request will have body")
@Override public InputStream getInputStream() throws IOException {
if (!doInput) {
throw new ProtocolException("This protocol does not support input");
Expand Down Expand Up @@ -450,6 +456,8 @@ Headers getHeaders() throws IOException {
return requestBody.outputStream;
}

@SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE",
justification = "usingProxy() handles this")
@Override public Permission getPermission() {
URL url = getURL();
String hostname = url.getHost();
Expand Down Expand Up @@ -714,6 +722,8 @@ public void proceed() {
}
}

@SuppressFBWarnings(value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE",
justification = "If we get here there is a connection and request.body() is checked")
@Override public Response intercept(Chain chain) throws IOException {
Request request = chain.request();

Expand Down