Let's try to restore https://github.com/flarum/core/pull/2236/files. For the initial implementation, we can keep the Arr::get($request->getServerParams(), 'REMOTE_ADDR', '127.0.0.1'); implementation currently present in post / discussion code; we can add a more rigorous system in the future. We can also inject config into the middleware constructor directly, so no need for a singleton definition
This also centralizes IP processing, so that we don't need to retrieve it in 20 different places. It would also then become available to throttling middleware.
Let's try to restore https://github.com/flarum/core/pull/2236/files. For the initial implementation, we can keep the
Arr::get($request->getServerParams(), 'REMOTE_ADDR', '127.0.0.1');
implementation currently present in post / discussion code; we can add a more rigorous system in the future. We can also inject config into the middleware constructor directly, so no need for a singleton definitionThis also centralizes IP processing, so that we don't need to retrieve it in 20 different places. It would also then become available to throttling middleware.