aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/main
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-10-09 12:24:52 +0000
committerGerrit Code Review <gerrit@onap.org>2019-10-09 12:24:52 +0000
commite39c2cbf62f993dbe7843b3eb360c485ef445554 (patch)
treef518ae6f7de14fad3aa15c3f85b69b011073bb0d /bpmn/so-bpmn-tasks/src/main
parent7a19f3d53a4983a3986ba6adba3f35bd7e54f254 (diff)
parentc84283411ffad8531cbdb1f45d3e2b38b088f848 (diff)
Merge "mso should not send content type http header to"
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.java6
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java6
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);