diff --git a/app/Http/Controllers/Server/UniProxyController.php b/app/Http/Controllers/Server/UniProxyController.php index 1680fdf9..2a14b6fa 100644 --- a/app/Http/Controllers/Server/UniProxyController.php +++ b/app/Http/Controllers/Server/UniProxyController.php @@ -112,7 +112,9 @@ class UniProxyController extends Controller 'push_interval' => config('v2board.server_push_interval', 60), 'pull_interval' => config('v2board.server_pull_interval', 60) ]; - $response['routes'] = $this->serverService->getRoutes($this->nodeInfo['route_id']); + if ($this->nodeInfo['route_id']) { + $response['routes'] = $this->serverService->getRoutes($this->nodeInfo['route_id']); + } $eTag = sha1(json_encode($response)); if (strpos($request->header('If-None-Match'), $eTag) !== false ) { abort(304); diff --git a/app/Services/ServerService.php b/app/Services/ServerService.php index a89222e6..ccad403a 100644 --- a/app/Services/ServerService.php +++ b/app/Services/ServerService.php @@ -218,7 +218,7 @@ class ServerService return $servers; } - public function getRoutes($routeIds) + public function getRoutes(array $routeIds) { return ServerRoute::select(['id', 'match', 'action', 'action_value'])->whereIn('id', $routeIds)->get(); }