Example #1
0
 public function testInsecureServerHostHttpFromForwardedHeaderStacked()
 {
     $request = new Request(['server' => ['SERVER_NAME' => 'from.server.name:8080', 'HTTP_HOST' => 'from.host.header:8080', 'HTTP_X_FORWARDED_HOST' => 'from.forwarded.host2:8080,another.one:9000']], $this->secureRandom, $this->getMock('\\OCP\\Security\\ICrypto'), $this->config, $this->stream);
     $this->assertEquals('from.forwarded.host2:8080', $request->getInsecureServerHost());
 }
Example #2
0
 public function testInsecureServerHostHttpFromForwardedHeaderStacked()
 {
     $request = new Request(['server' => ['SERVER_NAME' => 'from.server.name:8080', 'HTTP_HOST' => 'from.host.header:8080', 'HTTP_X_FORWARDED_HOST' => 'from.forwarded.host2:8080,another.one:9000']], $this->secureRandom, $this->config, $this->csrfTokenManager, $this->stream);
     $this->assertSame('from.forwarded.host2:8080', $request->getInsecureServerHost());
 }