diff --git a/src/Authorizer.php b/src/Authorizer.php index 9e0689b..d2d2a2d 100644 --- a/src/Authorizer.php +++ b/src/Authorizer.php @@ -39,8 +39,9 @@ public static function sign($allowedResource, $authzgen, $handler = null) if (!isset(self::$globalSecret)) trigger_error('$globalSecret is not set', E_USER_WARNING); list($cerfiticateUrl, $timeStart, $timeEnd) = explode(';', $authzgen) + [null, null, null]; + $opts = $handler !== null ? ['handler' => $handler] : []; - $publicKey = self::downloadSigningKey($cerfiticateUrl, ['handler' => $handler]); + $publicKey = self::downloadSigningKey($cerfiticateUrl, $opts); $resourceSecret = join(';', [ $timeStart,