feat: trusproxies
This commit is contained in:
@@ -15,6 +15,7 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
health: '/up',
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware): void {
|
||||
$middleware->trustProxies(at: '*');
|
||||
$middleware->prepend(\App\Http\Middleware\SetLocale::class);
|
||||
$middleware->alias([
|
||||
'verified' => \App\Http\Middleware\EnsureEmailIsVerified::class,
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
it('generates secure Filament asset URLs behind the production proxy', function () {
|
||||
$response = $this
|
||||
->withServerVariables(['REMOTE_ADDR' => '10.0.0.2'])
|
||||
->withHeaders([
|
||||
'X-Forwarded-Host' => 'dailyapi.leonmorival.xyz',
|
||||
'X-Forwarded-Port' => '443',
|
||||
'X-Forwarded-Proto' => 'https',
|
||||
])
|
||||
->get('/dashboard/login');
|
||||
|
||||
$response
|
||||
->assertOk()
|
||||
->assertSee(
|
||||
'href="https://dailyapi.leonmorival.xyz/build/assets/',
|
||||
escape: false,
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user