diff options
Diffstat (limited to 'fussy.lisp')
-rw-r--r-- | fussy.lisp | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -551,18 +551,19 @@ h1 { (or (uiop:file-exists-p (robots-path-name)) "")) +(defun theme-image-pathname (pkg theme img) + (uiop:ensure-pathname + (format nil "~a/~a/~a/~a" + (full-theme-image-directory) + pkg + theme + img))) + (lzb:defendpoint* :get "/images/:pkg:/:theme:/:image:" () () "Endpoint for serving theme preview images" - (let ((file-path - (pathname - (format nil "~a/~a/~a/~a" - (full-theme-image-directory) - pkg - theme - image)))) - (unless (uiop:file-exists-p file-path) - (lzb:http-err 404 "no such file")) - file-path)) + (a:if-let (file-path (theme-image-pathname pkg theme image)) + file-path + (lzb:http-err 404 "No such file"))) (defun a-string (s) s) |