Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Update cors

KrzysztofPajake311c946bbbd
diff --git a/src/API/Grand.Api/Infrastructure/ODataStartup.cs b/src/API/Grand.Api/Infrastructure/ODataStartup.cs
index f7b9e8411..6f91bc607 100644
--- a/src/API/Grand.Api/Infrastructure/ODataStartup.cs
+++ b/src/API/Grand.Api/Infrastructure/ODataStartup.cs
@@ -44,9 +44,7 @@ namespace Grand.Api.Infrastructure
services.AddCors(options =>
{
options.AddPolicy(Configurations.CorsPolicyName,
- builder => builder.AllowAnyOrigin()
- .AllowAnyMethod()
- .AllowAnyHeader());
+ builder => builder.WithOrigins("*").AllowAnyMethod().AllowAnyHeader());
});
//Add OData
services.AddControllers().AddOData(opt =>