From 7c899cf657241e5cce2b8b47838a9a545f2ba4b5 Mon Sep 17 00:00:00 2001 From: Alex Zepeda Date: Mon, 26 Mar 2012 11:55:07 -0700 Subject: [PATCH] propfind: Allow user to specify depth, default to depth of 1. --- lib/net/dav.rb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/net/dav.rb b/lib/net/dav.rb index 4528c09..03bb7f4 100644 --- a/lib/net/dav.rb +++ b/lib/net/dav.rb @@ -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 = '' + - '' - else + acl_body = '' + + '' + 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 = ''