From dfbbb1f954e91c1ebbcac81cadef4f706fb0787e Mon Sep 17 00:00:00 2001 From: UnicodingUnicorn <7555ic@gmail.com> Date: Thu, 29 Aug 2019 22:08:26 +0800 Subject: [PATCH] fixes --- src/UniversalDashboard/Server/ServerStartup.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/UniversalDashboard/Server/ServerStartup.cs b/src/UniversalDashboard/Server/ServerStartup.cs index 09984112..c5e72c7a 100644 --- a/src/UniversalDashboard/Server/ServerStartup.cs +++ b/src/UniversalDashboard/Server/ServerStartup.cs @@ -121,9 +121,11 @@ public void Configure(IApplicationBuilder app, Microsoft.AspNetCore.Hosting.IHos ContentTypeProvider = provider }); - app.UseHttpsRedirection(); + var dashboardService = app.ApplicationServices.GetService(typeof(IDashboardService)) as IDashboardService; - var dashboardService = app.ApplicationServices.GetService(typeof(IDashboardService)) as IDashboardService; + if (dashboardService?.DashboardOptions?.Certificate != null || dashboardService?.DashboardOptions?.CertificateFile != null) { + app.UseHttpsRedirection(); + } if (dashboardService?.DashboardOptions?.PublishedFolders != null) { foreach(var publishedFolder in dashboardService.DashboardOptions.PublishedFolders) {