I’ve integrated akrabat/rka-ip-address-middleware into my project, but I can’t get it work. Maybe someone here knows what I’m doing wrong. My middleware integration code looks like this:
$checkProxyHeaders = true;
$trustedProxies = [];
$app->add (new RKA\Middleware\IpAddress($checkProxyHeaders, $trustedProxies));
$app->add (function ($request, $response, $next) use ($app) {
$container = $app->getContainer();
$settings = $container->get('settings');
$ipClient = $request->getAttribute('ip_address');
// Do something with $ipClient here ...
$response = $next($request, $response);
return $response;
});
The problem I’m having that $ipClient is always returned as null. I’m guessing I’m making some stupid mistake, but I’m just not seeing it. Thanks for any hints & tips.