Skip to content

Commit 873ec61

Browse files
authored
Merge pull request #354 from gdebrauwer/stateful-domain-config-option
Api stateful domains config option
2 parents eeb391b + b6193e1 commit 873ec61

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

config/log-viewer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@
8888
\Opcodes\LogViewer\Http\Middleware\AuthorizeLogViewer::class,
8989
],
9090

91+
'api_stateful_domains' => env('LOG_VIEWER_API_STATEFUL_DOMAINS') ? explode(',', env('LOG_VIEWER_API_STATEFUL_DOMAINS')) : null,
92+
9193
/*
9294
|--------------------------------------------------------------------------
9395
| Log Viewer Remote hosts.

src/Http/Middleware/EnsureFrontendRequestsAreStateful.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static function fromFrontend($request)
7070
$domain = Str::replaceFirst('http://', '', $domain);
7171
$domain = Str::endsWith($domain, '/') ? $domain : "{$domain}/";
7272

73-
$stateful = array_filter(config('sanctum.stateful', self::defaultStatefulDomains()));
73+
$stateful = array_filter(config('log-viewer.api_stateful_domains') ?? config('sanctum.stateful') ?? self::defaultStatefulDomains());
7474

7575
return Str::is(Collection::make($stateful)->map(function ($uri) {
7676
return trim($uri).'/*';

0 commit comments

Comments
 (0)