CorsPolicyBuilder Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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 |
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 |
WithHeaders(String[]) |
Adds the specified |
WithMethods(String[]) |
Adds the specified |
WithOrigins(String[]) |
Adds the specified |