Skip to content

A self-hosted media server and file management system

Fix Trusted Proxy Defaults

aminnausin0ba9331ec5ba
diff --git a/.env.example b/.env.example
index 71b42f9f..c35ba0a9 100755
--- a/.env.example
+++ b/.env.example
@@ -94,3 +94,5 @@ VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
VITE_REVERB_HOST="${REVERB_HOST}"
VITE_REVERB_PORT="${REVERB_PORT}"
VITE_REVERB_SCHEME="${REVERB_SCHEME}"
+
+TRUSTED_PROXIES=*
diff --git a/bootstrap/app.php b/bootstrap/app.php
index a659fdfc..dd7e885c 100755
--- a/bootstrap/app.php
+++ b/bootstrap/app.php
@@ -20,8 +20,7 @@ return Application::configure(basePath: dirname(__DIR__))
)
->withMiddleware(function (Middleware $middleware) {
$middleware->trustProxies(
- at: env('TRUSTED_PROXIES') === '*' ? '*' : explode(',', env('TRUSTED_PROXIES', '192.168.1.1,
- 127.0.0.1', )),
+ at: env('TRUSTED_PROXIES') === '*' ? '*' : explode(',', env('TRUSTED_PROXIES', '192.168.1.1,127.0.0.1')),
headers: Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |