for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* PAYONE Magento 2 Connector is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PAYONE Magento 2 Connector is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License
* along with PAYONE Magento 2 Connector. If not, see <http://www.gnu.org/licenses/>.
* PHP version 5
* @category Payone
* @package Payone_Magento2_Plugin
* @author FATCHIP GmbH <[email protected]>
* @copyright 2003 - 2016 Payone GmbH
* @license <http://www.gnu.org/licenses/> GNU Lesser General Public License
* @link http://www.payone.de
*/
namespace Payone\Core\Model\Environment;
use Magento\Framework\HTTP\PhpEnvironment\RemoteAddress as CoreRemoteAddress;
* Extended RemoteAddress class
class RemoteAddress extends CoreRemoteAddress
{
* Add X-Forwarded-For header to IP address determination
* @return void
public function useHttpXForwarded()
if (array_key_exists('x-forwarded-for', $this->alternativeHeaders) === false) {
$this->alternativeHeaders['x-forwarded-for'] = 'HTTP_X_FORWARDED_FOR';
}