CorsOptions.AddDefaultPolicy 方法

定义

重载

AddDefaultPolicy(CorsPolicy)

添加新策略并将其设置为默认值。

AddDefaultPolicy(Action<CorsPolicyBuilder>)

添加新策略并将其设置为默认值。

AddDefaultPolicy(CorsPolicy)

Source:
CorsOptions.cs
Source:
CorsOptions.cs
Source:
CorsOptions.cs

添加新策略并将其设置为默认值。

public:
 void AddDefaultPolicy(Microsoft::AspNetCore::Cors::Infrastructure::CorsPolicy ^ policy);
public void AddDefaultPolicy (Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy policy);
member this.AddDefaultPolicy : Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy -> unit
Public Sub AddDefaultPolicy (policy As CorsPolicy)

参数

policy
CorsPolicy

CorsPolicy 添加的策略。

适用于

AddDefaultPolicy(Action<CorsPolicyBuilder>)

Source:
CorsOptions.cs
Source:
CorsOptions.cs
Source:
CorsOptions.cs

添加新策略并将其设置为默认值。

public:
 void AddDefaultPolicy(Action<Microsoft::AspNetCore::Cors::Infrastructure::CorsPolicyBuilder ^> ^ configurePolicy);
public void AddDefaultPolicy (Action<Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder> configurePolicy);
member this.AddDefaultPolicy : Action<Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder> -> unit
Public Sub AddDefaultPolicy (configurePolicy As Action(Of CorsPolicyBuilder))

参数

configurePolicy
Action<CorsPolicyBuilder>

可以使用策略生成器生成策略的委托。

适用于