コード例 #1
0
 /// <summary>
 /// Specifies the value for the <c>X-XSS-Protection</c> header.
 /// </summary>
 /// <param name="builder">
 /// The builder being used to configure the response headers.
 /// </param>
 /// <param name="value">The <c>X-XSS-Protection</c> header value.</param>
 /// <returns>
 /// A reference to <paramref name="builder"/> with the specified XSS
 /// protection value.
 /// </returns>
 public static ResponseHeadersOptionsBuilder AddXssProtection(this ResponseHeadersOptionsBuilder builder, string value)
 {
     return(builder.Add("X-XSS-Protection", value));
 }
コード例 #2
0
 /// <summary>
 /// Specifies the value for the <c>X-Frame-Options</c> header.
 /// </summary>
 /// <param name="builder">
 /// The builder being used to configure the response headers.
 /// </param>
 /// <param name="value">The <c>X-Frame-Options</c> header value.</param>
 /// <returns>
 /// A reference to <paramref name="builder"/> with the specified frame
 /// options value.
 /// </returns>
 public static ResponseHeadersOptionsBuilder AddFrameOptions(this ResponseHeadersOptionsBuilder builder, string value)
 => builder.Add("X-Frame-Options", value);
コード例 #3
0
 /// <summary>
 /// Specifies a policy that determines when the <c>Referer</c> header is sent.
 /// </summary>
 /// <param name="builder">
 /// The builder being used to configure the response headers.
 /// </param>
 /// <param name="referrerPolicy">
 /// A value that specifies the algorithm used to populate the
 /// <c>Referer</c> header.
 /// </param>
 /// <returns>
 /// A reference to <paramref name="builder"/> with the specified Referrer Policy.
 /// </returns>
 public static ResponseHeadersOptionsBuilder AddReferrerPolicy(this ResponseHeadersOptionsBuilder builder, ReferrerPolicy referrerPolicy)
 {
     return(builder.Add("Referrer-Policy", referrerPolicy.ToString()));
 }