you should use ``$request->header-get(Request::getTrustedHeaderName(Request::HEADER_CLIENT_IP), '');`` instead to get the header. This way, it will handle the header properly to keep the name case-insensitive, whereas your code does not.