aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/HttpUtils/ServerUrlTest.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2018-01-30 19:15:30 +0100
committerArthurHoaro <arthur@hoa.ro>2018-01-30 19:15:30 +0100
commita74184e1b0a9d503e1ea75812583967e7110c2f2 (patch)
treed596a0af4c819509d0bea8d5bdaf9041e7e77808 /tests/HttpUtils/ServerUrlTest.php
parent57e4a974f7332ec694822ec61b8527cc31152798 (diff)
parent99a554904498d4d6985216568b32833c73e9825f (diff)
downloadShaarli-a74184e1b0a9d503e1ea75812583967e7110c2f2.tar.gz
Shaarli-a74184e1b0a9d503e1ea75812583967e7110c2f2.tar.zst
Shaarli-a74184e1b0a9d503e1ea75812583967e7110c2f2.zip
Merge tag 'v0.9.4' into latest
Release v0.9.4
Diffstat (limited to 'tests/HttpUtils/ServerUrlTest.php')
-rw-r--r--tests/HttpUtils/ServerUrlTest.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/HttpUtils/ServerUrlTest.php b/tests/HttpUtils/ServerUrlTest.php
index dac02b3e..324b827a 100644
--- a/tests/HttpUtils/ServerUrlTest.php
+++ b/tests/HttpUtils/ServerUrlTest.php
@@ -186,4 +186,36 @@ class ServerUrlTest extends PHPUnit_Framework_TestCase
186 ) 186 )
187 ); 187 );
188 } 188 }
189
190 /**
191 * Misconfigured server (see #1022): Proxy HTTP but 443
192 */
193 public function testHttpWithPort433()
194 {
195 $this->assertEquals(
196 'https://host.tld',
197 server_url(
198 array(
199 'HTTPS' => 'Off',
200 'SERVER_NAME' => 'host.tld',
201 'SERVER_PORT' => '80',
202 'HTTP_X_FORWARDED_PROTO' => 'http',
203 'HTTP_X_FORWARDED_PORT' => '443'
204 )
205 )
206 );
207
208 $this->assertEquals(
209 'https://host.tld',
210 server_url(
211 array(
212 'HTTPS' => 'Off',
213 'SERVER_NAME' => 'host.tld',
214 'SERVER_PORT' => '80',
215 'HTTP_X_FORWARDED_PROTO' => 'https, http',
216 'HTTP_X_FORWARDED_PORT' => '443, 80'
217 )
218 )
219 );
220 }
189} 221}