mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-22 16:24:14 +00:00
Ensure resourcetype is always defined
This commit is contained in:
parent
34b2ebf940
commit
bf666bb2fb
@ -120,6 +120,12 @@ type PropfindFunc func(raw *RawXMLValue) (interface{}, error)
|
|||||||
func NewPropfindResponse(href string, propfind *Propfind, props map[xml.Name]PropfindFunc) (*Response, error) {
|
func NewPropfindResponse(href string, propfind *Propfind, props map[xml.Name]PropfindFunc) (*Response, error) {
|
||||||
resp := NewOKResponse(href)
|
resp := NewOKResponse(href)
|
||||||
|
|
||||||
|
if _, ok := props[ResourceTypeName]; !ok {
|
||||||
|
props[ResourceTypeName] = func(*RawXMLValue) (interface{}, error) {
|
||||||
|
return NewResourceType(), nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if propfind.PropName != nil {
|
if propfind.PropName != nil {
|
||||||
for xmlName, _ := range props {
|
for xmlName, _ := range props {
|
||||||
emptyVal := NewRawXMLElement(xmlName, nil, nil)
|
emptyVal := NewRawXMLElement(xmlName, nil, nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user