Update Startup.cs

This commit is contained in:
JustArchi
2020-05-23 17:55:23 +02:00
parent 832ceb8827
commit a658bfcbde

View File

@@ -135,7 +135,9 @@ namespace ArchiSteamFarm.IPC {
services.AddResponseCompression();
// Add CORS to allow userscripts and third-party apps
services.AddCors(options => options.AddDefaultPolicy(policyBuilder => policyBuilder.AllowAnyOrigin()));
if (!string.IsNullOrEmpty(ASF.GlobalConfig.IPCPassword)) {
services.AddCors(options => options.AddDefaultPolicy(policyBuilder => policyBuilder.AllowAnyOrigin()));
}
// Add swagger documentation generation
services.AddSwaggerGen(