@@ -39,8 +39,9 @@ class DashboardController
39
39
40
40
protected Request $ request ;
41
41
protected ConsoleOutput $ console ;
42
- protected bool $ isAsync = false ;
42
+ protected JsonResponse $ response ;
43
43
44
+ protected bool $ isAsync = false ;
44
45
protected array $ flashes = [];
45
46
46
47
protected static array $ tips = [
@@ -51,8 +52,6 @@ class DashboardController
51
52
'The dashboard update your project files. You can disable this by setting `server.dashboard.interactive` to `false` in `config/hyde.php`. ' ,
52
53
];
53
54
54
- protected JsonResponse $ response ;
55
-
56
55
public function __construct ()
57
56
{
58
57
$ this ->title = config ('hyde.name ' ).' - Dashboard ' ;
@@ -62,7 +61,7 @@ public function __construct()
62
61
$ this ->loadFlashData ();
63
62
64
63
if ($ this ->request ->method === 'POST ' ) {
65
- $ this ->isAsync = ( getallheaders ()[ ' X-RC-Handler ' ] ?? getallheaders ()[ ' x-rc-handler ' ] ?? null ) === ' Async ' ;
64
+ $ this ->isAsync = $ this -> hasAsyncHeaders () ;
66
65
}
67
66
}
68
67
@@ -506,4 +505,9 @@ protected function matchStatusCode(int $statusCode): string
506
505
default => 'Internal Server Error ' ,
507
506
};
508
507
}
508
+
509
+ protected function hasAsyncHeaders (): bool
510
+ {
511
+ return (getallheaders ()['X-RC-Handler ' ] ?? getallheaders ()['x-rc-handler ' ] ?? null ) === 'Async ' ;
512
+ }
509
513
}
0 commit comments