|
@@ -9,14 +9,15 @@
|
|
|
(defun get-url (path)
|
|
(defun get-url (path)
|
|
|
(declare #.*standard-optimize-settings*)
|
|
(declare #.*standard-optimize-settings*)
|
|
|
(when (and path (pathnamep path))
|
|
(when (and path (pathnamep path))
|
|
|
- (let ((path (namestring path)))
|
|
|
|
|
|
|
+ (let ((path (uiop:unix-namestring path)))
|
|
|
(loop for (path-prefix . url-prefix) in *path-url-mappings*
|
|
(loop for (path-prefix . url-prefix) in *path-url-mappings*
|
|
|
- do (multiple-value-bind (foundp suffix) (starts-with-subseq path-prefix path :return-suffix t)
|
|
|
|
|
- (when foundp
|
|
|
|
|
- (return-from get-url (concatenate 'string url-prefix
|
|
|
|
|
- (format nil "~{~A~^/~}"
|
|
|
|
|
- (mapcar #'quri:url-encode
|
|
|
|
|
- (split-sequence:split-sequence #\/ suffix)))))))))))
|
|
|
|
|
|
|
+ do (multiple-value-bind (foundp suffix)
|
|
|
|
|
+ (starts-with-subseq path-prefix path :return-suffix t)
|
|
|
|
|
+ (when foundp
|
|
|
|
|
+ (return-from get-url (concatenate 'string url-prefix
|
|
|
|
|
+ (format nil "~{~A~^/~}"
|
|
|
|
|
+ (mapcar #'quri:url-encode
|
|
|
|
|
+ (split-sequence:split-sequence #\/ suffix)))))))))))
|
|
|
|
|
|
|
|
(defmacro maybe-key-value (key value)
|
|
(defmacro maybe-key-value (key value)
|
|
|
`(when ,value
|
|
`(when ,value
|