Code Review
/
appc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Possible fix for event listener
[appc.git]
/
appc-adapters
/
appc-dmaap-adapter
/
appc-dmaap-adapter-bundle
/
src
/
main
/
java
/
org
/
onap
/
appc
/
adapter
/
messaging
/
dmaap
/
http
/
CommonHttpClient.java
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
0749eb1
..
2599728
100644
(file)
--- 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 {
}
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);
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 {
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);
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;
}
out.setConfig(getConfig(0));
return out;
}