summaryrefslogtreecommitdiff
path: root/src/request.tmpl
diff options
context:
space:
mode:
authorache <ache@ache.one>2020-02-11 19:38:49 +0100
committerache <ache@ache.one>2020-02-11 19:38:49 +0100
commitfd455b04fd31a84cfd666b21f5814cd7d48c92d1 (patch)
tree742cba532e32cd1f669a614c010d9081aaa7aed4 /src/request.tmpl
parentUse template for xml (diff)
New paths
Diffstat (limited to 'src/request.tmpl')
-rw-r--r--src/request.tmpl33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/request.tmpl b/src/request.tmpl
new file mode 100644
index 0000000..1b67212
--- /dev/null
+++ b/src/request.tmpl
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<D:multistatus xmlns:D="DAV:">
+<D:response>
+<D:href>{{ .Href }}</D:href>
+<D:propstat>
+<D:prop>
+<D:displayname>{{ .Name }}</D:displayname>
+<D:getlastmodified>{{ .Date }}</D:getlastmodified>
+<D:resourcetype><D:collection/></D:resourcetype>
+<D:lockdiscovery/>
+<D:supportedlock>
+</D:supportedlock>
+</D:prop>
+<D:status>HTTP/1.1 200 OK</D:status>
+</D:propstat>
+</D:response>
+{{range .ListFiles}}<D:response>
+<D:href>{{ .Href }}</D:href>
+<D:propstat>
+<D:prop>
+<D:displayname>{{ .DisplayName }}</D:displayname>
+<D:getcontentlength>{{ .Size }}</D:getcontentlength>
+<D:getlastmodified>{{ .LastModifier }}</D:getlastmodified>
+<D:resourcetype>{{ if .IsDir }}<D:collection/>{{end}}</D:resourcetype>
+<D:lockdiscovery/>
+<D:supportedlock>
+</D:supportedlock>
+</D:prop>
+<D:status>HTTP/1.1 {{ .Status }}</D:status>
+</D:propstat>
+</D:response>
+{{end}}
+</D:multistatus>