aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--framework/src/main/java/org/onap/cli/fw/output/OnapCommandResultAttribute.java4
-rw-r--r--profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java10
2 files changed, 10 insertions, 4 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/output/OnapCommandResultAttribute.java b/framework/src/main/java/org/onap/cli/fw/output/OnapCommandResultAttribute.java
index d54fbff0..1208a3cd 100644
--- a/framework/src/main/java/org/onap/cli/fw/output/OnapCommandResultAttribute.java
+++ b/framework/src/main/java/org/onap/cli/fw/output/OnapCommandResultAttribute.java
@@ -58,7 +58,9 @@ public class OnapCommandResultAttribute {
private boolean isSecured = false;
public void setValues(List<String> values) {
- this.values = (values == null) ? new ArrayList<>() : values;
+ if (values != null) {
+ this.values = values;
+ }
}
public String getName() {
diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java
index a5a75e11..1ce0433c 100644
--- a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java
+++ b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java
@@ -227,9 +227,13 @@ public class OnapHttpConnection {
private void addCommonHeaders(HttpInput input) {
if (!input.isBinaryData()) {
- input.getReqHeaders().put("Content-Type", OnapCommandHttpConstants.APPLICATION_JSON);
+ if (!input.getReqHeaders().containsKey("Content-Type")) {
+ input.getReqHeaders().put("Content-Type", OnapCommandHttpConstants.APPLICATION_JSON);
+ }
+ }
+ if (!input.getReqHeaders().containsKey("Accept")) {
+ input.getReqHeaders().put("Accept", OnapCommandHttpConstants.APPLICATION_JSON);
}
- input.getReqHeaders().put("Accept", OnapCommandHttpConstants.APPLICATION_JSON);
for (String headerName : this.mapCommonHeaders.keySet()) {
input.getReqHeaders().put(headerName, this.mapCommonHeaders.get(headerName));
@@ -328,7 +332,7 @@ public class OnapHttpConnection {
throw new OnapCommandHttpFailure(e);
} finally {
if (this.debug) {
- this.debugDetails = input + "" + result;
+ this.debugDetails = input + " " + result;
}
}