コード例 #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)));
 }