diff options
author | liamfallon <liam.fallon@est.tech> | 2019-02-05 17:37:24 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2019-02-05 17:37:24 +0000 |
commit | 05df038e0b09bfd5f0c9bfc1e8aa10f9c97f39a4 (patch) | |
tree | 05779d28246969ee2b87ebbd9868be954dded78a /plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src | |
parent | aacfb4ca7da6a76282c5703049fb7b52f65a36a8 (diff) |
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 <liam.fallon@est.tech>
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src')
-rw-r--r-- | plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java index 746fc85c4..57c14b946 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java @@ -351,7 +351,7 @@ public class ApexRestRequestorConsumer implements ApexEventConsumer, Runnable { final Response response = sendEventAsRestRequest(); // 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 response to \"" + request + "\" from URL \"" + restConsumerProperties.getUrl() + "\" failed with status code " + response.getStatus() + " and message \"" + response.readEntity(String.class) |