Merge branch '2.8' into 3.4
* 2.8: Remove the Expires header when calling Response::expire() Allow multidimensional collection in property info
This commit is contained in:
commit
6e2b128b63
@ -718,6 +718,7 @@ class Response
|
|||||||
{
|
{
|
||||||
if ($this->isFresh()) {
|
if ($this->isFresh()) {
|
||||||
$this->headers->set('Age', $this->getMaxAge());
|
$this->headers->set('Age', $this->getMaxAge());
|
||||||
|
$this->headers->remove('Expires');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -362,6 +362,11 @@ class ResponseTest extends ResponseTestCase
|
|||||||
$response->headers->set('Expires', -1);
|
$response->headers->set('Expires', -1);
|
||||||
$response->expire();
|
$response->expire();
|
||||||
$this->assertNull($response->headers->get('Age'), '->expire() does not set the Age when the response is expired');
|
$this->assertNull($response->headers->get('Age'), '->expire() does not set the Age when the response is expired');
|
||||||
|
|
||||||
|
$response = new Response();
|
||||||
|
$response->headers->set('Expires', date(DATE_RFC2822, time() + 600));
|
||||||
|
$response->expire();
|
||||||
|
$this->assertNull($response->headers->get('Expires'), '->expire() removes the Expires header when the response is fresh');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetTtl()
|
public function testGetTtl()
|
||||||
|
@ -46,6 +46,16 @@ class Dummy extends ParentDummy
|
|||||||
*/
|
*/
|
||||||
public $collection;
|
public $collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string[][]
|
||||||
|
*/
|
||||||
|
public $nestedCollection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed[]
|
||||||
|
*/
|
||||||
|
public $mixedCollection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ParentDummy
|
* @var ParentDummy
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user