From 79460dadfc9cd42a77a4e0951b9674bca8e40a38 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 27 Aug 2007 05:09:54 +0000 Subject: [PATCH] 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 --- core/control/HTTPResponse.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/control/HTTPResponse.php b/core/control/HTTPResponse.php index e401d5d20..76e32f44d 100644 --- a/core/control/HTTPResponse.php +++ b/core/control/HTTPResponse.php @@ -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;