From b7c6f7e5f5397026a6ecc1ffc2aa7d0b82d58816 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Mon, 14 Dec 2020 08:54:22 -0600 Subject: added http-redirect --- lazybones.lisp | 5 +++++ package.lisp | 1 + 2 files changed, 6 insertions(+) diff --git a/lazybones.lisp b/lazybones.lisp index b95b73b..855f2d1 100644 --- a/lazybones.lisp +++ b/lazybones.lisp @@ -148,6 +148,11 @@ where #HANDERL123 is a block label unique to the handler. *resp-headers*) content)) +(defun http-redirect (location) + (list 303 (list* :location location + *resp-headers*) + nil)) + (defun serve-directory (root-path root-dir &key headers cache-p (filter #'identity)) "Adds handlers for every file in the directory tree with the root ROOT-DIR. diff --git a/package.lisp b/package.lisp index 58f221e..3cefcea 100644 --- a/package.lisp +++ b/package.lisp @@ -25,6 +25,7 @@ #:defroute #:http-err #:http-ok + #:http-redirect #:reload #:start #:stop -- cgit v1.2.3