Add tests to cover new server_url behavior
This commit is contained in:
parent
b80315e238
commit
0b51ea7251
1 changed files with 28 additions and 0 deletions
|
@ -38,6 +38,34 @@ public function testHttpsScheme()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detect a Proxy that sets Forwarded-Host
|
||||||
|
*/
|
||||||
|
public function testHttpsProxyForwardedHost()
|
||||||
|
{
|
||||||
|
$this->assertEquals(
|
||||||
|
'https://host.tld:8080',
|
||||||
|
server_url(
|
||||||
|
array(
|
||||||
|
'HTTP_X_FORWARDED_PROTO' => 'https',
|
||||||
|
'HTTP_X_FORWARDED_PORT' => '8080',
|
||||||
|
'HTTP_X_FORWARDED_HOST' => 'host.tld'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertEquals(
|
||||||
|
'https://host.tld:4974',
|
||||||
|
server_url(
|
||||||
|
array(
|
||||||
|
'HTTP_X_FORWARDED_PROTO' => 'https, https',
|
||||||
|
'HTTP_X_FORWARDED_PORT' => '4974, 80',
|
||||||
|
'HTTP_X_FORWARDED_HOST' => 'host.tld, example.com'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detect a Proxy with SSL enabled
|
* Detect a Proxy with SSL enabled
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue