Skip to content

Commit

Permalink
Merge pull request #152 from pdsinterop/fix/register-port-number
Browse files Browse the repository at this point in the history
Fix/register port number
  • Loading branch information
ylebre authored Feb 13, 2024
2 parents 3854755 + eab34dd commit 1f46e74
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions solid/lib/Controller/ServerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ public function authorize() {

if (preg_match("/^http(s)?:/", $getVars['client_id'])) {
$parsedOrigin = parse_url($getVars['redirect_uri']);
$origin = 'https://' . $parsedOrigin['host'];

$origin = $parsedOrigin['scheme'] . '://' . $parsedOrigin['host'];
if (isset($parsedOrigin['port'])) {
$origin .= ":" . $parsedOrigin['port'];
}
$clientData = array(
"client_id_issued_at" => time(),
"client_name" => $getVars['client_id'],
Expand Down Expand Up @@ -336,7 +338,10 @@ public function register() {
}
$clientData['client_id_issued_at'] = time();
$parsedOrigin = parse_url($clientData['redirect_uris'][0]);
$origin = 'https://' . $parsedOrigin['host'];
$origin = $parsedOrigin['scheme'] . '://' . $parsedOrigin['host'];
if (isset($parsedOrigin['port'])) {
$origin .= ":" . $parsedOrigin['port'];
}

$clientId = $this->config->saveClientRegistration($origin, $clientData);
$registration = array(
Expand Down

0 comments on commit 1f46e74

Please sign in to comment.