CorsPolicyBuilder Class

Definition

Exposes methods to build a policy.

public ref class CorsPolicyBuilder
public class CorsPolicyBuilder
type CorsPolicyBuilder = class
Public Class CorsPolicyBuilder
Inheritance
CorsPolicyBuilder

Constructors

CorsPolicyBuilder(CorsPolicy)

Creates a new instance of the CorsPolicyBuilder.

CorsPolicyBuilder(String[])

Creates a new instance of the CorsPolicyBuilder.

Methods

AllowAnyHeader()

Ensures that the policy allows any header.

AllowAnyMethod()

Ensures that the policy allows any method.

AllowAnyOrigin()

Ensures that the policy allows any origin.

AllowCredentials()

Sets the policy to allow credentials.

Build()

Builds a new CorsPolicy using the entries added.

DisallowCredentials()

Sets the policy to not allow credentials.

SetIsOriginAllowed(Func<String,Boolean>)

Sets the specified isOriginAllowed for the underlying policy.

SetIsOriginAllowedToAllowWildcardSubdomains()

Sets the IsOriginAllowed property of the policy to be a function that allows origins to match a configured wildcarded domain when evaluating if the origin is allowed.

SetPreflightMaxAge(TimeSpan)

Sets the preflightMaxAge for the underlying policy.

WithExposedHeaders(String[])

Adds the specified exposedHeaders to the policy.

WithHeaders(String[])

Adds the specified headers to the policy.

WithMethods(String[])

Adds the specified methods to the policy.

WithOrigins(String[])

Adds the specified origins to the policy.

Applies to