Browse Source

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

Fabien Potencier 15 years ago
parent
commit
6e6092596b
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/Symfony/Components/HttpKernel/Request.php

+ 5 - 0
src/Symfony/Components/HttpKernel/Request.php

@@ -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');