CorsService.EvaluatePolicy 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
EvaluatePolicy(HttpContext, CorsPolicy) |
使用传入 |
EvaluatePolicy(HttpContext, String) |
使用 查找策略, |
EvaluatePolicy(HttpContext, CorsPolicy)
- Source:
- CorsService.cs
- Source:
- CorsService.cs
- Source:
- CorsService.cs
使用传入context
的 计算给定policy
的 。
public:
virtual Microsoft::AspNetCore::Cors::Infrastructure::CorsResult ^ EvaluatePolicy(Microsoft::AspNetCore::Http::HttpContext ^ context, Microsoft::AspNetCore::Cors::Infrastructure::CorsPolicy ^ policy);
public Microsoft.AspNetCore.Cors.Infrastructure.CorsResult EvaluatePolicy (Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy policy);
abstract member EvaluatePolicy : Microsoft.AspNetCore.Http.HttpContext * Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy -> Microsoft.AspNetCore.Cors.Infrastructure.CorsResult
override this.EvaluatePolicy : Microsoft.AspNetCore.Http.HttpContext * Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicy -> Microsoft.AspNetCore.Cors.Infrastructure.CorsResult
Public Function EvaluatePolicy (context As HttpContext, policy As CorsPolicy) As CorsResult
参数
- context
- HttpContext
与 HttpContext 调用关联的 。
- policy
- CorsPolicy
CorsPolicy需要评估的 。
返回
一个 CorsResult ,它包含策略评估的结果,可供调用方用来设置适当的响应标头。
实现
适用于
EvaluatePolicy(HttpContext, String)
- Source:
- CorsService.cs
- Source:
- CorsService.cs
- Source:
- CorsService.cs
使用 查找策略, policyName
然后使用传入 context
的 评估策略。
public:
Microsoft::AspNetCore::Cors::Infrastructure::CorsResult ^ EvaluatePolicy(Microsoft::AspNetCore::Http::HttpContext ^ context, System::String ^ policyName);
public Microsoft.AspNetCore.Cors.Infrastructure.CorsResult EvaluatePolicy (Microsoft.AspNetCore.Http.HttpContext context, string policyName);
member this.EvaluatePolicy : Microsoft.AspNetCore.Http.HttpContext * string -> Microsoft.AspNetCore.Cors.Infrastructure.CorsResult
Public Function EvaluatePolicy (context As HttpContext, policyName As String) As CorsResult
参数
- context
- HttpContext
- policyName
- String
返回
一个 CorsResult ,它包含策略评估的结果,可供调用方用来设置适当的响应标头。