From b332e883b745f01b2c932d80f734ef7c10f0f378 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Thu, 26 Apr 2018 10:47:39 +0530 Subject: Combine nested if statements into one Issue-ID: CLI-100 Change-Id: I526dd2fe96abc098d2a33d20906e09dd6f51435e Signed-off-by: Kanagaraj Manickam k00365106 --- .../main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'profiles/http') 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); } -- cgit 1.2.3-korg