Fixes : support multi reverse proxy with comma syntax

Going through multiple reverse proxy will store multiple scheme and port in HTTP header separated by a comma. Shaarli will use the first one to generate server_url.
This commit is contained in:
ArthurHoaro 2016-02-28 16:24:18 +01:00
parent 8710d4da8e
commit 85244fa0d0
2 changed files with 25 additions and 2 deletions
tests/HttpUtils

View file

@ -67,6 +67,19 @@ class ServerUrlTest extends PHPUnit_Framework_TestCase
)
)
);
$this->assertEquals(
'https://host.tld:4974',
server_url(
array(
'HTTPS' => 'Off',
'SERVER_NAME' => 'host.tld',
'SERVER_PORT' => '80',
'HTTP_X_FORWARDED_PROTO' => 'https, https',
'HTTP_X_FORWARDED_PORT' => '4974, 80'
)
)
);
}
/**