I saw a mudcrab the other day. Horrible creatures

This commit is contained in:
Chris Adamson
2025-05-28 13:47:13 -05:00
parent 7f82fdbe1f
commit 173fc6b8a9
2 changed files with 34 additions and 1 deletions
@@ -54,6 +54,28 @@ public class HttpServerHelper(ConfigServer configServer)
return $"wss://{BuildUrl()}";
}
/// <summary>
/// Method to determine if another version of the server is already running
/// </summary>
/// <returns>bool isAlreadyRunning</returns>
public async Task<bool> IsAlreadyRunning()
{
try
{
var handler = new HttpClientHandler()
{
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
};
var http = new HttpClient(handler);
var res = await http.PostAsync($"{GetBackendUrl()}/launcher/ping", null);
return res.IsSuccessStatusCode;
}
catch (Exception )
{
return false;
}
}
public void SendTextJson(HttpResponse resp, object output)
{
resp.Headers.Append("Content-Type", mime["json"]);