From 05df038e0b09bfd5f0c9bfc1e8aa10f9c97f39a4 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 5 Feb 2019 17:37:24 +0000 Subject: Fix bug with Apex rejecting HTTP 2xx responses APEX rejects all HTTP responses except 200. This change accepts any HTTP 2xx response code as a valid response. Issue-ID: POLICY-1289 Change-Id: Ief681ba4dac1ef3ff5f257dd931569bd2274d017 Signed-off-by: liamfallon --- .../apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src') diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java index 5591777eb..ddd000dd9 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restclient/src/main/java/org/onap/policy/apex/plugins/event/carrier/restclient/ApexRestClientConsumer.java @@ -205,7 +205,7 @@ public class ApexRestClientConsumer implements ApexEventConsumer, Runnable { .headers(restConsumerProperties.getHttpHeadersAsMultivaluedMap()).get(); // Check that the event request worked - if (response.getStatus() != Response.Status.OK.getStatusCode()) { + if (!Response.Status.Family.familyOf(response.getStatus()).equals(Response.Status.Family.SUCCESSFUL)) { final String errorMessage = "reception of event from URL \"" + restConsumerProperties.getUrl() + "\" failed with status code " + response.getStatus() + " and message \"" + response.readEntity(String.class) + "\""; -- cgit 1.2.3-korg