]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/HttpUtils/ServerUrlTest.php
REST API: implement POST link service
[github/shaarli/Shaarli.git] / tests / HttpUtils / ServerUrlTest.php
index 5096db653bda40498ddb4fcf1006cf347d15b252..7fdad6594961e5995d40f050fc3f90fbeded7f3d 100644 (file)
@@ -67,6 +67,32 @@ class ServerUrlTest extends PHPUnit_Framework_TestCase
                 )
             )
         );
+
+        $this->assertEquals(
+            'https://host.tld',
+            server_url(
+                array(
+                    'HTTPS' => 'Off',
+                    'SERVER_NAME' => 'host.tld',
+                    'SERVER_PORT' => '80',
+                    'HTTP_X_FORWARDED_PROTO' => 'https',
+                    'HTTP_X_FORWARDED_PORT' => '443'
+                )
+            )
+        );
+
+        $this->assertEquals(
+            'https://host.tld:4974',
+            server_url(
+                array(
+                    'HTTPS' => 'Off',
+                    'SERVER_NAME' => 'host.tld',
+                    'SERVER_PORT' => '80',
+                    'HTTP_X_FORWARDED_PROTO' => 'https, https',
+                    'HTTP_X_FORWARDED_PORT' => '4974, 80'
+                )
+            )
+        );
     }
 
     /**