d8-contrib-modules / cloudflare

Cloudflare Module for Drupal
16 stars 14 forks source link

Return the correct client IP #28

Closed victorcpereira closed 8 years ago

victorcpereira commented 9 years ago

Drupal has got the function Drupal::request()->getClientIp(). I made a class that behaves like the hook_boot. This class is called in every request. I added Cloudflare IPs in a trusted proxies list. This way, Drupal Core can return the client ip instead of CloudFlare IP.

aweingarten commented 9 years ago

@victorcpereira, really excited by this PR. I gave it a quick skim and left some feedback. I also noticed that the automated build failed on account of Drupal Code Sniffer errors.

See here: https://travis-ci.org/d8-contrib-modules/cloudflare/jobs/83010311

Let me know if you have time to address otherwise I should be able to over the weekend.

victorcpereira commented 9 years ago

@aweingarten Sorry for delay. I have time to address tomorrow evening and the weekend.

aweingarten commented 9 years ago

@victorcpereira, No worries :) Want to be as supportive as possible so we can get your work merged!

aweingarten commented 8 years ago

This functionality has been incorporated into the module!