фикс для https соединения

This commit is contained in:
2026-03-14 00:52:00 +04:00
parent 20351b17dd
commit 5a346a312d
2 changed files with 16 additions and 0 deletions
+2
View File
@@ -11,6 +11,8 @@ return Application::configure(basePath: dirname(__DIR__))
health: '/up',
)
->withMiddleware(function (Middleware $middleware): void {
$middleware->trustProxies(at: env('TRUSTED_PROXIES', '*'));
$middleware->alias([
'gamemaster' => \App\Http\Middleware\EnsureGameMaster::class,
]);
+14
View File
@@ -14,4 +14,18 @@ class LandingPageTest extends TestCase
$response->assertSee('Создать игровой аккаунт');
$response->assertSee(config('moonwell.realm.server_name'));
}
public function test_landing_page_uses_https_assets_behind_proxy(): void
{
$response = $this->withServerVariables([
'HTTP_X_FORWARDED_PROTO' => 'https',
'HTTP_X_FORWARDED_HOST' => 'moon-well.online',
'HTTP_X_FORWARDED_PORT' => 443,
'HTTP_HOST' => 'moon-well.online',
'REMOTE_ADDR' => '127.0.0.1',
])->get(route('landing.index'));
$response->assertOk();
$response->assertSee('href="https://moon-well.online/site.css"', false);
}
}