From c4f18e49f4df4e9c44d6befdece6fd49c7d6a25f Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 22 Feb 2011 05:26:13 +0000 Subject: [PATCH] added REQUEST_PROTOCOL --- codepot/etc/codepot.ini.in | 3 ++- codepot/src/index.php | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/codepot/etc/codepot.ini.in b/codepot/etc/codepot.ini.in index f1e500aa..f27997f7 100644 --- a/codepot/etc/codepot.ini.in +++ b/codepot/etc/codepot.ini.in @@ -74,8 +74,9 @@ api_base_url = "http://127.0.0.1" ; https://${SERVER_NAME}/svn. ; You may specify multiple URLs separated with a comma as shown below: ; "http://${SERVER_NAME}/svn, https://${SERVER_NAME}/svn" +; REQUEST_PROTOCOL is resolved to either http or https. ;------------------------------------------------------------------------------ -svn_base_url = "http://${SERVER_NAME}:${SERVER_PORT}/svn" +svn_base_url = "${REQUEST_PROTOCOL}://${SERVER_NAME}:${SERVER_PORT}/svn" ;------------------------------------------------------------------------------ ; Login model to use. diff --git a/codepot/src/index.php b/codepot/src/index.php index 1216c843..1a787f57 100644 --- a/codepot/src/index.php +++ b/codepot/src/index.php @@ -63,6 +63,16 @@ if (CODEPOT_HTTPS_COMPULSORY) } } +/* +|--------------------------------------------------------------- +| EXTRA INFORMATION +|--------------------------------------------------------------- +*/ +if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') + $_SERVER['REQUEST_PROTOCOL'] = 'https'; +else + $_SERVER['REQUEST_PROTOCOL'] = 'http'; + /* |--------------------------------------------------------------- | LOAD THE FRONT CONTROLLER