appstract / laravel-opcache

Laravel Package for OPcache
MIT License
1.34k stars 119 forks source link

Check if Cloudflare header "CF-Connecting-IP" exists. #23

Closed hariesnurikhwan closed 7 years ago

hariesnurikhwan commented 7 years ago

This PR fixes artisan commands always returning 403 on sites behind Cloudflare.

It happened because $request->server('REMOTE_ADDR') always returning Cloudflare servers IPs, the fix is checking if the Cloudflare header "CF-Connecting-IP" exists and use it as request ip.