Beispiel #1
0
    /// <summary>
    /// Construct a new CspHeader
    /// </summary>
    /// <param name="options">The CspOptions to configure the header with</param>
    public CspHeader(CspOptions options)
    {
        options.EnsureNotNull(nameof(options));

        Key   = $"Content-Security-Policy{(options.IsReportOnly ? "-Report-Only" : string.Empty)}";
        Value = string.Concat(options.Directives);
    }