diff options
Diffstat (limited to 'appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main')
-rw-r--r-- | appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/http/CommonHttpClient.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/http/CommonHttpClient.java b/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/http/CommonHttpClient.java index 0749eb185..259972844 100644 --- a/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/http/CommonHttpClient.java +++ b/appc-adapters/appc-dmaap-adapter/appc-dmaap-adapter-bundle/src/main/java/org/onap/appc/adapter/messaging/dmaap/http/CommonHttpClient.java @@ -52,23 +52,22 @@ abstract class CommonHttpClient { } protected HttpGet getReq(URI uri, int timeoutMs) throws AuthenticationException { - if (authStr == null) { - throw new AuthenticationException("All DMaaP requests require authentication and none was provided."); - } HttpGet out = (uri == null) ? new HttpGet() : new HttpGet(uri); - out.setHeader("Authorization", String.format("Basic %s", authStr)); + if (authStr != null) { + out.setHeader("Authorization", String.format("Basic %s", authStr)); + } + out.setConfig(getConfig(timeoutMs)); return out; } protected HttpPost postReq(String url) throws AuthenticationException { - if (authStr == null) { - throw new AuthenticationException("All DMaaP requests require authentication and none was provided."); - } HttpPost out = (url == null) ? new HttpPost() : new HttpPost(url); - out.setHeader("Authorization", String.format("Basic %s", authStr)); + if (authStr != null) { + out.setHeader("Authorization", String.format("Basic %s", authStr)); + } out.setConfig(getConfig(0)); return out; } |