Class CspUnsafeInlineSourceDirectiveBuilder<TSourceDirective, TBuilder>
Represents all directive builders that configures ContentSecurityPolicyUnsafeInlineSourceDirective.
Inheritance
CspDirectiveBuilder<TSourceDirective>
CspSourceDirectiveBuilder<TSourceDirective, TBuilder>
CspUnsafeInlineSourceDirectiveBuilder<TSourceDirective, TBuilder>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: IRM.AspNetCore.Http.Headers.Builder
Assembly: IRM.AspNetCore.Mvc.dll
Syntax
public abstract class CspUnsafeInlineSourceDirectiveBuilder<TSourceDirective, TBuilder> : CspSourceDirectiveBuilder<TSourceDirective, TBuilder> where TSourceDirective : ContentSecurityPolicyUnsafeInlineSourceDirective, new()
where TBuilder : CspUnsafeInlineSourceDirectiveBuilder<TSourceDirective, TBuilder>
Type Parameters
TSourceDirective
The type of directive that the implementation is building. |
TBuilder
The actual implementation of this abstract class. |
Methods
AddNonce()
Generates a random nonce for each request and adds it to the CSP header. Allows inline scripts/styles that have the nonce attribute set to the random value on the script/style element.
Declaration
public TBuilder AddNonce()
Returns
TBuilder
The builder for futher configuration. |
AllowUnsafeInline()
Allow inline scripts. If you have an XSS vulnerability, this will allow them to execute. Cannot be enabled together with AddNonce.
Declaration
public TBuilder AllowUnsafeInline()
Returns
TBuilder
The builder for futher configuration. |