Skip to content

Commit

Permalink
[HttpFoundation] added Response::setVary()
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Oct 30, 2010
1 parent ae888b8 commit dd9b77e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Symfony/Component/HttpFoundation/Response.php
Expand Up @@ -580,7 +580,18 @@ public function getVary()
return array();
}

return preg_split('/[\s,]+/', $vary);
return is_array($vary) ? $vary : preg_split('/[\s,]+/', $vary);
}

/**
* Sets the Vary header.
*
* @param string|array $headers
* @param Boolean $replace Whether to replace the actual value of not (true by default)
*/
public function setVary($headers, $replace = true)
{
$this->headers->set('Vary', $headers, $replace);
}

/**
Expand Down

0 comments on commit dd9b77e

Please sign in to comment.