mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
changes to 204 status code handling
This commit is contained in:
parent
fe8b784cdf
commit
634763a6db
@ -104,14 +104,14 @@ public class HandlerUtil {
|
|||||||
final HttpEntity responseEntity = response.getEntity();
|
final HttpEntity responseEntity = response.getEntity();
|
||||||
ProxyResponse handlerResponse = new ProxyResponse();
|
ProxyResponse handlerResponse = new ProxyResponse();
|
||||||
int statusCode = response.getCode();
|
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 (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());
|
log.error("Received null response for http request : " + httpRequest.getMethod() + " " + httpRequest.getRequestUri());
|
||||||
handlerResponse.setCode(HandlerConstants.INTERNAL_ERROR_CODE);
|
handlerResponse.setCode(HandlerConstants.INTERNAL_ERROR_CODE);
|
||||||
handlerResponse.setStatus(ProxyResponse.Status.ERROR);
|
handlerResponse.setStatus(ProxyResponse.Status.ERROR);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user