Skip to content

Commit

Permalink
Show help with url (local or prod).
Browse files Browse the repository at this point in the history
  • Loading branch information
maurobonfietti committed Jun 23, 2018
1 parent 932e403 commit e2fbd76
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Controller/DefaultController.php
Expand Up @@ -31,7 +31,7 @@ public function __construct(Container $container)
public function getHelp($request, $response, $args)
{
$this->setParams($request, $response, $args);
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
$protocol = $_SERVER['HTTP_X_FORWARDED_PORT'] === 443 ? 'https://' : 'http://';
$domainName = $_SERVER['HTTP_HOST'] . '/';
$url = $protocol . $domainName;
$message = [
Expand All @@ -41,7 +41,6 @@ public function getHelp($request, $response, $args)
'version' => $url . 'version',
'this help' => $url . '',
];
var_dump($_SERVER); exit;

return $this->jsonResponse('success', $message, 200);
}
Expand Down

0 comments on commit e2fbd76

Please sign in to comment.