Class ReportUriDirective

java.lang.Object
org.htmlunit.csp.Directive
org.htmlunit.csp.directive.ReportUriDirective

public class ReportUriDirective extends Directive
Represents the (deprecated) report-uri CSP directive.

The report-uri directive specifies one or more URIs to which the user agent sends violation reports. It has been deprecated in favour of the report-to directive.

Duplicate URIs are permitted because they have actual semantic meaning: the report will be sent to the same endpoint multiple times (once per occurrence), per specification.

Author:
Salvation Team
See Also:
  • Constructor Details

    • ReportUriDirective

      public ReportUriDirective(List<String> values, Directive.DirectiveErrorConsumer errors)
      Parses a report-uri directive from the given list of URI values.

      At least one URI is required. Duplicate URIs produce an informational message (not an error) since they are semantically valid.

      Parameters:
      values - the raw string values (URIs) for this directive
      errors - consumer that receives parsing errors and warnings
  • Method Details

    • getUris

      public List<String> getUris()
      Returns an unmodifiable list of the report URIs specified in this directive.

      The list may contain duplicates, which have semantic meaning (the report is sent once per URI occurrence).

      Returns:
      the list of report URI strings