Skip to content

Commit

Permalink
reduce time problems with VAPID expiration (thx @gauntface)
Browse files Browse the repository at this point in the history
  • Loading branch information
Minishlink committed Nov 30, 2016
1 parent 47d2849 commit 8651c6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/VAPID.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static function validate(array $vapid)
*/
public static function getVapidHeaders($audience, $subject, $publicKey, $privateKey, $expiration = null)
{
$expirationLimit = time() + 86400;
$expirationLimit = time() + 43200; // equal margin of error between 0 and 24h
if (!isset($expiration) || $expiration > $expirationLimit) {
$expiration = $expirationLimit;
}
Expand Down

0 comments on commit 8651c6e

Please sign in to comment.