diff options
Diffstat (limited to 'lazybones-hunchentoot.lisp')
-rw-r--r-- | lazybones-hunchentoot.lisp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lazybones-hunchentoot.lisp b/lazybones-hunchentoot.lisp index b010052..c5e55fa 100644 --- a/lazybones-hunchentoot.lisp +++ b/lazybones-hunchentoot.lisp @@ -39,11 +39,16 @@ finally (let ((lzb:*request* request) (lzb:*response* h:*reply*)) (return (lzb:http-err 404)))) + (lzb::http-error (http-error) + (let ((lzb:*request* request) + (lzb:*response* h:*reply*)) + (with-slots (lzb::code lzb::content) http-error + (http-respond lzb::content lzb::code)))) (error (e) (declare (ignorable e)) (let ((lzb:*request* request) (lzb:*response* h:*reply*)) - (lzb:http-err 500))))) + (http-respond 500))))) ;;; SERVER FUNCTIONS @@ -220,7 +225,7 @@ the value of the Content-Type request header." (cadar (setf (h:cookies-out response) (cons (cons name value) (h:cookies-out response)))))) -(defun http-respond (code content) +(defun http-respond (content &optional (code 200)) "Final step preparing response before backend does the rest. For Hunchentoot, set the response code and a few headers. If content is a pathname, pass off to HUNCHENTOOT:HANDLE-STATIC-FILE, otherwise just |