Changed IsDocker check (#1998)

* Refactored IsDocker to be completely static and changed to use an environment variable instead.

* Removed file from another branch
This commit is contained in:
Joe Milazzo 2023-05-15 17:57:57 -05:00 committed by GitHub
parent 57a6c769bc
commit be5b5d9251
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 20 additions and 77 deletions

View file

@ -113,7 +113,7 @@ public static class Configuration
private static void SetPort(string filePath, int port)
{
if (new OsInfo(Array.Empty<IOsVersionAdapter>()).IsDocker)
if (OsInfo.IsDocker)
{
return;
}
@ -135,7 +135,7 @@ public static class Configuration
private static int GetPort(string filePath)
{
const int defaultPort = 5000;
if (new OsInfo(Array.Empty<IOsVersionAdapter>()).IsDocker)
if (OsInfo.IsDocker)
{
return defaultPort;
}
@ -165,7 +165,7 @@ public static class Configuration
private static void SetIpAddresses(string filePath, string ipAddresses)
{
if (new OsInfo(Array.Empty<IOsVersionAdapter>()).IsDocker)
if (OsInfo.IsDocker)
{
return;
}
@ -186,7 +186,7 @@ public static class Configuration
private static string GetIpAddresses(string filePath)
{
if (new OsInfo(Array.Empty<IOsVersionAdapter>()).IsDocker)
if (OsInfo.IsDocker)
{
return string.Empty;
}
@ -276,7 +276,7 @@ public static class Configuration
#region XFrameOrigins
private static string GetXFrameOptions(string filePath)
{
if (new OsInfo(Array.Empty<IOsVersionAdapter>()).IsDocker)
if (OsInfo.IsDocker)
{
return DefaultBaseUrl;
}