Skip to content

Commit f560104

Browse files
committed
[PW-622] removed if condition on connectiontimeout and redundant response variable.
1 parent ad9e949 commit f560104

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/main/java/com/adyen/httpclient/HttpURLConnectionClient.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,11 @@ public String request(String requestUrl, String requestBody, Config config, bool
6363
} else {
6464
setBasicAuthentication(httpConnection, config.getUsername(), config.getPassword());
6565
}
66-
if (connectionTimeoutMillis > 0) {
67-
setConnectionTimeout(httpConnection, connectionTimeoutMillis);
68-
}
66+
67+
httpConnection.setConnectTimeout(connectionTimeoutMillis);
6968
setContentType(httpConnection, "application/json");
70-
String response = doPostRequest(httpConnection, requestBody);
7169

72-
return response;
70+
return doPostRequest(httpConnection, requestBody);
7371
}
7472

7573
private static String getResponseBody(InputStream responseStream) throws IOException {
@@ -169,11 +167,6 @@ private HttpURLConnection setApiKey(HttpURLConnection httpConnection, String api
169167
return httpConnection;
170168
}
171169

172-
private HttpURLConnection setConnectionTimeout(HttpURLConnection httpConnection, int connectionTimeout) {
173-
httpConnection.setConnectTimeout(connectionTimeout);
174-
return httpConnection;
175-
}
176-
177170
/**
178171
* Does a POST request with raw body
179172
*/

0 commit comments

Comments
 (0)