summaryrefslogtreecommitdiffstats
path: root/catalog-fe
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2020-04-21 14:01:21 +0100
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-04-21 17:37:18 +0000
commitc27b98e43b407a9b6ef1394b63d6fa9f5fc1f615 (patch)
tree90e087dc13cf99878787ae67b3e67550311f923e /catalog-fe
parent2c61d810b631a073ca42f75624fe190ac4f49ea4 (diff)
Fix 404 in sdc-FE calls to workflow
Fixes webpack workflow proxy configuration. Fixes FE proxy while rewriting URLs to workflow plugin. Fixes compilation problems to run locally the catalog-ui. Change-Id: I89f3f46bd8ce0159713b1d0d957a2e75f8a3d062 Issue-ID: SDC-2943 Signed-off-by: andre.schmid <andre.schmid@est.tech> (cherry picked from commit ac26dc0d5c5f7fce65e214c31e26e7178e492d5b)
Diffstat (limited to 'catalog-fe')
-rw-r--r--catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeProxyServlet.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeProxyServlet.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeProxyServlet.java
index 3ea660abbe..8f76cb95ab 100644
--- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeProxyServlet.java
+++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/FeProxyServlet.java
@@ -46,7 +46,7 @@ import static org.apache.commons.lang3.StringUtils.isEmpty;
public class FeProxyServlet extends SSLProxyServlet {
private static final long serialVersionUID = 1L;
- private static final String URL = "%s://%s%s";
+ private static final String URL = "%s://%s%s%s";
private static final String MS_URL = "%s://%s:%s";
private static final String ONBOARDING_CONTEXT = "/onboarding-api";
private static final String DCAED_CONTEXT = "/dcae-api";
@@ -134,6 +134,7 @@ public class FeProxyServlet extends SSLProxyServlet {
String protocol;
String host;
String port;
+ String path = "";
if (uri.contains(ONBOARDING_CONTEXT)){
uri = uri.replace(SDC1_FE_PROXY+ONBOARDING_CONTEXT,ONBOARDING_CONTEXT);
protocol = config.getOnboarding().getProtocolBe();
@@ -160,6 +161,7 @@ public class FeProxyServlet extends SSLProxyServlet {
java.net.URL workflowURL = new URL(workflowPluginURL);
protocol = workflowURL.getProtocol();
host = workflowURL.getHost();
+ path = workflowURL.getPath();
port = String.valueOf(workflowURL.getPort());
}
else{
@@ -173,15 +175,15 @@ public class FeProxyServlet extends SSLProxyServlet {
}
}
- String authority = getAuthority(host, port);
- String modifiedUrl = String.format(URL,protocol,authority,uri);
- if( !StringUtils.isEmpty(queryString)){
+ final String authority = getAuthority(host, port);
+ String modifiedUrl = String.format(URL, protocol, authority, path, uri);
+ if (StringUtils.isNotEmpty(queryString)) {
modifiedUrl += "?" + queryString;
}
- return modifiedUrl;
-
+ return modifiedUrl;
}
+
@VisibleForTesting
String redirectMsRequestToMservice(HttpServletRequest request, Configuration config) throws MalformedURLException {
@@ -299,11 +301,10 @@ private PluginsConfiguration getPluginConfiguration(HttpServletRequest request)
private String getAuthority(String host, String port) {
String authority;
- if (port==null){
- authority=host;
- }
- else{
- authority=host+":"+port;
+ if (port == null) {
+ authority = host;
+ } else {
+ authority = host + ":" + port;
}
return authority;
}