Skip to content

Commit d325a10

Browse files
authored
Merge pull request #1448 from hydephp/dashboard-internals-cleanup
Minor dashboard internals cleanup
2 parents cd9add2 + 4acd0f1 commit d325a10

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/realtime-compiler/src/Http/DashboardController.php

+8-4
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ class DashboardController
3939

4040
protected Request $request;
4141
protected ConsoleOutput $console;
42-
protected bool $isAsync = false;
42+
protected JsonResponse $response;
4343

44+
protected bool $isAsync = false;
4445
protected array $flashes = [];
4546

4647
protected static array $tips = [
@@ -51,8 +52,6 @@ class DashboardController
5152
'The dashboard update your project files. You can disable this by setting `server.dashboard.interactive` to `false` in `config/hyde.php`.',
5253
];
5354

54-
protected JsonResponse $response;
55-
5655
public function __construct()
5756
{
5857
$this->title = config('hyde.name').' - Dashboard';
@@ -62,7 +61,7 @@ public function __construct()
6261
$this->loadFlashData();
6362

6463
if ($this->request->method === 'POST') {
65-
$this->isAsync = (getallheaders()['X-RC-Handler'] ?? getallheaders()['x-rc-handler'] ?? null) === 'Async';
64+
$this->isAsync = $this->hasAsyncHeaders();
6665
}
6766
}
6867

@@ -506,4 +505,9 @@ protected function matchStatusCode(int $statusCode): string
506505
default => 'Internal Server Error',
507506
};
508507
}
508+
509+
protected function hasAsyncHeaders(): bool
510+
{
511+
return (getallheaders()['X-RC-Handler'] ?? getallheaders()['x-rc-handler'] ?? null) === 'Async';
512+
}
509513
}

0 commit comments

Comments
 (0)