aboutsummaryrefslogtreecommitdiffstats
path: root/utils/webseal-simulator/src
diff options
context:
space:
mode:
authorYuli Shlosberg <ys9693@att.com>2018-10-10 17:01:01 +0300
committerMichael Lando <michael.lando@intl.att.com>2018-10-10 14:57:41 +0000
commited933de77ce09afc8833199d344c01e50e96c5c9 (patch)
tree6b04efea1ecb9bc9b550415de1e6b42e53d61894 /utils/webseal-simulator/src
parent160aadf286293ff3d1f3e4be8b0f4052c09923e1 (diff)
update httpClient version
Change-Id: Ib7562e44b8ccaad396ab2e9a607ea29527f2239d Issue-ID: SDC-1725 Signed-off-by: Yuli Shlosberg <ys9693@att.com>
Diffstat (limited to 'utils/webseal-simulator/src')
-rw-r--r--utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java b/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java
index 7fbc8ac99f..329b7ffbaa 100644
--- a/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java
+++ b/utils/webseal-simulator/src/main/java/org/openecomp/sdc/webseal/simulator/SdcProxy.java
@@ -182,8 +182,6 @@ public class SdcProxy extends HttpServlet {
ServletInputStream inputStream = null;
InputStreamEntity entity = null;
- String contentType = request.getContentType();
- ContentType myContent = ContentType.create(contentType);
switch (methodEnum) {
case GET:
proxyMethod = new HttpGet(uri);
@@ -191,13 +189,13 @@ public class SdcProxy extends HttpServlet {
case POST:
proxyMethod = new HttpPost(uri);
inputStream = request.getInputStream();
- entity = new InputStreamEntity(inputStream, myContent);
+ entity = new InputStreamEntity(inputStream, getContentType(request));
((HttpPost) proxyMethod).setEntity(entity);
break;
case PUT:
proxyMethod = new HttpPut(uri);
inputStream = request.getInputStream();
- entity = new InputStreamEntity(inputStream, myContent);
+ entity = new InputStreamEntity(inputStream, getContentType(request));
((HttpPut) proxyMethod).setEntity(entity);
break;
case DELETE:
@@ -207,6 +205,11 @@ public class SdcProxy extends HttpServlet {
return proxyMethod;
}
+ private ContentType getContentType(HttpServletRequest request) {
+ ContentType contentType = ContentType.parse(request.getContentType());
+ return ContentType.create(contentType.getMimeType());
+ }
+
private String getUseridFromRequest(HttpServletRequest request) {
String userIdHeader = request.getHeader("USER_ID");