File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff 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 */
You can’t perform that action at this time.
0 commit comments