setProxyVars() публичный статический Метод

public static setProxyVars ( $proxyVars )
$proxyVars bool Whether to use `X-Forwarded-*` headers to determine port/domain/protocol
Пример #1
0
 /**
  * @covers OneLogin_Saml2_Utils::getSelfPort
  */
 public function testGetselfPort()
 {
     $this->assertNull(OneLogin_Saml2_Utils::getSelfPort());
     $_SERVER['HTTP_HOST'] = 'example.org:ok';
     $this->assertNull(OneLogin_Saml2_Utils::getSelfPort());
     $_SERVER['HTTP_HOST'] = 'example.org:8080';
     $this->assertEquals(8080, OneLogin_Saml2_Utils::getSelfPort());
     $_SERVER["SERVER_PORT"] = 80;
     $this->assertEquals(80, OneLogin_Saml2_Utils::getSelfPort());
     $_SERVER["HTTP_X_FORWARDED_PORT"] = 443;
     $this->assertEquals(80, OneLogin_Saml2_Utils::getSelfPort());
     OneLogin_Saml2_Utils::setProxyVars(true);
     $this->assertEquals(443, OneLogin_Saml2_Utils::getSelfPort());
     OneLogin_Saml2_Utils::setSelfPort(8080);
     $this->assertEquals(8080, OneLogin_Saml2_Utils::getSelfPort());
 }