diff options
Diffstat (limited to 'module/calp/server/routes.scm')
-rw-r--r-- | module/calp/server/routes.scm | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/module/calp/server/routes.scm b/module/calp/server/routes.scm index b024ed4f..08e48714 100644 --- a/module/calp/server/routes.scm +++ b/module/calp/server/routes.scm @@ -20,7 +20,7 @@ :use-module ((rnrs io ports) :select (get-bytevector-all)) :use-module ((xdg basedir) :prefix xdg-) - :use-module ((calp html util) :select (html-unattr)) + :use-module ((base64) :select (base64decode)) :use-module (web http make-routes) @@ -58,7 +58,12 @@ [else "🙃"])) (td (a (@ (href "/" ,dir "/" ,k)) ,k)) (td ,(number->string (stat:perms stat) 8))))) - (cdr (scandir dir)))))) + (cdr (or (scandir dir) + (scm-error + 'misc-error + "directory-table" + "Scandir argument invalid or not directory: ~a" + (list dir) '()))))))) @@ -162,8 +167,7 @@ (format #f "No event with UID '~a'" uid)))) ;; TODO this fails when dtstart is <date>. - ;; @var{cal} should be the name of the calendar encoded with - ;; modified base64. See (calp html util). + ;; @var{cal} should be the name of the calendar encoded in base64. (POST "/insert" (cal data) (unless (and cal data) @@ -174,7 +178,7 @@ ;; NOTE that this leaks which calendar exists, ;; but you can only query for existance. ;; also, the calendar view already show all calendars. - (let* ((calendar-name (html-unattr cal)) + (let* ((calendar-name (base64decode cal)) (calendar (find (lambda (c) (string=? calendar-name (prop c 'NAME))) (get-calendars global-event-object)))) |