From f359c2a716d69144c15fe9af856d8d985def8416 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Fri, 23 Nov 2012 12:48:54 +0100 Subject: backport pullrequest #554 better reverse proxy support --- lib/request.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/request.php b/lib/request.php index 87262d98625..10a03a2870a 100644 --- 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{ -- cgit v1.2.3