Example #1
0
 public function testGetServerProtocolBehindLoadBalancers()
 {
     $this->config->expects($this->once())->method('getSystemValue')->with('overwriteprotocol')->will($this->returnValue(''));
     $request = new Request(['server' => ['HTTP_X_FORWARDED_PROTO' => 'https,http,http']], $this->secureRandom, $this->getMock('\\OCP\\Security\\ICrypto'), $this->config, $this->stream);
     $this->assertSame('https', $request->getServerProtocol());
 }
 public function testGetServerProtocolDefault()
 {
     $this->config->expects($this->once())->method('getSystemValue')->with('overwriteprotocol')->will($this->returnValue(''));
     $request = new Request([], $this->secureRandom, $this->config, $this->stream);
     $this->assertSame('http', $request->getServerProtocol());
 }