summaryrefslogtreecommitdiffstats
path: root/catalog-fe/src/main/java/org
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-07-20 01:29:49 +0300
committerMichael Lando <ml636r@att.com>2017-07-20 01:30:06 +0300
commit3c3c833897dbfc0e85feaf36086a505f990ecb76 (patch)
tree8c308fbe7298aa65066ba0fc8a71e51d20d8e0de /catalog-fe/src/main/java/org
parent30db4407bab8cfea48e278d29e55b11c6c0a528c (diff)
[SDC] 1710 rebase + pom modifications
Change-Id: I1f9c0a5201576c7a6b124f6a786db12c1a8cd7c0 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-fe/src/main/java/org')
-rw-r--r--catalog-fe/src/main/java/org/openecomp/sdc/fe/GzipFilter.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/GzipFilter.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/GzipFilter.java
new file mode 100644
index 0000000000..884e688503
--- /dev/null
+++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/GzipFilter.java
@@ -0,0 +1,40 @@
+package org.openecomp.sdc.fe;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletResponse;
+
+public class GzipFilter implements Filter {
+
+ @Override
+ public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
+ throws IOException,
+ ServletException {
+
+
+ final HttpServletResponse httpResponse = (HttpServletResponse) response;
+
+
+ httpResponse.setHeader("Content-Encoding", "gzip");
+ httpResponse.setHeader("Content-Type", "application/javascript");
+ chain.doFilter(request, response);
+ }
+
+ @Override
+ public void init(FilterConfig filterConfig) throws ServletException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void destroy() {
+ // TODO Auto-generated method stub
+
+ }
+} \ No newline at end of file