public function ReverseProxyMiddlewareTest::testReverseProxyEnabled in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php \Drupal\Tests\Core\StackMiddleware\ReverseProxyMiddlewareTest::testReverseProxyEnabled()
- 10 core/tests/Drupal/Tests/Core/StackMiddleware/ReverseProxyMiddlewareTest.php \Drupal\Tests\Core\StackMiddleware\ReverseProxyMiddlewareTest::testReverseProxyEnabled()
Tests that subscriber sets trusted headers when reverse proxy is set.
@dataProvider reverseProxyEnabledProvider
File
- core/
tests/ Drupal/ Tests/ Core/ StackMiddleware/ ReverseProxyMiddlewareTest.php, line 53
Class
- ReverseProxyMiddlewareTest
- Unit test the reverse proxy stack middleware.
Namespace
Drupal\Tests\Core\StackMiddlewareCode
public function testReverseProxyEnabled($provided_settings, $expected_trusted_header_set) {
// Enable reverse proxy and add test values.
$settings = new Settings([
'reverse_proxy' => 1,
] + $provided_settings);
$this
->trustedHeadersAreSet($settings, $expected_trusted_header_set);
}