Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-11-22 22:22:00 +0400
committerFrank Karlitschek <frank@owncloud.org>2012-11-22 22:22:00 +0400
commit6cb377470607f6e4e62fb6ca931ab63fb6938390 (patch)
treea199f86eac10cedcdc3203e0452beb8cc9edb693 /lib/request.php
parentc773d071ee947a9065c492a356367ebbd78bc169 (diff)
make it possible to manually override the hostname and protocol if the automatic detection from ownCloud fails. This can happen in reverse proxy situations or with loadbalancers setups.
Diffstat (limited to 'lib/request.php')
-rwxr-xr-x[-rw-r--r--]lib/request.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/request.php b/lib/request.php
index 287d20d1a5d..c975c84a711 100644..100755
--- a/lib/request.php
+++ b/lib/request.php
@@ -18,6 +18,9 @@ class OC_Request {
if(OC::$CLI) {
return 'localhost';
}
+ if(OC_Config::getValue('overwritehost', '')<>''){
+ return OC_Config::getValue('overwritehost');
+ }
if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
if (strpos($_SERVER['HTTP_X_FORWARDED_HOST'], ",") !== false) {
$host = trim(array_pop(explode(",", $_SERVER['HTTP_X_FORWARDED_HOST'])));
@@ -40,6 +43,9 @@ class OC_Request {
* Returns the server protocol. It respects reverse proxy servers and load balancers
*/
public static function serverProtocol() {
+ if(OC_Config::getValue('overwriteprotocol', '')<>''){
+ return OC_Config::getValue('overwriteprotocol');
+ }
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
$proto = strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']);
}else{