#106226Wrong description of $GLOBALS['TYPO3_CONF_VARS']['SYS']['reverseProxyHeaderMultiValue']
Description
The description currently states
description: 'Defines which values of a proxy header (eg HTTP_X_FORWARDED_FOR) to use, if more than one is found.'
but “if more than one is found” was never true – since the initial commit ‘Fix bug #7397: improper handling of non-transparent reverse proxies’ by Martin Kutschker in 2008 always reverseProxyHeaderMultiValue had to be set to first or last in order for the value of the proxy header to be used, even if HTTP_X_FORWARDED_FOR only contains one IP:
$ip = t3lib_div::trimExplode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
// choose which IP in list to use
if (count($ip)) {
switch ($GLOBALS['TYPO3_CONF_VARS']['SYS']['reverseProxyHeaderMultiValue']) {
case 'last':
$ip = array_pop($ip);
break;
case 'first':
$ip = array_unshift($ip);
break;
case 'none':
default:
$ip = '';
break;
}
}
There is a TODO by @lolli in NormalizedParams::determineHttpHost()
// Default if reverseProxyHeaderMultiValue is not set or set to 'none', instead of 'first' / 'last' is to
// ignore $serverParams['HTTP_X_FORWARDED_HOST']
// @todo: Maybe this default is stupid: Both SYS/reverseProxyIP hand SYS/reverseProxyHeaderMultiValue have to
// @todo: be configured for a working setup. It would be easier to only configure SYS/reverseProxyIP and fall
// @todo: back to "first" if SYS/reverseProxyHeaderMultiValue is not set.