From 12cdc3f219e948326fc6b5f428aca02b4b15c655 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Fri, 23 Dec 2011 23:58:55 +0100 Subject: Fix static file handling. --- mulkcms-hunchentoot.lisp | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/mulkcms-hunchentoot.lisp b/mulkcms-hunchentoot.lisp index 5a134ac..4300871 100644 --- a/mulkcms-hunchentoot.lisp +++ b/mulkcms-hunchentoot.lisp @@ -36,23 +36,24 @@ (append (get-parameters*) (post-parameters*)) (header-in* :accept-language)))) - (lambda () - (let ((result (funcall handler))) - (typecase result - (cons - (when-let (content-type (getf result :content-type)) - (setf (hunchentoot:content-type*) content-type)) - (when-let (headers (getf result :headers)) - (dolist (header headers) - (setf (hunchentoot:header-out (car header)) - (cdr header)))) - (when-let (return-code (getf result :return-code)) - (setf (hunchentoot:return-code*) return-code) - ;;(hunchentoot:abort-request-handler) - ) - (getf result :body)) - (t - result)))))))) + (and handler + (lambda () + (let ((result (funcall handler))) + (typecase result + (cons + (when-let (content-type (getf result :content-type)) + (setf (hunchentoot:content-type*) content-type)) + (when-let (headers (getf result :headers)) + (dolist (header headers) + (setf (hunchentoot:header-out (car header)) + (cdr header)))) + (when-let (return-code (getf result :return-code)) + (setf (hunchentoot:return-code*) return-code) + ;;(hunchentoot:abort-request-handler) + ) + (getf result :body)) + (t + result))))))))) (defun setup-handlers () (setq *dispatch-table* -- cgit v1.2.3