1
0
Fork 0
mirror of synced 2024-06-02 10:54:44 +12:00

Added missing protocol and ports

This commit is contained in:
Eldad Fux 2021-01-18 08:58:48 +02:00
parent b2e56954a0
commit e4d27c24a4

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);