From 5aeff682246be07bf13c7c50f7899d790de3ad5b Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 26 Nov 2023 08:44:36 -0800 Subject: http-redirect --- src/lazybones.lisp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/lazybones.lisp') diff --git a/src/lazybones.lisp b/src/lazybones.lisp index d993f1d..d1e186e 100644 --- a/src/lazybones.lisp +++ b/src/lazybones.lisp @@ -462,6 +462,13 @@ making a new one if not." "Singals an HTTP-ERROR with code and content." (signal 'http-error :content content :code code)) +(defun http-redirect (location) + "Set the lazybones response header and response code for redirecting to LOCATION. +This procedure will error if lazybones:*response* is not currently bound." + (setf (response-header :location) location + (response-code) "303")) + + ;;; MANAGING DEFINITIONS -- cgit v1.2.3