Skip to content

Commit 3e94869

Browse files
authored
Fix Carbon3 diffInSeconds to use int and not float (spatie#500)
1 parent d183162 commit 3e94869

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Middlewares/CacheResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ protected function getTags(array $args): array
126126
public function addCacheAgeHeader(Response $response): Response
127127
{
128128
if (config('responsecache.add_cache_age_header') and $time = $response->headers->get(config('responsecache.cache_time_header_name'))) {
129-
$ageInSeconds = Carbon::parse($time)->diffInSeconds(Carbon::now());
129+
$ageInSeconds = (int) Carbon::parse($time)->diffInSeconds(Carbon::now(), true);
130130

131131
$response->headers->set(config('responsecache.cache_age_header_name'), $ageInSeconds);
132132
}

0 commit comments

Comments
 (0)