webdav: add support for allprop and propname in PROPFIND

This commit is contained in:
Simon Ser
2020-01-15 23:03:09 +01:00
parent ae0541654a
commit 4c4624e225
2 changed files with 39 additions and 4 deletions

View File

@@ -195,9 +195,11 @@ func (prop *Prop) XMLNames() []xml.Name {
// https://tools.ietf.org/html/rfc4918#section-14.20
type Propfind struct {
XMLName xml.Name `xml:"DAV: propfind"`
Prop *Prop `xml:"prop,omitempty"`
// TODO: propname | (allprop, include?)
XMLName xml.Name `xml:"DAV: propfind"`
Prop *Prop `xml:"prop,omitempty"`
AllProp *struct{} `xml:"allprop,omitempty"`
Include *Include `xml:"include,omitempty"`
PropName *struct{} `xml:"propname,omitempty"`
}
func xmlNamesToRaw(names []xml.Name) []RawXMLValue {
@@ -212,6 +214,12 @@ func NewPropNamePropfind(names ...xml.Name) *Propfind {
return &Propfind{Prop: &Prop{Raw: xmlNamesToRaw(names)}}
}
// https://tools.ietf.org/html/rfc4918#section-14.8
type Include struct {
XMLName xml.Name `xml:"DAV: include"`
Raw []RawXMLValue `xml:",any"`
}
// https://tools.ietf.org/html/rfc4918#section-15.9
type ResourceType struct {
XMLName xml.Name `xml:"DAV: resourcetype"`