Added more headers to inspect while looking for the remote IP address

This commit is contained in:
Alejandro Celaya
2019-08-01 18:27:43 +02:00
parent 6682b52159
commit 9cb316bdfa
3 changed files with 73 additions and 4 deletions

View File

@@ -23,6 +23,8 @@ class IpAddressMiddlewareFactory implements FactoryInterface
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null): IpAddress
{
return new IpAddress(true, [], Visitor::REMOTE_ADDRESS_ATTR);
$config = $container->get('config');
$headersToInspect = $config['ip_address_resolution']['headers_to_inspect'] ?? [];
return new IpAddress(true, [], Visitor::REMOTE_ADDRESS_ATTR, $headersToInspect);
}
}