Merge pull request from Moonlight-Panel/FixIpBinding

Fixed ip binding
This commit is contained in:
Marcel Baumgartner 2023-09-10 03:13:31 +02:00 committed by GitHub
commit 48b12fde90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,8 +75,14 @@ public class Startup
await PostInit();
Logger.Info("Done. Going live now!");
if (!Uri.TryCreate(ConfigService.Get().Moonlight.AppUrl, UriKind.RelativeOrAbsolute, out Uri uri))
{
Logger.Fatal("Invalid app url");
return;
}
if(ConfigService.DebugMode)
if(ConfigService.DebugMode || uri.HostNameType == UriHostNameType.IPv4)
await WebApplication.RunAsync();
else
await WebApplication.RunAsync(ConfigService.Get().Moonlight.AppUrl);