diff options
author | Plummer, Brittany <brittany.plummer@att.com> | 2019-09-25 18:04:11 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@att.com> | 2019-10-01 08:34:44 -0400 |
commit | c84283411ffad8531cbdb1f45d3e2b38b088f848 (patch) | |
tree | 3136edceb49f71c4a2c49da9d8e625f51cb10262 /bpmn/so-bpmn-tasks/src/main | |
parent | 4e944d4149bfcf7196691c57f3ae6659ffd05960 (diff) |
mso should not send content type http header to
Updated getHeaders to not add Content-Type header on GET requests
Updated getHttpHeaders boolean to includeContentType
Issue-ID: SO-2366
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: I476bf02791d699cda2ca4118c8f578c96461097e
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java | 6 | ||||
-rw-r--r-- | bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java index 07f448e5e1..7d2fc10d0b 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java @@ -55,7 +55,7 @@ public class SDNCClient { BaseClient<String, LinkedHashMap<String, Object>> STOClient = new BaseClient<>(); STOClient.setTargetUrl(targetUrl); - HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth()); + HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth(), true); STOClient.setHttpHeader(httpHeader); LinkedHashMap<String, Object> output = STOClient.post(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {}); @@ -67,7 +67,7 @@ public class SDNCClient { String jsonRequest = sdnCommonTasks.buildJsonRequest(request); BaseClient<String, LinkedHashMap<String, Object>> STOClient = new BaseClient<>(); STOClient.setTargetUrl(url); - HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth()); + HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth(), true); STOClient.setHttpHeader(httpHeader); LinkedHashMap<String, Object> output = STOClient.post(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {}); @@ -87,7 +87,7 @@ public class SDNCClient { String targetUrl = UriBuilder.fromUri(properties.getHost()).path(queryLink).build().toString(); BaseClient<String, LinkedHashMap<String, Object>> STOClient = new BaseClient<>(); STOClient.setTargetUrl(targetUrl); - HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth()); + HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth(), false); STOClient.setHttpHeader(httpHeader); LinkedHashMap<String, Object> output = STOClient.get(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {}); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java index 1144648517..e7e4e25af2 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java @@ -82,10 +82,12 @@ public class SdnCommonTasks { * @param auth * @return */ - public HttpHeaders getHttpHeaders(String auth) { + public HttpHeaders getHttpHeaders(String auth, boolean includeContentType) { HttpHeaders httpHeader = new HttpHeaders(); httpHeader.set("Authorization", auth); - httpHeader.setContentType(MediaType.APPLICATION_JSON); + if (includeContentType) { + httpHeader.setContentType(MediaType.APPLICATION_JSON); + } List<MediaType> acceptMediaTypes = new ArrayList<>(); acceptMediaTypes.add(MediaType.APPLICATION_JSON); httpHeader.setAccept(acceptMediaTypes); |