[HttpKernel] added a method to retrieved the ETags from the IF_NONE_MATCH header in a Request

This commit is contained in:
Fabien Potencier 2010-05-19 11:25:07 +02:00
parent 005051c389
commit 6e6092596b
1 changed files with 5 additions and 0 deletions

View File

@ -460,6 +460,11 @@ class Request
return in_array(strtolower($this->getMethod()), array('get', 'head'));
}
public function getETags()
{
return preg_split('/\s*,\s*/', $this->headers->get('if_none_match'));
}
public function isNoCache()
{
return $this->headers->getCacheControl()->isNoCache() || 'no-cache' == $this->headers->get('Pragma');