This commit is contained in:
Ben Sarmiento
2023-10-20 01:27:30 +02:00
parent 987542f89b
commit 1117e777ff
6 changed files with 12 additions and 59 deletions

View File

@@ -5,8 +5,7 @@ func Directory(path string) Response {
Href: customPathEscape(path),
Propstat: PropStat{
Prop: Prop{
ResourceType: ResourceType{Collection: &struct{}{}},
ContentType: "httpd/unix-directory",
ResourceType: ResourceType{Value: "<d:collection/>"},
},
Status: "HTTP/1.1 200 OK",
},

View File

@@ -1,6 +1,8 @@
package dav
import "encoding/xml"
import (
"encoding/xml"
)
type MultiStatus struct {
XMLName xml.Name `xml:"d:multistatus"`
@@ -19,13 +21,12 @@ type PropStat struct {
}
type Prop struct {
ResourceType ResourceType `xml:"d:resourcetype,omitempty"`
ResourceType ResourceType `xml:"d:resourcetype"`
ContentLength int64 `xml:"d:getcontentlength,omitempty"`
CreationDate string `xml:"d:creationdate,omitempty"`
LastModified string `xml:"d:getlastmodified,omitempty"`
ContentType string `xml:"d:getcontenttype,omitempty"`
}
type ResourceType struct {
Collection *struct{} `xml:"d:collection,omitempty"`
Value string `xml:",innerxml"`
}