Added missing protocol and ports

This commit is contained in:
Eldad Fux
2021-01-18 08:58:48 +02:00
parent b2e56954a0
commit e4d27c24a4
+5 -2
View File
@@ -51,8 +51,11 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
$port = \parse_url($request->getOrigin($referrer), PHP_URL_PORT);
$refDomain = (!empty($protocol) ? $protocol : $request->getProtocol()).'://'.((\in_array($origin, $clients))
? $origin : 'localhost') . (!empty($port) ? ':'.$port : '');
$refDomain = (!$route->getLabel('origin', false)) ? $refDomain : $origin; // This route is publicly accessible
? $origin : 'localhost').(!empty($port) ? ':'.$port : '');
$refDomain = (!$route->getLabel('origin', false)) // This route is publicly accessible
? $refDomain
: (!empty($protocol) ? $protocol : $request->getProtocol()).'://'.$origin.(!empty($port) ? ':'.$port : '');
$selfDomain = new Domain($request->getHostname());
$endDomain = new Domain((string)$origin);