@Override public void init(FilterConfig filterConfig) throws ServletException { String customHeader = filterConfig.getInitParameter(CUSTOM_HEADER_PARAM); if (customHeader != null) { headerName = customHeader; } String customMethodsToIgnore = filterConfig.getInitParameter(CUSTOM_METHODS_TO_IGNORE_PARAM); if (customMethodsToIgnore != null) { parseMethodsToIgnore(customMethodsToIgnore); } else { parseMethodsToIgnore(METHODS_TO_IGNORE_DEFAULT); } String agents = filterConfig.getInitParameter(BROWSER_USER_AGENT_PARAM); if (agents == null) { agents = BROWSER_USER_AGENTS_DEFAULT; } parseBrowserUserAgents(agents); LOG.info("Adding cross-site request forgery (CSRF) protection, " + "headerName = {}, methodsToIgnore = {}, browserUserAgents = {}", headerName, methodsToIgnore, browserUserAgents); }
@Override public void init(FilterConfig filterConfig) throws ServletException { String customHeader = filterConfig.getInitParameter(CUSTOM_HEADER_PARAM); if (customHeader != null) { headerName = customHeader; } String customMethodsToIgnore = filterConfig.getInitParameter(CUSTOM_METHODS_TO_IGNORE_PARAM); if (customMethodsToIgnore != null) { parseMethodsToIgnore(customMethodsToIgnore); } else { parseMethodsToIgnore(METHODS_TO_IGNORE_DEFAULT); } String agents = filterConfig.getInitParameter(BROWSER_USER_AGENT_PARAM); if (agents == null) { agents = BROWSER_USER_AGENTS_DEFAULT; } parseBrowserUserAgents(agents); LOG.info("Adding cross-site request forgery (CSRF) protection, " + "headerName = {}, methodsToIgnore = {}, browserUserAgents = {}", headerName, methodsToIgnore, browserUserAgents); }