From 3d8881e5954b4a468f535fc3dcb8bbd4d5e3d023 Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Sat, 13 Jan 2007 03:39:36 +0000 Subject: [PATCH] More default methods. --- saml/binding/HTTPResponse.h | 10 +++++++++- samltest/binding.h | 8 -------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/saml/binding/HTTPResponse.h b/saml/binding/HTTPResponse.h index b94e641..7837d60 100644 --- a/saml/binding/HTTPResponse.h +++ b/saml/binding/HTTPResponse.h @@ -43,6 +43,10 @@ namespace opensaml { public: virtual ~HTTPResponse() {} + void setContentType(const char* type) { + setResponseHeader("Content-Type", type); + } + /** * Sets or clears a response header. * @@ -57,7 +61,11 @@ namespace opensaml { * @param name cookie name * @param value value to set, or NULL to clear */ - virtual void setCookie(const char* name, const char* value)=0; + virtual void setCookie(const char* name, const char* value) { + std::string cookie(name); + cookie = cookie + '=' + value; + setResponseHeader("Set-Cookie", cookie.c_str()); + } /** * Redirect the client to the specified URL and complete the response. diff --git a/samltest/binding.h b/samltest/binding.h index d4de9c9..2cd28f1 100644 --- a/samltest/binding.h +++ b/samltest/binding.h @@ -194,14 +194,6 @@ public: m_headers[name] = value ? value : ""; } - void setContentType(const char* type) { - setResponseHeader("Content-Type", type); - } - - void setCookie(const char* name, const char* value) { - m_headers["Set-Cookie"] = string(name) + "=" + (value ? value : ""); - } - // The amount of error checking missing from this is incredible, but as long // as the test data isn't unexpected or malformed, it should work. -- 2.1.4