From 6d79d183aab317aa0e6460e98a6e84e5d93c77c7 Mon Sep 17 00:00:00 2001 From: Petr Dvorak Date: Sun, 27 Jun 2021 21:18:56 +0200 Subject: [PATCH] Fix #621: Make sure to release response body when calling a callback --- .../server/service/behavior/tasks/v3/CallbackUrlBehavior.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/v3/CallbackUrlBehavior.java b/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/v3/CallbackUrlBehavior.java index 76192620a..a09a1badb 100644 --- a/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/v3/CallbackUrlBehavior.java +++ b/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/v3/CallbackUrlBehavior.java @@ -225,6 +225,8 @@ public void notifyCallbackListeners(Long applicationId, ActivationRecordEntity a if (response.statusCode().isError()) { logger.warn("Callback failed, URL: {}, status code: {}", callbackUrlEntity.getCallbackUrl(), response.statusCode().toString()); } + // Release resources + response.releaseBody(); }; Consumer onError = error -> logger.warn("Callback failed, URL: {}, error: {}", callbackUrlEntity.getCallbackUrl(), error.getMessage()); restClient.postNonBlocking(callbackUrlEntity.getCallbackUrl(), callbackData, onSuccess, onError);