CorsService Class

Definition

Default implementation of ICorsService.

C#
public class CorsService : Microsoft.AspNetCore.Cors.Infrastructure.ICorsService
Inheritance
CorsService
Implements

Constructors

CorsService(IOptions<CorsOptions>, ILoggerFactory)

Creates a new instance of the CorsService.

CorsService(IOptions<CorsOptions>)
Obsolete.

Creates a new instance of the CorsService.

Methods

ApplyResult(CorsResult, HttpResponse)

Adds CORS-specific response headers to the given response.

EvaluatePolicy(HttpContext, CorsPolicy)

Evaluates the given policy using the passed in context.

EvaluatePolicy(HttpContext, String)

Looks up a policy using the policyName and then evaluates the policy using the passed in context.

EvaluatePreflightRequest(HttpContext, CorsPolicy, CorsResult)

Evaluate a preflight request using the specified policy. The result is set on the specified CorsResult instance.

EvaluateRequest(HttpContext, CorsPolicy, CorsResult)

Evaluate a request using the specified policy. The result is set on the specified CorsResult instance.

Applies to

Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0