Class DisableCorsAttribute
This class defines an attribute that can be applied to an action or a controller to disable CORS.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = false)]
public sealed class DisableCorsAttribute : Attribute, ICorsPolicyProvider
- Inheritance
-
DisableCorsAttribute
- Implements
- Inherited Members
Constructors
DisableCorsAttribute()
Initializes a new instance of the DisableCorsAttribute class.
public DisableCorsAttribute()
Methods
GetCorsPolicyAsync(HttpRequestMessage, CancellationToken)
Gets the CORS policy asynchronously.
public Task<CorsPolicy> GetCorsPolicyAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
request
HttpRequestMessageThe request.
cancellationToken
CancellationTokenThe cancellation token assigned for this task.
Returns
- Task<CorsPolicy>
The newly created task for this operation.