diff options
author | 2018-03-19 17:37:22 -0400 | |
---|---|---|
committer | 2018-03-19 17:37:22 -0400 | |
commit | a932df953215fa4fe25d0dee962291eaa64d1846 (patch) | |
tree | 5106087e4723b93d6d3690ad37f560f6a7257e31 /ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java | |
parent | dcdf1bb1838de59e16c63ab37b29fb913efe2f69 (diff) |
Effort to make portal resilient
Issue-ID: PORTAL-210
Includes music library that contatins session management
Change-Id: Icacab904e1f948068348fcc19cd77965cb5b446e
Signed-off-by: Lo, WEI-TING(wl849v) <wl849v@att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java')
-rw-r--r-- | ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java b/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java index aad01286..0a1f340d 100644 --- a/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java +++ b/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java @@ -44,6 +44,9 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; import javax.servlet.FilterChain; import javax.servlet.ReadListener; @@ -74,8 +77,25 @@ public class SecurityXssFilter extends OncePerRequestFilter { private ByteArrayOutputStream cachedBytes; + private Map parameter = new HashMap(); + + @SuppressWarnings("unchecked") public RequestWrapper(HttpServletRequest request) { super(request); + Enumeration<String> parameterNames = request.getParameterNames(); + while (parameterNames.hasMoreElements()) { + String paramName = parameterNames.nextElement(); + String paramValue = request.getParameter(paramName); + parameter.put(paramName,paramValue); + } + } + + @Override + public String getParameter(String name) { + if (parameter != null) { + return (String) parameter.get(name); + } + return null; } @Override |