Check for HTTP 200 when checking deploy mirrors

This commit is contained in:
pizzaboxer 2023-10-11 08:44:48 +01:00
parent 197429dbf9
commit ea806fcd8e
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8

View File

@ -12,6 +12,7 @@
{ {
"https://setup.rbxcdn.com", "https://setup.rbxcdn.com",
"https://setup-ak.rbxcdn.com", "https://setup-ak.rbxcdn.com",
"https://roblox-setup.cachefly.net",
"https://s3.amazonaws.com/setup.roblox.com" "https://s3.amazonaws.com/setup.roblox.com"
}; };
@ -32,7 +33,11 @@
try 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!"); App.Logger.WriteLine(LOG_IDENT, "Connection successful!");
_baseUrl = attemptedUrl; _baseUrl = attemptedUrl;
break; break;
@ -46,7 +51,7 @@
} }
if (string.IsNullOrEmpty(_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; return _baseUrl;