diff options
author | Joas Schilling <coding@schilljs.com> | 2018-01-15 10:59:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-15 10:59:04 +0100 |
commit | dbd1620cefb9508707b650284d0be00b6af73369 (patch) | |
tree | 5c869cbe3a634ab621b042e09fb14ad2f3fc2142 /core | |
parent | 0023cb12fd520fc904caf1dc31449d8432386a02 (diff) | |
parent | 7789fbdea6445f39da3866f9de4b7b2208f64ea7 (diff) | |
download | nextcloud-server-dbd1620cefb9508707b650284d0be00b6af73369.tar.gz nextcloud-server-dbd1620cefb9508707b650284d0be00b6af73369.zip |
Merge pull request #7859 from nextcloud/master-7806
Fix bug with proxies
Diffstat (limited to 'core')
-rw-r--r-- | core/Controller/ClientFlowLoginController.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/core/Controller/ClientFlowLoginController.php b/core/Controller/ClientFlowLoginController.php index 7d6e79d39bc..0e7fbf892b6 100644 --- a/core/Controller/ClientFlowLoginController.php +++ b/core/Controller/ClientFlowLoginController.php @@ -315,7 +315,18 @@ class ClientFlowLoginController extends Controller { $serverPostfix = substr($this->request->getRequestUri(), 0, strpos($this->request->getRequestUri(), '/login/flow')); } - $serverPath = $this->request->getServerProtocol() . "://" . $this->request->getServerHost() . $serverPostfix; + $protocol = $this->request->getServerProtocol(); + + if ($protocol !== "https") { + $xForwardedProto = $this->request->getHeader('X-Forwarded-Proto'); + $xForwardedSSL = $this->request->getHeader('X-Forwarded-Ssl'); + if ($xForwardedProto === 'https' || $xForwardedSSL === 'on') { + $protocol = 'https'; + } + } + + + $serverPath = $protocol . "://" . $this->request->getServerHost() . $serverPostfix; $redirectUri = 'nc://login/server:' . $serverPath . '&user:' . urlencode($loginName) . '&password:' . urlencode($token); } |