diff options
Diffstat (limited to 'catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/SSLProxyServlet.java')
-rw-r--r-- | catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/SSLProxyServlet.java | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/SSLProxyServlet.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/SSLProxyServlet.java index ffed2dde8c..182d198013 100644 --- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/SSLProxyServlet.java +++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/servlets/SSLProxyServlet.java @@ -21,8 +21,6 @@ package org.openecomp.sdc.fe.servlets; import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.client.api.Request; -import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.proxy.ProxyServlet; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.openecomp.sdc.common.api.Constants; @@ -33,34 +31,31 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import java.util.Enumeration; public abstract class SSLProxyServlet extends ProxyServlet { private static final long serialVersionUID = 1L; private static Logger log = LoggerFactory.getLogger(SSLProxyServlet.class.getName()); - - - @Override - public void customizeProxyRequest(Request proxyRequest, HttpServletRequest request) { - super.customizeProxyRequest(proxyRequest, request); - // Add Missing Headers to proxy request - @SuppressWarnings("unchecked") - Enumeration<String> headerNames = request.getHeaderNames(); - while (headerNames.hasMoreElements()) { - String headerName = headerNames.nextElement(); - if (!proxyRequest.getHeaders().containsKey(headerName)) { - String headerVal = request.getHeader(headerName); - log.debug("Adding missing header to request, header name: {} , header value: {}", headerName, - headerVal); - proxyRequest.header(headerName, headerVal); - } - } - proxyRequest.getHeaders().remove(HttpHeader.HOST); - - } + //TODO If no problems will arise remove in next merge + /*@Override + protected void sendProxyRequest(HttpServletRequest clientRequest, HttpServletResponse proxyResponse, Request proxyRequest) { + // Add Missing Headers to proxy request + @SuppressWarnings("unchecked") + Enumeration<String> headerNames = clientRequest.getHeaderNames(); + while (headerNames.hasMoreElements()) { + String headerName = headerNames.nextElement(); + if (!proxyRequest.getHeaders().containsKey(headerName)) { + String headerVal = clientRequest.getHeader(headerName); + log.debug("Adding missing header to request, header name: {} , header value: {}", headerName, + headerVal); + proxyRequest.header(headerName, headerVal); + } + } + proxyRequest.getHeaders().remove(HttpHeader.HOST); + + super.sendProxyRequest(clientRequest, proxyResponse, proxyRequest); + }*/ @Override protected HttpClient createHttpClient() throws ServletException { @@ -88,10 +83,11 @@ public abstract class SSLProxyServlet extends ProxyServlet { // Start HttpClient try { httpClient.start(); - - return httpClient; } catch (Exception x) { + log.error("Exception thrown while starting httpClient {}", x); throw new ServletException(x); } + + return httpClient; } } |