Skip to content

A free open source IT asset/license management system

Removed headers in trustedproxy config

snipe656263b9503b
diff --git a/config/trustedproxy.php b/config/trustedproxy.php
index 10b138f932..f25b5cb4ba 100644
--- a/config/trustedproxy.php
+++ b/config/trustedproxy.php
@@ -48,15 +48,21 @@ return [
// 'proxies' => '*',
/*
- * Which headers to use to detect proxy related data (For, Host, Proto, Port)
+ * Which headers to use to detect proxy-related data (For, Host, Proto, Port).
*
- * Options include:
+ * This key is intentionally not set here. app/Http/Middleware/TrustProxies.php
+ * already sets $headers on the middleware itself as a bitmask of the individual
+ * Illuminate\Http\Request::HEADER_X_FORWARDED_* constants (FOR, HOST, PORT,
+ * PROTO, AWS_ELB), which is what runtime uses. Prior versions of this file
+ * carried a commented-out example referencing HEADER_X_FORWARDED_ALL, but that
+ * constant was removed from Symfony (see symfony/symfony#38928) and uncommenting
+ * it produced a fatal "Undefined constant" error. See #6852.
*
- * - Illuminate\Http\Request::HEADER_X_FORWARDED_ALL (use all x-forwarded-* headers to establish trust)
- * - Illuminate\Http\Request::HEADER_FORWARDED (use the FORWARDED header to establish trust)
+ * If you need to change which forwarded headers are trusted, edit the $headers
+ * property on App\Http\Middleware\TrustProxies rather than adding a 'headers'
+ * key here.
*
* @link https://symfony.com/doc/current/deployment/proxies.html
*/
- // 'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL, //this is mostly handled already
];