Class CorsModule
Cross-origin resource sharing (CORS) control Module. CORS is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the resource originated.
Inherited Members
Namespace: EmbedIO.Cors
Syntax
public class CorsModule : WebModuleBase, IWebModuleImpl, IWebModuleConstructors
CorsModule(String, String, String, String)
Initializes a new instance of the CorsModule class.
Declaration
public CorsModule(string baseRoute, string origins = "*", string headers = "*", string methods = "*")Parameters
| Type | Name | Description | 
|---|---|---|
| String | baseRoute | The base route. | 
| String | origins | The valid origins. The default is All ( | 
| String | headers | The valid headers. The default is All ( | 
| String | methods | The valid methods. The default is All ( | 
Fields
All
A string meaning "All" in CORS headers.
Declaration
public const string All = "*"Field Value
| Type | Description | 
|---|---|
| String | 
Properties
IsFinalHandler
Gets a value indicating whether processing of a request should stop after a module has handled it.
Declaration
public override bool IsFinalHandler { get; }Property Value
| Type | Description | 
|---|---|
| Boolean | 
Overrides
Remarks
If this property is true, a HTTP context's
SetHandled() method will be automatically called
immediately after after the 
See Also
Methods
OnRequestAsync(IHttpContext)
Called to handle a request from a client.
Declaration
protected override Task OnRequestAsync(IHttpContext context)Parameters
| Type | Name | Description | 
|---|---|---|
| IHttpContext | context | The context of the request being handled. | 
Returns
| Type | Description | 
|---|---|
| Task | A  | 
