CspViolationReportBody Class

The body of the reports of type csp-violation (https://w3c.github.io/webappsec-csp/#dictdef-cspviolationreportbody).

public sealed class CspViolationReportBody : ReportBody
Inheritance
ReportBody CspViolationReportBody

Properties

NameDescription
BlockedUrlGets the URL of the blocked resource, or a keyword (inline, eval...).
ColumnNumberGets the column of the script that caused the violation, or null when there is no source file.
DispositionGets the disposition of the violated policy.
DocumentUrlGets the URL of the document or worker whose policy is violated, without its credentials and its fragment.
EffectiveDirectiveGets the name of the directive whose enforcement caused the violation.
LineNumberGets the line of the script that caused the violation, or null when there is no source file.
OriginalPolicyGets the serialization of the violated policy.
ReferrerGets the referrer of the document whose policy is violated.
SampleGets the sample of the code or the value that caused the violation.
SourceFileGets the URL of the script that caused the violation, or null.
StatusCodeGets the HTTP status code of the response of the document or worker whose policy is violated.

BlockedUrl

Report.cs

Gets the URL of the blocked resource, or a keyword (inline, eval...).

public string? BlockedUrl { get; init; }

ColumnNumber

Report.cs

Gets the column of the script that caused the violation, or null when there is no source file.

public uint? ColumnNumber { get; init; }

Disposition

Report.cs

DocumentUrl

Report.cs

Gets the URL of the document or worker whose policy is violated, without its credentials and its fragment.

public string DocumentUrl { get; init; }

EffectiveDirective

Report.cs

Gets the name of the directive whose enforcement caused the violation.

public string EffectiveDirective { get; init; }

LineNumber

Report.cs

Gets the line of the script that caused the violation, or null when there is no source file.

public uint? LineNumber { get; init; }

OriginalPolicy

Report.cs

Gets the serialization of the violated policy.

public string OriginalPolicy { get; init; }

Referrer

Report.cs

Gets the referrer of the document whose policy is violated.

public string? Referrer { get; init; }

Sample

Report.cs

Gets the sample of the code or the value that caused the violation.

public string? Sample { get; init; }

SourceFile

Report.cs

Gets the URL of the script that caused the violation, or null.

public string? SourceFile { get; init; }

StatusCode

Report.cs

Gets the HTTP status code of the response of the document or worker whose policy is violated.

public ushort StatusCode { get; init; }