class ContentSecurityPolicyFilter implements Filter
{
    private final SystemProperty<Boolean> statusProperty;
    private final SystemProperty<String> valueProperty;

    public ContentSecurityPolicyFilter(@Nonnull final SystemProperty<Boolean> statusProperty, @Nonnull final SystemProperty<String> valueProperty)
    {
        this.statusProperty = statusProperty;
        this.valueProperty = valueProperty;
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
    {<FILL_FUNCTION_BODY>}
}

        if (response instanceof HttpServletResponse && statusProperty.getValue()) {
            final String value = valueProperty.getValue();
            if (value != null && !value.trim().isEmpty()) {
                ((HttpServletResponse) response).setHeader("Content-Security-Policy", value);
            }
        }
        chain.doFilter(request, response);
    
<no_super_class>