Skip to content

Commit

Permalink
Merge pull request #3 from cloudflare/jwineman/PI-580-restore-origina…
Browse files Browse the repository at this point in the history
…l-ip

Magento will now use CF-CONNECTING-IP header as the REMOTE_ADDR if it…
  • Loading branch information
jwineman authored Jul 1, 2016
2 parents 0c68302 + a20ad8e commit 2afc9ae
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions etc/di.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<!-- Restore original visitor IP from CloudFlare header -->
<type name="Magento\Framework\HTTP\PhpEnvironment\RemoteAddress">
<arguments>
<argument name="alternativeHeaders" xsi:type="array">
<item name="http_cf_connecting_ip" xsi:type="string">HTTP_CF_CONNECTING_IP</item>
</argument>
</arguments>
</type>
</config>

0 comments on commit 2afc9ae

Please sign in to comment.