Feature #783
Simplify Response object, and provide Redirect
Description
The Response
object currently accepts arguments to set headers and cookies.
Cookies are more verbosely (and less error-prone) set on the request object, which the cookies set in the Response
will be forwarded to regardless. Additionally, the headers
argument is in practice only used for redirects, which are a bit of a burden to generate now.
The cookies argument should be dropped in favor of clients using the one true method of using the request object on the PageMaker
instance.
Additionally, a new Redirect
class should be introduced so that redirects can be easily created. This should accept location
and httpcode
arguments, the second of which defaults to 307 (temporary redirect). The Redirect
class should subclass from response, and have a functional fallback for clients that fail to understand HTTP 307 (unlikely, but they may exist) in the form of a minimal html page.
Associated revisions
Revision 337:5ced2e59e704
(diff)
Added ROUTE_PREFIX variable to router file that defines a common prefix for all routes. This resolves #783.
History
#1 Updated by Elmer de Looff over 12 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 70
Applied in changeset 1407d286215b.
#2 Updated by Elmer de Looff over 12 years ago
- Status changed from Resolved to Closed
- % Done changed from 70 to 100
Removed the setting of cookies from the Response object and added a functional Redirect object. Example code added to the uweb_info project. This resolves #783.