diff options
author | Julien Verhaeghe <echec.will.win@gmail.com> | 2017-02-24 23:44:27 +0100 |
---|---|---|
committer | Arnold Daniels <arnold@jasny.net> | 2017-02-24 23:44:27 +0100 |
commit | 0cb18c072e7b14db3d2d2549c051f41ca837e5e9 (patch) | |
tree | 20c10178e07ea07e2543154bafd04abcaf4d3b1e /examples/ajax-broker | |
parent | cc130f231c209bef5962d6afc395190002bd461f (diff) | |
download | sso-0cb18c072e7b14db3d2d2549c051f41ca837e5e9.zip sso-0cb18c072e7b14db3d2d2549c051f41ca837e5e9.tar.gz sso-0cb18c072e7b14db3d2d2549c051f41ca837e5e9.tar.bz2 |
Expiration time (#62)v0.3.0
Expose cookie life time parameter to customize it. Default is 3600.
Minor fixes for code quality
Diffstat (limited to 'examples/ajax-broker')
-rw-r--r-- | examples/ajax-broker/api.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/ajax-broker/api.php b/examples/ajax-broker/api.php index 996b813..304febd 100644 --- a/examples/ajax-broker/api.php +++ b/examples/ajax-broker/api.php @@ -8,8 +8,8 @@ if (empty($_REQUEST['command']) || !method_exists($broker, $_REQUEST['command']) header("Content-Type: application/json"); header("HTTP/1.1 400 Bad Request"); echo json_encode(['error' => 'Command not specified']); - exit(); -} + return; +} try { $result = $broker->{$_REQUEST['command']}(); @@ -22,7 +22,7 @@ try { if (!empty($_GET['callback'])) { if (!isset($result)) $result = null; if (!isset($status)) $status = isset($result) ? 200 : 204; - + header('Content-Type: application/javascript'); echo $_GET['callback'] . '(' . json_encode($result) . ', ' . $status . ')'; return; |