KestrunSecurityMiddlewareExtensions.AddCorsDefaultPolicy method (1 of 2)

Adds a default CORS policy to the application using the specified configuration delegate.

public static KestrunHost AddCorsDefaultPolicy(this KestrunHost host, 
    Action<CorsPolicyBuilder> buildPolicy)
parameter description
host The KestrunHost instance to configure.
buildPolicy An action to configure the CORS policy.

Return Value

The current KestrunHost instance.

See Also


KestrunSecurityMiddlewareExtensions.AddCorsDefaultPolicy method (2 of 2)

Adds a default CORS policy to the application using the specified CorsPolicyBuilder.

public static KestrunHost AddCorsDefaultPolicy(this KestrunHost host, CorsPolicyBuilder builder)
parameter description
host The KestrunHost instance to configure.
builder The CORS policy builder to use for the default policy.

Return Value

The current KestrunHost instance.

See Also