mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Added more headers to inspect while looking for the remote IP address
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user