/*
- * Copyright 2001-2006 Internet2
+ * Copyright 2001-2007 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
public:
virtual ~HTTPResponse() {}
+ void setContentType(const char* type) {
+ setResponseHeader("Content-Type", type);
+ }
+
/**
* Sets or clears a response header.
*
* @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.