Added HTTPResponse::getHeader(), to aid test verification

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@40911 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2007-08-27 05:09:54 +00:00
parent 8bcff1f1d6
commit 79460dadfc
1 changed files with 11 additions and 0 deletions

View File

@ -61,10 +61,21 @@ class HTTPResponse extends Object {
return $this->body;
}
/**
* Add a HTTP header to the response, replacing any header of the same name
*/
function addHeader($header, $value) {
$this->headers[$header] = $value;
}
/**
* Return the HTTP header of the given name
* @returns string
*/
function getHeader($header) {
return $this->headers[$header];
}
function redirect($dest) {
$this->statusCode = 302;
$this->headers['Location'] = $dest;