Skip to content

Commit dd66bae

Browse files
committed
Update Configure.Cors.cs
1 parent 587e051 commit dd66bae

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

MyApp/Configure.Cors.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,15 @@ public void Configure(IWebHostBuilder builder) => builder
1919
.SetPreflightMaxAge(TimeSpan.FromHours(1));
2020
});
2121
});
22+
services.AddTransient<IStartupFilter, StartupFilter>();
2223
});
24+
25+
public class StartupFilter : IStartupFilter
26+
{
27+
public Action<IApplicationBuilder> Configure(Action<IApplicationBuilder> next) => app =>
28+
{
29+
app.UseCors();
30+
next(app);
31+
};
32+
}
2333
}

0 commit comments

Comments
 (0)