Closed PauloPhagula closed 8 years ago
$checkProxyHeaders = true;
$trustedProxies = ['10.0.0.1', '10.0.0.2'];
$app->add(new ThrottlingMiddleware());
$app->add(new RKA\Middleware\IpAddress($checkProxyHeaders, $trustedProxies));
Please read the docs http://www.slimframework.com/docs/concepts/middleware.html
According to the docs
The last middleware layer added is the first to be executed.
Thanks
I'm trying to setup a set middleware to mangle requests and response on my app and I've noticed that I don't have the
ip_address
set on middleware followingrka-ip-address-middleware
.More specifically I'm setting up a throttling middleware to limit requests per IP address per hour like bellow
Then middleware is added to the app like
Given the above I think IpAddress is supposed to run first and thus set the ip address on the request which is received by the next middleware in the queue.
Please clarify if the assumption above is correct or not, or provide advise on how I can handle this case.