1
0
Fork 0
mirror of synced 2024-06-29 11:40:45 +12:00

Merge pull request #482 from appwrite/missing-origin-protocol

Missing origin protocol
This commit is contained in:
Eldad A. Fux 2020-07-21 09:08:44 +03:00 committed by GitHub
commit d95d894e56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,7 +60,7 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo
$protocol = \parse_url($request->getOrigin($referrer), PHP_URL_SCHEME);
$port = \parse_url($request->getOrigin($referrer), PHP_URL_PORT);
$refDomain = $protocol.'://'.((\in_array($origin, $clients))
$refDomain = (!empty($protocol) ? $protocol : $request->getProtocol()).'://'.((\in_array($origin, $clients))
? $origin : 'localhost') . (!empty($port) ? ':'.$port : '');
$selfDomain = new Domain($request->getHostname());