{
// reset
Request::setTrustedProxies(array(), -1);
+ Request::setTrustedHosts(array());
}
public function testInitialize()
$request->headers->set('host', 'subdomain.trusted.com');
$this->assertEquals('subdomain.trusted.com', $request->getHost());
+ }
- // reset request for following tests
- Request::setTrustedHosts(array());
+ public function testSetTrustedHostsDoesNotBreakOnSpecialCharacters()
+ {
+ Request::setTrustedHosts(array('localhost(\.local){0,1}#,example.com', 'localhost'));
+
+ $request = Request::create('/');
+ $request->headers->set('host', 'localhost');
+ $this->assertSame('localhost', $request->getHost());
}
public function testFactory()