AdvantageCMS.Core.Common.BaseClasses Namespace
Build With Advantage

AdvantageApiCorsPolicyProviderBase..::..GetCorsPolicyAsync Method

Returns the CORS policy that applies to the supplied request. Implementations typically build the policy from site-settings or the domain's allow-origin list.

Namespace:  AdvantageCSP.API
Assembly:  AdvantageCSP.API (in AdvantageCSP.API.dll)

Syntax


public Task<CorsPolicy> GetCorsPolicyAsync(
	HttpRequestMessage request,
	CancellationToken cancellationToken
)

Parameters

request
Type: HttpRequestMessage
The current WebAPI request.
cancellationToken
Type: CancellationToken
Token to observe for cancellation while the policy is computed.

Return Value

A task that resolves to the CorsPolicy applied to the request.