From 5a346a312d326e860cb50e850f82756f98e8f3a2 Mon Sep 17 00:00:00 2001 From: sindoring Date: Sat, 14 Mar 2026 00:52:00 +0400 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20https=20=D1=81=D0=BE=D0=B5=D0=B4=D0=B8=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bootstrap/app.php | 2 ++ tests/Feature/LandingPageTest.php | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/bootstrap/app.php b/bootstrap/app.php index 1fbbc19..b6f3487 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -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, ]); diff --git a/tests/Feature/LandingPageTest.php b/tests/Feature/LandingPageTest.php index 73bd89d..c9deafc 100644 --- a/tests/Feature/LandingPageTest.php +++ b/tests/Feature/LandingPageTest.php @@ -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); + } }