/// <summary>
        /// Adds the Report-To header.
        /// </summary>
        /// <param name="optionsAction">A delegate used for setting up the <see cref="ReportGroupOptions"/></param>
        /// <remarks>
        /// See: https://www.w3.org/TR/CSP/#directive-report-to
        /// See: https://w3c.github.io/reporting/#group
        /// </remarks>
        public void AddReportingGroup(Action <ReportGroupOptions> optionsAction)
        {
            ReportGroupOptions rg = new ReportGroupOptions();

            optionsAction(rg);
            reportGroup = rg;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds a Report-To header and sets the report-to parameter of the Public-Key-Pins header.
        /// </summary>
        /// <param name="optionsAction">A delegate used for setting up the <see cref="ReportGroupOptions"/>.</param>
        public HpkpOptionsBuilder AddReportingGroup(Action <ReportGroupOptions> optionsAction)
        {
            ReportGroupOptions rg = new ReportGroupOptions();

            optionsAction(rg);
            options.ReportingGroup = rg;
            return(this);
        }