Skip to content

Commit

Permalink
Add support for psr/http-message 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
flavioheleno committed Jul 6, 2024
1 parent 6a8f44d commit ecd3afa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"require": {
"php": "^7.2 || ^8.0",
"psr/http-message": "^1.0",
"psr/http-message": "^1.1 || ^2.0",
"psr/http-server-middleware": "^1.0"
},
"require-dev": {
Expand Down
3 changes: 1 addition & 2 deletions src/CacheProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use function gmdate;
use function in_array;
use function is_integer;
use function is_null;
use function strtotime;
use function time;

Expand Down Expand Up @@ -43,7 +42,7 @@ public function allowCache(
}
$headerValue = $type;
if ($maxAge || is_integer($maxAge)) {
if (!is_integer($maxAge) && !is_null($maxAge)) {
if (!is_integer($maxAge) && $maxAge !== null) {
$maxAge = strtotime($maxAge) - time();
}
$headerValue = $headerValue.', max-age='.$maxAge;
Expand Down

0 comments on commit ecd3afa

Please sign in to comment.