Sun Oct  8 23:02:53 EDT 2006  Travis Cross <tc@traviscross.com>
  * Added exported function REDIRECT-URL.
diff -rN -u old-hunchentoot/modlisp.lisp new-hunchentoot/modlisp.lisp
--- old-hunchentoot/modlisp.lisp	2006-10-08 23:04:56.000000000 -0400
+++ new-hunchentoot/modlisp.lisp	2006-10-08 23:04:56.000000000 -0400
@@ -210,6 +210,20 @@
           (rfc-1123-date))
   (values))
 
+(defun redirect-url (url &key add-session-id permanently)
+  "Redirects the browser to the resource URL. Adds a session ID if
+ADD-SESSION-ID is true. If PERMANENTLY is true, a 301 request is
+sent to the browser, otherwise a 302."
+  (when add-session-id
+    (setq url (add-cookie-value-to-url url :replace-ampersands-p nil)))
+  (setf (header-out "Location")
+        url
+        (return-code *reply*)
+        (if permanently
+            +http-moved-permanently+
+            +http-moved-temporarily+))
+  (throw 'handler-done nil))
+
 (defun redirect (script-name &key
                            (host (host *request*) host-provided-p)
                            (protocol (if (ssl-session-id *request*)
@@ -227,15 +241,9 @@
                        ((:http) "http")
                        ((:https) "https"))
                      host script-name)))
-    (when add-session-id
-      (setq url (add-cookie-value-to-url url :replace-ampersands-p nil)))
-    (setf (header-out "Location")
-            url
-          (return-code *reply*)
-            (if permanently
-              +http-moved-permanently+
-              +http-moved-temporarily+))
-    (throw 'handler-done nil)))
+    (redirect-url url
+                  :add-session-id add-session-id
+                  :permanently permanently)))
 
 (defun require-authorization (&optional (realm "Hunchentoot"))
   (setf (header-out "WWW-Authenticate")
diff -rN -u old-hunchentoot/packages.lisp new-hunchentoot/packages.lisp
--- old-hunchentoot/packages.lisp	2006-10-08 23:04:56.000000000 -0400
+++ new-hunchentoot/packages.lisp	2006-10-08 23:04:56.000000000 -0400
@@ -174,6 +174,7 @@
            :raw-post-data
            :real-remote-addr
            :recompute-request-parameters
+           :redirect-url
            :redirect
            :referer
            :remote-addr

