summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-02-25 02:51:46 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2015-02-25 02:51:46 -0800
commitbcf3704645c074be0fa2579eebdc363a2e379765 (patch)
treedb1b7031ca884e3538b1cabc4d397de8def8b51c /tests
parentaf96078153f385fd8a9f7f7e2b295aa01f8b0973 (diff)
parent9adcd15cb35ef4f02db073116dcce78c735cd292 (diff)
downloadnextcloud-server-bcf3704645c074be0fa2579eebdc363a2e379765.tar.gz
nextcloud-server-bcf3704645c074be0fa2579eebdc363a2e379765.zip
Merge pull request #14458 from owncloud/revive/11157
Get the real protocol behind several proxies
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/appframework/http/RequestTest.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/lib/appframework/http/RequestTest.php b/tests/lib/appframework/http/RequestTest.php
index 3185a0093c4..282d13a3397 100644
--- a/tests/lib/appframework/http/RequestTest.php
+++ b/tests/lib/appframework/http/RequestTest.php
@@ -593,6 +593,27 @@ class RequestTest extends \Test\TestCase {
$this->assertSame('http', $request->getServerProtocol());
}
+ 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->config,
+ $this->stream
+ );
+
+ $this->assertSame('https', $request->getServerProtocol());
+ }
+
/**
* @dataProvider userAgentProvider
* @param string $testAgent