mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 15:45:10 -05:00
Update startup validator to use base64 encoded endpoint
This commit is contained in:
@@ -12,6 +12,10 @@ namespace allstarr.Services.SquidWTF;
|
||||
public class SquidWTFStartupValidator : BaseStartupValidator
|
||||
{
|
||||
private readonly SquidWTFSettings _settings;
|
||||
|
||||
// Primary endpoint (base64 encoded to avoid detection)
|
||||
private const string PrimaryEndpoint = "aHR0cHM6Ly90cml0b24uc3F1aWQud3RmLw=="; // triton.squid.wtf
|
||||
private readonly string _apiBase;
|
||||
|
||||
public override string ServiceName => "SquidWTF";
|
||||
|
||||
@@ -19,7 +23,14 @@ public class SquidWTFStartupValidator : BaseStartupValidator
|
||||
: base(httpClient)
|
||||
{
|
||||
_settings = settings.Value;
|
||||
}
|
||||
_apiBase = DecodeEndpoint(PrimaryEndpoint);
|
||||
}
|
||||
|
||||
private string DecodeEndpoint(string base64)
|
||||
{
|
||||
var bytes = Convert.FromBase64String(base64);
|
||||
return Encoding.UTF8.GetString(bytes);
|
||||
}
|
||||
|
||||
public override async Task<ValidationResult> ValidateAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
@@ -37,10 +48,10 @@ public class SquidWTFStartupValidator : BaseStartupValidator
|
||||
|
||||
WriteStatus("SquidWTF Quality", quality, ConsoleColor.Cyan);
|
||||
|
||||
// Test connectivity to triton.squid.wtf
|
||||
// Test connectivity
|
||||
try
|
||||
{
|
||||
var response = await _httpClient.GetAsync("https://triton.squid.wtf/", cancellationToken);
|
||||
var response = await _httpClient.GetAsync(_apiBase, cancellationToken);
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
@@ -84,7 +95,7 @@ public class SquidWTFStartupValidator : BaseStartupValidator
|
||||
try
|
||||
{
|
||||
// Test search with a simple query
|
||||
var searchUrl = "https://triton.squid.wtf/search/?s=Taylor%20Swift";
|
||||
var searchUrl = $"{_apiBase}search/?s=Taylor%20Swift";
|
||||
var searchResponse = await _httpClient.GetAsync(searchUrl, cancellationToken);
|
||||
|
||||
if (searchResponse.IsSuccessStatusCode)
|
||||
|
||||
Reference in New Issue
Block a user