Skip to content

Commit

Permalink
Check for HTTP 200 when checking deploy mirrors
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaboxer committed Oct 11, 2023
1 parent 197429d commit ea806fc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Bloxstrap/RobloxDeployment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static class RobloxDeployment
{
"https://setup.rbxcdn.com",
"https://setup-ak.rbxcdn.com",
"https://roblox-setup.cachefly.net",
"https://s3.amazonaws.com/setup.roblox.com"
};

Expand All @@ -32,7 +33,11 @@ public static string BaseUrl

try
{
App.HttpClient.GetAsync($"{attemptedUrl}/version").Wait();
var response = App.HttpClient.GetAsync($"{attemptedUrl}/version").Result;

if (!response.IsSuccessStatusCode)
throw new HttpResponseException(response);

App.Logger.WriteLine(LOG_IDENT, "Connection successful!");
_baseUrl = attemptedUrl;
break;
Expand All @@ -46,7 +51,7 @@ public static string BaseUrl
}

if (string.IsNullOrEmpty(_baseUrl))
throw new Exception("Unable to find an accessible Roblox deploy mirror!");
throw new Exception("Could not find an accessible Roblox deployment mirror, likely due to a bad internet connection. Please launch again.");
}

return _baseUrl;
Expand Down

0 comments on commit ea806fc

Please sign in to comment.