fix: sub link types not working

This commit is contained in:
xboard 2025-07-22 01:33:59 +08:00
parent abd549c3e2
commit 89ed4a54d9

View File

@ -45,7 +45,7 @@ class ClientController extends Controller
if (!$userService->isAvailable($user)) {
HookManager::call('client.subscribe.unavailable');
return response('', 200, ['Content-Type' => 'text/plain']);
return response('', 403, ['Content-Type' => 'text/plain']);
}
return $this->doSubscribe($request, $user);
@ -125,7 +125,7 @@ class ClientController extends Controller
{
return collect($servers)->filter(function ($server) use ($allowedTypes, $filterKeywords) {
// Condition 1: Server type must be in the list of allowed types
if (!in_array($server['type'], $allowedTypes)) {
if ($allowedTypes && !in_array($server['type'], $allowedTypes)) {
return false; // Filter out (don't keep)
}