def site_protected_against_xss_by_csp(response, allow_unsafe_inline=False, allow_unsafe_eval=False):
 protected = True
 if (not provides_csp_features(response)):
  protected = False
 else:
  vulns = find_vulns(response)
  if (CSP_DIRECTIVE_SCRIPT in vulns):
   protected = False
  else:
   if ((not allow_unsafe_inline) and unsafe_inline_enabled(response)):
    protected = False
   if ((not allow_unsafe_eval) and unsafe_eval_enabled(response)):
    protected = False
 return protected

def site_protected_against_xss_by_csp ( response , allow_unsafe_inline = False , allow_unsafe_eval = False ) : protected = True if ( not provides_csp_features ( response ) ) : protected = False else : vulns = find_vulns ( response ) if ( CSP_DIRECTIVE_SCRIPT in vulns ) : protected = False else : if ( ( not allow_unsafe_inline ) and unsafe_inline_enabled ( response ) ) : protected = False if ( ( not allow_unsafe_eval ) and unsafe_eval_enabled ( response ) ) : protected = False return protected
method to analyze if a site is protected against xss vulns type using csp policies .