Package com.skava.orchestration.strategy
Class HeaderSanitization
java.lang.Object
com.skava.orchestration.strategy.HeaderSanitization
- All Implemented Interfaces:
jakarta.servlet.Filter
@WebFilter("/*")
@Component
public class HeaderSanitization
extends Object
implements jakarta.servlet.Filter
Clean up the headers that are returned to a HTTP client by a Camel route.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckProtocol(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response) Checks if the request uses the HTTPS protocol and if the protocol is supported.voiddestroy()Destroy.voiddoFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) Do filter.voidinit(jakarta.servlet.FilterConfig filterConfig) Inits the.static StringStrips any potential XSS threats out of the value excluding the white listed HTML.
-
Field Details
-
DEFAULT_LOCALE
The Constant DEFAULT_LOCALE.- See Also:
-
KEY_LOCALE
locale keyword.- See Also:
-
-
Constructor Details
-
HeaderSanitization
public HeaderSanitization()
-
-
Method Details
-
init
public void init(jakarta.servlet.FilterConfig filterConfig) throws jakarta.servlet.ServletException Inits the.- Specified by:
initin interfacejakarta.servlet.Filter- Parameters:
filterConfig- the filter config- Throws:
jakarta.servlet.ServletException- the servlet exception
-
doFilter
public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException Do filter.- Specified by:
doFilterin interfacejakarta.servlet.Filter- Parameters:
request- the requestresponse- the responsechain- the chain- Throws:
IOException- Signals that an I/O exception has occurred.jakarta.servlet.ServletException- the servlet exception
-
checkProtocol
public void checkProtocol(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response) throws IOException Checks if the request uses the HTTPS protocol and if the protocol is supported.- Parameters:
request- the HttpServletRequest objectresponse- the HttpServletResponse object- Throws:
IOException- if an input or output exception occurs
-
destroy
public void destroy()Destroy.- Specified by:
destroyin interfacejakarta.servlet.Filter
-
stripXSS
Strips any potential XSS threats out of the value excluding the white listed HTML.- Parameters:
value- Indicates a string value for encoding.- Returns:
- Returns the the ESAPI library value to avoid encoded attacks.
-