laravel-timezone icon indicating copy to clipboard operation
laravel-timezone copied to clipboard

Take the first found IP from 'lookup' config key

Open boryn opened this issue 3 years ago • 0 comments

At this moment, if IP is not found, the loop skips but eventually the last resolved IP is taken.

IMHO it should be the first IP grabbed, for example I'd like to get real user IP from cloudflare using this code:

'lookup' => [
        'server' => [
            'HTTP_CF_CONNECTING_IP',
            'REMOTE_ADDR',
        ],
        'headers' => [

        ],
    ],

Now, I need to use 'HTTP_CF_CONNECTING_IP' as the last option which is not intuitive, and we unnecessarily loop through all the items.

Solves: https://github.com/jamesmills/laravel-timezone/issues/78

boryn avatar Jan 18 '22 09:01 boryn