コード例 #1
0
 /// <summary>
 /// Disables the check of the CORS origins. Be aware of this.
 /// Sonar exclussion added to allow development purposes.
 /// </summary>
 /// <param name="services"></param>
 private static void SetCorsAnyOriginAllowed(ref IServiceCollection services)
 {
     Devon4NetLogger.Warning("CORS Options set to allow any origin!. Please review it in production environments.");
     //enables CORS and httpoptions
     services.AddCors(options =>
     {
         options.AddPolicy("CorsPolicy", builder =>
         {
             builder.AllowAnyOrigin(); // NOSONAR
             builder.AllowAnyHeader();
             builder.AllowAnyMethod();
         });
     });
 }