SFERA.Helpers.WEB.CORS
1.2021.1
dotnet add package SFERA.Helpers.WEB.CORS --version 1.2021.1
NuGet\Install-Package SFERA.Helpers.WEB.CORS -Version 1.2021.1
<PackageReference Include="SFERA.Helpers.WEB.CORS" Version="1.2021.1" />
<PackageVersion Include="SFERA.Helpers.WEB.CORS" Version="1.2021.1" />
<PackageReference Include="SFERA.Helpers.WEB.CORS" />
paket add SFERA.Helpers.WEB.CORS --version 1.2021.1
#r "nuget: SFERA.Helpers.WEB.CORS, 1.2021.1"
#:package SFERA.Helpers.WEB.CORS@1.2021.1
#addin nuget:?package=SFERA.Helpers.WEB.CORS&version=1.2021.1
#tool nuget:?package=SFERA.Helpers.WEB.CORS&version=1.2021.1
Enables CORS in ASP.net Core WebAPI
If you have a JS client, which consumes your Net Core APIs passing JSON objects, you may need to enable CORS but CORS has a security mechanism.
This library, which is a middleware, helps you to accept calls skipping security checks, basically it allows any Origin and stuff like that.
Full credits to all contributors from here: https://stackoverflow.com/questions/44379560/how-to-enable-cors-in-asp-net-core-webapi
In order this middleware, just add the following line into your Startup.cs:
public void Configure(Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Hosting.IWebHostEnvironment env)
{
// Add this line at bottom of Configure routine
app.UseMiddleware(typeof(SFERA.Helpers.WEB.CORS.CorsMiddleware)); //used for managing CORS and allows Javascript remote calls
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- Microsoft.AspNetCore (>= 2.2.0)
- Microsoft.AspNetCore.Cors (>= 2.2.0)
-
net5.0
- Microsoft.AspNetCore (>= 2.2.0)
- Microsoft.AspNetCore.Cors (>= 2.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.2021.1 | 6,409 | 2/8/2021 |