diff options
author | VirtualTam <virtualtam@flibidi.net> | 2017-08-23 01:08:41 +0200 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2017-08-23 01:08:41 +0200 |
commit | 9d7a02afcee3c740712a7c95182d332db0504b7e (patch) | |
tree | 3266e3d3bfec6a3ac075084cbec07ba4090c4cd2 /tests/HttpUtils/ServerUrlTest.php | |
parent | c318096c7a6fb3f6b00bd8c694ab7acb8fbb7cd0 (diff) | |
parent | 7c2460c856c1d561b8347316f3045208f9f3d24e (diff) | |
download | Shaarli-9d7a02afcee3c740712a7c95182d332db0504b7e.tar.gz Shaarli-9d7a02afcee3c740712a7c95182d332db0504b7e.tar.zst Shaarli-9d7a02afcee3c740712a7c95182d332db0504b7e.zip |
Merge branch 'master' into v0.9
Diffstat (limited to 'tests/HttpUtils/ServerUrlTest.php')
-rw-r--r-- | tests/HttpUtils/ServerUrlTest.php | 28 |
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() |