示例#1
0
 public static ContentSecurityPolicyHeader AddDirective(this ContentSecurityPolicyHeader header, ManifestSourceDirective directive)
 {
     return(header.AddDirective(directive));
 }
示例#2
0
 public static ContentSecurityPolicyHeader AddDefaultContentSecurityPolicyDirectives(this ContentSecurityPolicyHeader header)
 {
     return(header
            .AddDirective(new DefaultSourceDirective(Constants.NoneKeyword))
            .AddDirective(new ScriptSourceDirective(Constants.SelfKeyword))
            .AddDirective(new ConnectSourceDirective(Constants.SelfKeyword))
            .AddDirective(new ImageSourceDirective(Constants.SelfKeyword))
            .AddDirective(new StyleSourceDirective(Constants.SelfKeyword)));
 }
示例#3
0
 public static ContentSecurityPolicyHeader AddDirective(this ContentSecurityPolicyHeader header, FormActionDirective directive)
 {
     return(header.AddDirective(directive));
 }
示例#4
0
 public static ContentSecurityPolicyHeader AddDirective(this ContentSecurityPolicyHeader header, FrameAncestorsDirective directive)
 {
     return(header.AddDirective(directive));
 }
示例#5
0
 public static ContentSecurityPolicyHeader AddScriptNonce(this ContentSecurityPolicyHeader header, Func <string> nonce)
 {
     return(header.AddDirective(new NonceDirective(nonce)));
 }
示例#6
0
 public static ContentSecurityPolicyHeader AddScriptSha256(this ContentSecurityPolicyHeader header, Func <string> sha)
 {
     return(header.AddDirective(new Sha256Directive(sha)));
 }
示例#7
0
 public static ContentSecurityPolicyHeader AllowUnsafeEvalScripts(this ContentSecurityPolicyHeader header)
 {
     return(header.AddDirective(new ScriptSourceDirective(Constants.UnsafeEvalKeyword)));
 }
示例#8
0
 public static ContentSecurityPolicyHeader SetStrictDynamic(this ContentSecurityPolicyHeader header)
 {
     return(header.AddDirective(new ScriptSourceDirective(Constants.StrictDynamicKeyword)));
 }
示例#9
0
 public static ContentSecurityPolicyHeader AllowUnsafeInlineStyles(this ContentSecurityPolicyHeader header)
 {
     return(header.AddDirective(new StyleSourceDirective(Constants.UnsafeInlineKeyword)));
 }
示例#10
0
 public static ContentSecurityPolicyHeader UpgradeInsecureRequests(this ContentSecurityPolicyHeader header)
 {
     return(header.AddDirective(new UpgradeInsecureRequestsDirective()));
 }
示例#11
0
 public static ContentSecurityPolicyHeader AllowManifestSources(this ContentSecurityPolicyHeader header, params string[] sources)
 {
     return(header.AddDirective(new ManifestSourceDirective(sources)));
 }
示例#12
0
 public static ContentSecurityPolicyHeader AllowFrameAncestors(this ContentSecurityPolicyHeader header, params string[] sources)
 {
     return(header.AddDirective(new FrameAncestorsDirective(sources)));
 }
示例#13
0
 public static ContentSecurityPolicyHeader SetBaseUris(this ContentSecurityPolicyHeader header, params string[] uris)
 {
     return(header.AddDirective(new BaseUriDirective(uris)));
 }