diff options
Diffstat (limited to 'lazybones-hunchentoot.lisp')
-rw-r--r-- | lazybones-hunchentoot.lisp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lazybones-hunchentoot.lisp b/lazybones-hunchentoot.lisp index 24fe5e1..bb47d27 100644 --- a/lazybones-hunchentoot.lisp +++ b/lazybones-hunchentoot.lisp @@ -52,16 +52,21 @@ stream.") (defmethod h:acceptor-dispatch-request ((%server% lazybones-acceptor) request) - (let ((%request-body-cache% nil)) + (let* ((%request-body-cache% nil) + (route + (request-path request)) + (apps + (remove-if-not (lambda (app) (a:starts-with-subseq (lzb::app-prefix app) route)) + (acceptor-apps %server%)))) (handler-case - (loop for app in (acceptor-apps %server%) + (loop for app in apps for (endpoint . args) = (lzb::find-endpoint app request) when endpoint return (lzb::run-endpoint endpoint args request h:*reply* app) ;; if no endpoint was found, call next method. finally (let ((lzb:*request* request) (lzb:*response* h:*reply*)) - (return (lzb:http-err nil 404)))) + (lzb:http-err 404))) (lzb::http-error (http-error) (let ((lzb:*request* request) (lzb:*response* h:*reply*)) |