throw new IllegalArgumentException("Invalid " + CONFIG_CSRF_TYPE + " property: " + type);
}
}
private void addCrossOriginFilter(ContextHandler handler) throws ServletException {
FilterRegistration reg = handler.getServletContext().addFilter("CrossOriginFilter", CrossOriginFilter.class);
reg.addMappingForServletNames(null, false, "*");
reg.setInitParameter(CrossOriginFilter.ALLOWED_ORIGINS_PARAM,
configurationService.getProperty(CONFIG_XORIGIN_ORIGINS));
reg.setInitParameter(CrossOriginFilter.ALLOWED_METHODS_PARAM,
configurationService.getProperty(CONFIG_XORIGIN_METHODS));
reg.setInitParameter(CrossOriginFilter.ALLOWED_HEADERS_PARAM,
configurationService.getProperty(CONFIG_XORIGIN_HEADERS));
reg.setInitParameter(CrossOriginFilter.PREFLIGHT_MAX_AGE_PARAM,
configurationService.getProperty(CONFIG_XORIGIN_MAX_AGE));
reg.setInitParameter(CrossOriginFilter.ALLOW_CREDENTIALS_PARAM,
configurationService.getProperty(CONFIG_XORIGIN_CREDENTIALS));
}