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:
parent
8bcff1f1d6
commit
79460dadfc
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue