The DefaultCorsPolicy NuGet package provides a simple and efficient way to enable Cross-Origin Resource Sharing (CORS) in your .NET applications. This package is designed to allow all incoming requests from different origins, making it ideal for development environments or applications where origin restrictions are not a concern.
- Allows any header.
- Permits any method (GET, POST, PUT, DELETE, etc.).
- Supports credentials in cross-origin requests.
- Sets the policy to allow requests from any origin.
To install the DefaultCorsPolicy package, you can use the NuGet Package Manager console in Visual Studio:
Install-Package Nlabs.DefaultCorsPolicy
Or use the .NET CLI:
dotnet add package Nlabs.DefaultCorsPolicy
To use the Nlabs.DefaultCorsPolicy in your .NET application:
builder.Services.AddDefaultCors();
...
...
app.UseCors();