From d343e5bd9b65118a0488edc1a3eb564b9df50721 Mon Sep 17 00:00:00 2001 From: Takayasu Oyama Date: Sun, 1 Sep 2024 08:33:16 +0900 Subject: [PATCH] [11.x] Restore Request::HEADER_X_FORWARDED_PREFIX in TrustProxies (#52598) * [11.x] Restore Request::HEADER_X_FORWARDED_PREFIX in TrustProxies * fix test --- src/Illuminate/Http/Middleware/TrustProxies.php | 1 + tests/Foundation/Configuration/MiddlewareTest.php | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Illuminate/Http/Middleware/TrustProxies.php b/src/Illuminate/Http/Middleware/TrustProxies.php index 4b7b0f62b9b1..0d3c747ba6d3 100644 --- a/src/Illuminate/Http/Middleware/TrustProxies.php +++ b/src/Illuminate/Http/Middleware/TrustProxies.php @@ -23,6 +23,7 @@ class TrustProxies Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | + Request::HEADER_X_FORWARDED_PREFIX | Request::HEADER_X_FORWARDED_AWS_ELB; /** diff --git a/tests/Foundation/Configuration/MiddlewareTest.php b/tests/Foundation/Configuration/MiddlewareTest.php index 8fde56c7a9c1..d4ede8561a05 100644 --- a/tests/Foundation/Configuration/MiddlewareTest.php +++ b/tests/Foundation/Configuration/MiddlewareTest.php @@ -178,6 +178,7 @@ public function testTrustHeaders() Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | + Request::HEADER_X_FORWARDED_PREFIX | Request::HEADER_X_FORWARDED_AWS_ELB, $method->invoke($middleware)); $property->setValue($middleware, Request::HEADER_X_FORWARDED_AWS_ELB);