Skip to content

Commit 2127891

Browse files
committed
Merge branch '3.4' into 4.3
* 3.4: [Filesystem] [Serializer] fixes English grammar typo [Monolog Bridge] Fixed accessing static property as non static. Improve Symfony description [Validator] Add Japanese translation Remove some unused methods parameters Avoid empty \"If-Modified-Since\" header in validation request [Validator] ConstraintValidatorTestCase: add missing return value to mocked validate method calls
2 parents acec1f9 + cbe3053 commit 2127891

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

HttpCache/HttpCache.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,9 @@ protected function validate(Request $request, Response $entry, $catch = false)
382382
}
383383

384384
// add our cached last-modified validator
385-
$subRequest->headers->set('if_modified_since', $entry->headers->get('Last-Modified'));
385+
if ($entry->headers->has('Last-Modified')) {
386+
$subRequest->headers->set('if_modified_since', $entry->headers->get('Last-Modified'));
387+
}
386388

387389
// Add our cached etag validator to the environment.
388390
// We keep the etags from the client to handle the case when the client

Tests/HttpCache/HttpCacheTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ public function testValidatesCachedResponsesUseSameHttpMethod()
859859
public function testValidatesCachedResponsesWithETagAndNoFreshnessInformation()
860860
{
861861
$this->setNextResponse(200, [], 'Hello World', function ($request, $response) {
862+
$this->assertFalse($request->headers->has('If-Modified-Since'));
862863
$response->headers->set('Cache-Control', 'public');
863864
$response->headers->set('ETag', '"12345"');
864865
if ($response->getETag() == $request->headers->get('IF_NONE_MATCH')) {

0 commit comments

Comments
 (0)