def retrieve_csp_report_uri(response):
 uri_set = set()
 non_report_only_policies = retrieve_csp_policies(response)
 report_only_policies = retrieve_csp_policies(response, True)
 policies_all = merge_policies_dict(non_report_only_policies, report_only_policies)
 if (len(policies_all) > 0):
  for directive_name in policies_all:
   if (directive_name.lower() != CSP_DIRECTIVE_REPORT_URI):
    continue
   for directive_value in policies_all[directive_name]:
    uri = directive_value.strip().lower()
    uri_set.add(uri)
 return uri_set

def retrieve_csp_report_uri ( response ) : uri_set = set ( ) non_report_only_policies = retrieve_csp_policies ( response ) report_only_policies = retrieve_csp_policies ( response , True ) policies_all = merge_policies_dict ( non_report_only_policies , report_only_policies ) if ( len ( policies_all ) > 0 ) : for directive_name in policies_all : if ( directive_name . lower ( ) != CSP_DIRECTIVE_REPORT_URI ) : continue for directive_value in policies_all [ directive_name ] : uri = directive_value . strip ( ) . lower ( ) uri_set . add ( uri ) return uri_set
method to retrieve all report uri from csp policies specified into a http response through csp headers .