refactor: Projektdateien migriert. Cloud-NuGet-Pakete durch lokale NuGet-Projekte ersetzt.
This commit is contained in:
24
HRD.WebApi/Helpers/CorsExtension.cs
Normal file
24
HRD.WebApi/Helpers/CorsExtension.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace HRD.WebApi.Helpers
|
||||
{
|
||||
public static class CorsExtension
|
||||
{
|
||||
public static void AddCustomCors(this IServiceCollection services, string policyName)
|
||||
{
|
||||
services.AddCors(options =>
|
||||
{
|
||||
options.AddPolicy(policyName,
|
||||
builder =>
|
||||
{
|
||||
builder
|
||||
.AllowCredentials()
|
||||
//.AllowAnyOrigin()
|
||||
.SetIsOriginAllowed(origin => true)
|
||||
.AllowAnyHeader()
|
||||
.AllowAnyMethod();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user