mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 14:50:17 -04:00
Fix bug with proxies
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
c14dad90e8
commit
cc742ce9e7
1 changed files with 12 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue