Skip to content

Commit

Permalink
Use request helper instead of server variables (#3483)
Browse files Browse the repository at this point in the history
  • Loading branch information
riasvdv authored Apr 6, 2021
1 parent 32fcf7f commit 3b24446
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Facades/Endpoint/URL.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@ public function getSiteUrl()
return config('app.url');
}

$protocol = (! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443)
$protocol = (! empty(request()->server('HTTPS')) && request()->server('HTTPS') !== 'off' || request()->server('SERVER_PORT') == 443)
? 'https://'
: 'http://';

$domain_name = $_SERVER['HTTP_HOST'].'/';
$domain_name = request()->server('HTTP_HOST').'/';

return $protocol.$domain_name;
}
Expand Down

0 comments on commit 3b24446

Please sign in to comment.