/// <summary>
 /// Appends a new Content Security Policy to the existing policy, and returns the updated policy.
 /// </summary>
 /// <param name="policy">The policy.</param>
 /// <returns></returns>
 public ContentSecurityPolicy AppendPolicy(ContentSecurityPolicy policy)
 {
     if (policy != null)
     {
         this.ParsePolicy(policy.ToString());
     }
     return(this);
 }
Example #2
0
 private static void UpdateHeaders(HttpHeaders responseHeaders, ContentSecurityPolicy policy)
 {
     responseHeaders.Remove("Content-Security-Policy");
     responseHeaders.Add("Content-Security-Policy", policy.ToString());
 }
Example #3
0
 /// <summary>
 /// Appends a Content Security Policy to the existing policy.
 /// </summary>
 /// <param name="policy">The policy.</param>
 /// <returns></returns>
 public ContentSecurityPolicyHeaders AppendPolicy(ContentSecurityPolicy policy)
 {
     _policy.AppendPolicy(policy.ToString());
     return(this);
 }
Example #4
0
 private static void UpdateHeaders(NameValueCollection responseHeaders, ContentSecurityPolicy policy)
 {
     responseHeaders.Remove("Content-Security-Policy");
     responseHeaders.Add("Content-Security-Policy", policy.ToString());
 }