diff options
Diffstat (limited to 'module/calp/server/webdav.scm')
-rw-r--r-- | module/calp/server/webdav.scm | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/module/calp/server/webdav.scm b/module/calp/server/webdav.scm index 3413f254..703e4783 100644 --- a/module/calp/server/webdav.scm +++ b/module/calp/server/webdav.scm @@ -219,15 +219,17 @@ ;; Body, if it exists, MUST have be a DAV::propfind object (define property-request - (cond ((string? body) - (xml->namespaced-sxml body)) - ((bytevector? body) - (-> body - (bytevector->string - (make-transcoder (utf-8-codec))) - xml->namespaced-sxml)) - (else `(,(xml webdav 'propfind) - (,(xml webdav 'allprop)))))) + (xml-document-root + (cond ((string? body) + (xml->namespaced-sxml body)) + ((bytevector? body) + (-> body + (bytevector->string + (make-transcoder (utf-8-codec))) + xml->namespaced-sxml)) + (else (xml-document + root: ((xml webdav 'propfind) + ((xml webdav 'allprop)))))))) (catch 'bad-request @@ -238,11 +240,12 @@ headers: '((content-type . (application/xml)))) (lambda (port) (namespaced-sxml->xml - `(,(xml webdav 'multistatus) - ,@(for (href . resource) in requested-resources - `(,(xml webdav 'response) - (,(xml webdav 'href) ,(href->string href)) - ,@(map propstat->namespaced-sxml + (apply + (xml webdav 'multistatus) + (for (href . resource) in requested-resources + (apply (xml webdav 'response) + ((xml webdav 'href) (href->string href)) + (map propstat->namespaced-sxml (parse-propfind (root-element/namespaced property-request) resource))))) namespaces: output-namespaces @@ -284,14 +287,15 @@ (else (throw 'body-required)))) (namespaced-sxml->xml - `(,(xml webdav 'multistatus) - (,(xml webdav 'response) - (,(xml webdav 'href) ,(href->string href)) - ,@(map propstat->namespaced-sxml - (parse-propertyupdate - (root-element request) - (map swap namespaces*) - resource)))) + ((xml webdav 'multistatus) + (apply + (xml webdav 'response) + ((xml webdav 'href) (href->string href)) + (map propstat->namespaced-sxml + (parse-propertyupdate + (root-element request) + (map swap namespaces*) + resource)))) port: port)))) (lambda (err proc fmt args data) (values (build-response |