Permalink
Browse files

Make a choice when max-age is present twice

  • Loading branch information...
1 parent 5d89b76 commit fdacd06c3884299ce5bfab1db4d3a36f479b613b @athieriot athieriot committed Feb 13, 2013
Showing with 11 additions and 1 deletion.
  1. +11 −1 Message/AbstractMessage.php
@@ -236,7 +236,17 @@ public function setTokenizedHeader($header, $data, $token = ';')
*/
public function getCacheControlDirective($directive)
{
- return isset($this->cacheControl[$directive]) ? $this->cacheControl[$directive] : null;
+ if (!isset($this->cacheControl[$directive])) {
+ return null;
+ }
+
+ $directive = $this->cacheControl[$directive];
+
+ if (is_array($directive) && !empty($directive)) {
+ return $directive[0];
+ }
+
+ return $directive;
}
/**

0 comments on commit fdacd06

Please sign in to comment.