Skip to content

Commit 1dbe3b1

Browse files
authored
Merge pull request #21 from magefan/13905-cloudflare-compatibility
13905-cloudflare-compatibility
2 parents 9a70ecc + 65c65f3 commit 1dbe3b1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

etc/di.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,13 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
99
<preference for="Magefan\GeoIp\Api\IpToRegionRepositoryInterface" type="Magefan\GeoIp\Model\IpToRegionRepository" />
1010
<preference for="Magefan\GeoIp\Api\IpToCountryRepositoryInterface" type="Magefan\GeoIp\Model\IpToCountryRepository" />
11-
</config>
11+
12+
<type name="Magento\Framework\HTTP\PhpEnvironment\RemoteAddress">
13+
<arguments>
14+
<argument name="alternativeHeaders" xsi:type="array">
15+
<item name="x-client-ip" xsi:type="string">HTTP_X_REAL_IP</item>
16+
<item name="x-cf-connecting-ip" xsi:type="string">HTTP_CF_CONNECTING_IP</item>
17+
</argument>
18+
</arguments>
19+
</type>
20+
</config>

0 commit comments

Comments
 (0)