Skip to content

Commit

Permalink
Merge pull request #114 from CleverTap/force_tls
Browse files Browse the repository at this point in the history
Fix connection reuse
  • Loading branch information
judepereira authored Dec 1, 2024
2 parents 465edb3 + e595e28 commit 3fc3ccb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.clevertap.apns</groupId>
<artifactId>apns-http2</artifactId>
<version>4.0.3</version>
<version>4.0.4</version>

<name>apns-http2</name>
<description>A library for communicating with the Apple Push Gateway in HTTP/2.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,13 @@ protected NotificationResponse parseResponse(Response response) throws IOExcepti
if (response.code() != 200) {
error = NotificationRequestError.get(statusCode);
contentBody = response.body() != null ? response.body().string() : null;
} else {
try (ResponseBody responseBody = response.body()) {
if (responseBody != null) {
// Read the response into memory but don't use the content
responseBody.source().skip(responseBody.contentLength());
}
}
}

return new NotificationResponse(error, statusCode, contentBody, null);
Expand Down

0 comments on commit 3fc3ccb

Please sign in to comment.