From ad0a46175e7efbbd5bdf952aacc69d8a7750b05a Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Thu, 27 Sep 2018 23:46:43 +0200 Subject: implemented rudemetary groups --- DSACore/Startup.cs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'DSACore/Startup.cs') diff --git a/DSACore/Startup.cs b/DSACore/Startup.cs index 0628151..c189436 100644 --- a/DSACore/Startup.cs +++ b/DSACore/Startup.cs @@ -26,12 +26,23 @@ namespace DSACore // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { + services.AddCors(options => options.AddPolicy("CorsPolicy", + builder => + { + builder.WithOrigins("https://dsa.truekuehli.de") + .WithHeaders("Access-Control-Allow-Origin") + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + })); + /* services.AddCors(options => { options.AddPolicy("AllowSpecificOrigin", - builder => builder.WithOrigins("https://console.firebase.google.com/project/heldenonline-4d828")); + builder => builder.AllowAnyMethod().AllowAnyHeader().AllowAnyOrigin().AllowCredentials()/*WithOrigins("https://dsa.truekuehli.de")#1#); }); +*/ services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddSignalR(); @@ -49,9 +60,13 @@ namespace DSACore app.UseHsts(); } + app.UseCors("CorsPolicy"); + app.UseSignalR(routes => { routes.MapHub("/chatHub"); }); - app.UseCors("AllowSpecificOrigin"); - app.UseHttpsRedirection(); + + + //app.UseCors("AllowSpecificOrigin"); + //app.UseHttpsRedirection(); app.UseMvc(); } } -- cgit v1.2.3-70-g09d2