aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/HttpUtils/ServerUrlTest.php
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2017-08-23 01:26:03 +0200
committerVirtualTam <virtualtam@flibidi.net>2017-08-23 01:26:03 +0200
commit2c049b673acdd10125db9c3c271eef5bd3f5fc17 (patch)
treeda67c958941502dd9c10d82be747559bbe2a062a /tests/HttpUtils/ServerUrlTest.php
parentbf82dcfeb38418f0b3d0f14f6c666ed04651e08f (diff)
parent1ea88ae7d1b7fb13e18f543e7c2ad99c4ccde19a (diff)
downloadShaarli-2c049b673acdd10125db9c3c271eef5bd3f5fc17.tar.gz
Shaarli-2c049b673acdd10125db9c3c271eef5bd3f5fc17.tar.zst
Shaarli-2c049b673acdd10125db9c3c271eef5bd3f5fc17.zip
Merge remote-tracking branch 'upstream/v0.9' into latest
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'tests/HttpUtils/ServerUrlTest.php')
-rw-r--r--tests/HttpUtils/ServerUrlTest.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/HttpUtils/ServerUrlTest.php b/tests/HttpUtils/ServerUrlTest.php
index 7fdad659..dac02b3e 100644
--- a/tests/HttpUtils/ServerUrlTest.php
+++ b/tests/HttpUtils/ServerUrlTest.php
@@ -39,6 +39,34 @@ class ServerUrlTest extends PHPUnit_Framework_TestCase
39 } 39 }
40 40
41 /** 41 /**
42 * Detect a Proxy that sets Forwarded-Host
43 */
44 public function testHttpsProxyForwardedHost()
45 {
46 $this->assertEquals(
47 'https://host.tld:8080',
48 server_url(
49 array(
50 'HTTP_X_FORWARDED_PROTO' => 'https',
51 'HTTP_X_FORWARDED_PORT' => '8080',
52 'HTTP_X_FORWARDED_HOST' => 'host.tld'
53 )
54 )
55 );
56
57 $this->assertEquals(
58 'https://host.tld:4974',
59 server_url(
60 array(
61 'HTTP_X_FORWARDED_PROTO' => 'https, https',
62 'HTTP_X_FORWARDED_PORT' => '4974, 80',
63 'HTTP_X_FORWARDED_HOST' => 'host.tld, example.com'
64 )
65 )
66 );
67 }
68
69 /**
42 * Detect a Proxy with SSL enabled 70 * Detect a Proxy with SSL enabled
43 */ 71 */
44 public function testHttpsProxyForward() 72 public function testHttpsProxyForward()