MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / allprop

Function allprop

server/webdav/prop.go:266–282  ·  view source on GitHub ↗

Allprop returns the properties defined for resource name and the properties named in include. Note that RFC 4918 defines 'allprop' to return the DAV: properties defined within the RFC plus dead properties. Other live properties should only be returned if they are named in 'include'. See http://www

(ctx context.Context, ls LockSystem, fi model.Obj, include []xml.Name)

Source from the content-addressed store, hash-verified

264//
265// See http://www.webdav.org/specs/rfc4918.html#METHOD_PROPFIND
266func allprop(ctx context.Context, ls LockSystem, fi model.Obj, include []xml.Name) ([]Propstat, error) {
267 pnames, err := propnames(ctx, ls, fi)
268 if err != nil {
269 return nil, err
270 }
271 // Add names from include if they are not already covered in pnames.
272 nameset := make(map[xml.Name]bool)
273 for _, pn := range pnames {
274 nameset[pn] = true
275 }
276 for _, pn := range include {
277 if !nameset[pn] {
278 pnames = append(pnames, pn)
279 }
280 }
281 return props(ctx, ls, fi, pnames)
282}
283
284// Patch patches the properties of resource name. The return values are
285// constrained in the same manner as DeadPropsHolder.Patch.

Callers 1

handlePropfindMethod · 0.85

Calls 2

propnamesFunction · 0.85
propsFunction · 0.70

Tested by

no test coverage detected