8000 [HttpKernel] Account for Response::getDate() possibly returning a Dat… · symfony/symfony@29eaa54 · GitHub
[go: up one dir, main page]

Skip to content

Commit 29eaa54

Browse files
[HttpKernel] Account for Response::getDate() possibly returning a DateTimeImmutable
1 parent f055c80 commit 29eaa54

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/HttpKernel/HttpCache/ResponseCacheStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function update(Response $response)
147147

148148
if (is_numeric($this->ageDirectives['expires'])) {
149149
$date = clone $response->getDate();
150-
$date->modify('+'.($this->ageDirectives['expires'] + $this->age).' seconds');
150+
$date = $date->modify('+'.($this->ageDirectives['expires'] + $this->age).' seconds');
151151
$response->setExpires($date);
152152
}
153153
}

src/Symfony/Component/HttpKernel/Tests/HttpCache/ResponseCacheStrategyTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public function testCacheControlMerging(array $expects, array $master, array $su
257257

258258
case 'expires':
259259
$expires = clone $response->getDate();
260-
$expires->modify('+'.$value.' seconds');
260+
$expires = $expires->modify('+'.$value.' seconds');
261261
$response->setExpires($expires);
262262
break;
263263

0 commit comments

Comments
 (0)
0