Skip to content

Commit

Permalink
[2.0][http-foundation] Fix Response::getDate method
Browse files Browse the repository at this point in the history
  • Loading branch information
benja-M-1 authored and fabpot committed Sep 30, 2012
1 parent 6b24eda commit 7ebc385
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion HeaderBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ public function remove($key)
* @param string $key The parameter key
* @param \DateTime $default The default value
*
* @return \DateTime The filtered value
* @return null|\DateTime The filtered value
*
* @throws \RuntimeException When the HTTP header is not parseable
*
* @api
*/
Expand Down
2 changes: 1 addition & 1 deletion Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public function mustRevalidate()
*/
public function getDate()
{
return $this->headers->getDate('Date');
return $this->headers->getDate('Date', new \DateTime());
}

/**
Expand Down

0 comments on commit 7ebc385

Please sign in to comment.