Class CspNonceInjectionOptions
Options for CSP nonce injection middleware.
Inheritance
object
Namespace: Umbraco.Cms.Web.Common.ApplicationBuilder
Assembly: Umbraco.Web.Common.dll
Syntax
public class CspNonceInjectionOptions
Constructors
View SourceCspNonceInjectionOptions()
Declaration
public CspNonceInjectionOptions()
Properties
View SourceDirective
Gets or sets the CSP directive to inject the nonce into. Defaults to "script-src".
Declaration
public string Directive { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
HeaderNames
Gets or sets the CSP header names to modify. Defaults to both "Content-Security-Policy" and "Content-Security-Policy-Report-Only".
Declaration
public string[] HeaderNames { get; set; }
Property Value
| Type | Description |
|---|---|
| string[] |
ShouldApplyToRequest
Gets or sets a function that determines whether the nonce should be injected for a given request. Defaults to injecting for all requests.
Declaration
public Func<HttpContext, bool> ShouldApplyToRequest { get; set; }
Property Value
| Type | Description |
|---|---|
| Func<HttpContext, bool> |