Skip to content

Commit e574998

Browse files
committed
Proof of double port concat
1 parent 48f98cf commit e574998

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/src/OneLogin/Saml2/UtilsTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,21 @@ public function testisHTTPS()
335335
$this->assertFalse(OneLogin_Saml2_Utils::isHTTPS());
336336
}
337337

338+
/**
339+
* @covers OneLogin_Saml2_Utils::getSelfURLhost()
340+
*/
341+
public function testGetselfurlhostdoubleport()
342+
{
343+
OneLogin_Saml2_Utils::setProxyVars(true);
344+
$_SERVER['HTTP_HOST'] = 'example.com:8080';
345+
$_SERVER['HTTP_X_FORWARDED_PORT'] = 82;
346+
$this->assertEquals('http://example.com:82', OneLogin_Saml2_Utils::getSelfURLhost());
347+
348+
$_SERVER['HTTP_HOST'] = 'example.com:ok';
349+
$_SERVER['HTTP_X_FORWARDED_PORT'] = 82;
350+
$this->assertEquals('http://example.com:82', OneLogin_Saml2_Utils::getSelfURLhost());
351+
}
352+
338353
/**
339354
* @covers OneLogin_Saml2_Utils::getSelfPort()
340355
*/

0 commit comments

Comments
 (0)