diff --git a/lack-middleware-mount.asd b/lack-middleware-mount.asd index 4790404..b63cd16 100644 --- a/lack-middleware-mount.asd +++ b/lack-middleware-mount.asd @@ -7,4 +7,5 @@ :version "0.1" :author "Eitaro Fukamachi" :license "LLGPL" + :depends-on (:lack-component) :components ((:file "src/middleware/mount"))) diff --git a/src/middleware/mount.lisp b/src/middleware/mount.lisp index 9c4f7bb..b9117fe 100644 --- a/src/middleware/mount.lisp +++ b/src/middleware/mount.lisp @@ -1,6 +1,8 @@ (in-package :cl-user) (defpackage lack.middleware.mount (:use :cl) + (:import-from :lack.component + :to-app) (:export :*lack-middleware-mount*)) (in-package :lack.middleware.mount) @@ -12,13 +14,13 @@ (cond ((string= path-info path) (setf (getf env :path-info) "/") - (funcall mount-app env)) + (funcall (to-app mount-app) env)) ((and (< len (length path-info)) (string= path-info path :end1 len) (char= (aref path-info len) #\/)) (setf (getf env :path-info) (subseq path-info (length path))) - (funcall mount-app env)) + (funcall (to-app mount-app) env)) (t (funcall app env))))))) "Middleware for attaching another Lack application on a specific URL")