summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-04-26 10:47:39 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-04-26 11:38:23 +0530
commitb332e883b745f01b2c932d80f734ef7c10f0f378 (patch)
treedf2a72ddbf110347782102f390e9a97718c4e6ee
parent42249b421aab454bec9766782bdac65572f2dce7 (diff)
Combine nested if statements into one
Issue-ID: CLI-100 Change-Id: I526dd2fe96abc098d2a33d20906e09dd6f51435e Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
-rw-r--r--profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java7
1 files changed, 3 insertions, 4 deletions
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 e5494537..266ab855 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
@@ -232,11 +232,10 @@ public class OnapHttpConnection {
}
private void addCommonHeaders(HttpInput input) {
- if (!input.isBinaryData()) {
- if (!input.getReqHeaders().containsKey("Content-Type")) {
- input.getReqHeaders().put("Content-Type", OnapCommandHttpConstants.APPLICATION_JSON);
- }
+ if (!input.isBinaryData() && !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);
}