Skip to content

Commit 2a247de

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: [Console] Readd missing php-doc parameter for constructor Remove polyfills from Yaml and Dotenv [HttpFoundation] Fixed type mismatch Bump Symfony version to 4.4.29 Update VERSION for 4.4.28 Update CHANGELOG for 4.4.28
2 parents c1c2621 + 7016057 commit 2a247de

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public function prepare(Request $request)
324324
}
325325

326326
// Check if we need to send extra expire info headers
327-
if ('1.0' == $this->getProtocolVersion() && str_contains($headers->get('Cache-Control'), 'no-cache')) {
327+
if ('1.0' == $this->getProtocolVersion() && str_contains($headers->get('Cache-Control', ''), 'no-cache')) {
328328
$headers->set('pragma', 'no-cache');
329329
$headers->set('expires', -1);
330330
}

Tests/ResponseTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,12 @@ public function testPrepareSetsPragmaOnHttp10Only()
581581
$this->assertEquals('no-cache', $response->headers->get('pragma'));
582582
$this->assertEquals('-1', $response->headers->get('expires'));
583583

584+
$response = new Response('foo');
585+
$response->headers->remove('cache-control');
586+
$response->prepare($request);
587+
$this->assertFalse($response->headers->has('pragma'));
588+
$this->assertFalse($response->headers->has('expires'));
589+
584590
$request->server->set('SERVER_PROTOCOL', 'HTTP/1.1');
585591
$response = new Response('foo');
586592
$response->prepare($request);

0 commit comments

Comments
 (0)