diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/util/HandlerUtil.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/util/HandlerUtil.java index 57ccd146ad..98d8e42c64 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/util/HandlerUtil.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/util/HandlerUtil.java @@ -104,14 +104,14 @@ public class HandlerUtil { final HttpEntity responseEntity = response.getEntity(); ProxyResponse handlerResponse = new ProxyResponse(); int statusCode = response.getCode(); + if (statusCode == 204) { + handlerResponse.setCode(statusCode); + handlerResponse.setStatus(ProxyResponse.Status.SUCCESS); + handlerResponse.setExecutorResponse("SUCCESS"); + handlerResponse.setHeaders(response.getHeaders()); + return handlerResponse; + } if (responseEntity == null) { - if (statusCode == 204) { - handlerResponse.setCode(statusCode); - handlerResponse.setStatus(ProxyResponse.Status.SUCCESS); - handlerResponse.setExecutorResponse("SUCCESS"); - handlerResponse.setHeaders(response.getHeaders()); - return handlerResponse; - } log.error("Received null response for http request : " + httpRequest.getMethod() + " " + httpRequest.getRequestUri()); handlerResponse.setCode(HandlerConstants.INTERNAL_ERROR_CODE); handlerResponse.setStatus(ProxyResponse.Status.ERROR);