Skip to content

Commit e14bbdc

Browse files
committed
Minor
1 parent a747977 commit e14bbdc

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## UNRELEASED
4+
5+
### Fixed
6+
7+
- Issue when you use `respect_cache_headers=>false` in combination with `default_ttl=>null`.
38

49
## 1.1.0 - 2016-08-04
510

src/CachePlugin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function handleRequest(RequestInterface $request, callable $next, callabl
144144
private function calculateCacheItemExpiresAfter($maxAge)
145145
{
146146
if ($this->config['cache_lifetime'] === null && $maxAge === null) {
147-
return null;
147+
return;
148148
}
149149

150150
return $this->config['cache_lifetime'] + $maxAge;
@@ -157,11 +157,11 @@ private function calculateCacheItemExpiresAfter($maxAge)
157157
*/
158158
private function getResponseExpiresAt($maxAge)
159159
{
160-
if ($maxAge !== null) {
161-
return time() + $maxAge;
160+
if ($maxAge === null) {
161+
return;
162162
}
163163

164-
return null;
164+
return time() + $maxAge;
165165
}
166166

167167
/**

0 commit comments

Comments
 (0)