Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

propfind: Allow user to specify depth, default to depth of 1. #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions lib/net/dav.rb
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,20 @@ def headers(headers)
# how to retrieve access control properties.
def propfind(path,*options)
headers = {'Depth' => '1'}
if(options[0] == :acl)
body = '<?xml version="1.0" encoding="utf-8" ?><D:propfind xmlns:D="DAV:"><D:prop><D:owner/>' +
'<D:supported-privilege-set/><D:current-user-privilege-set/><D:acl/></D:prop></D:propfind>'
else
acl_body = '<?xml version="1.0" encoding="utf-8" ?><D:propfind xmlns:D="DAV:"><D:prop><D:owner/>' +
'<D:supported-privilege-set/><D:current-user-privilege-set/><D:acl/></D:prop></D:propfind>'
if options.size == 1
if (options[0] == :acl)
body = acl_body
else
body = options[0]
end
elsif options.size == 2
body = options[0]
if options[1].is_a? Hash
opts = options[1]
headers['Depth'] = opts[:depth] if opts.include? :depth
end
end
if(!body)
body = '<?xml version="1.0" encoding="utf-8"?><DAV:propfind xmlns:DAV="DAV:"><DAV:allprop/></DAV:propfind>'
Expand Down