#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.Reviews 3
History 37
-
Stephan Großberndt changed subject
Improve description of $GLOBALS['TYPO3_CONF_VARS']['SYS']['reverseProxyHeaderMultiValue']Wrong description of $GLOBALS['TYPO3_CONF_VARS']['SYS']['reverseProxyHeaderMultiValue'] 02/21/25, 13:00 -
Gerrit Code Review pushed patch set 1 for main to change 88308 status
NewUnder Review 02/21/25, 13:06 -
Gerrit Code Review pushed patch set 2 for main to change 88308 03/07/25, 09:18
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 88553 03/10/25, 12:08
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 88554 03/10/25, 12:08
-
Stephan Großberndt commented and changed status
Under ReviewResolved done0 %100 % 03/10/25, 12:10 -
Benni Mack changed status
ResolvedClosed 12/02/25, 14:22
Applied in changeset commit:d57ff9a84c1eb99c83cab5f69de1aef5bd4eac7a.