Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* applied propfind/proppatch patch from an user. Thanks!

  • Loading branch information...
commit 9192e7d8cdbf0913dd518b7ee055db35e4c48482 1 parent d0870cb
nahi authored
Showing with 21 additions and 1 deletion.
  1. +19 −1 lib/httpclient.rb
  2. +2 −0  test/runner.rb
View
20 lib/httpclient.rb
@@ -1744,7 +1744,7 @@ def check_state
attr_reader :www_auth
class << self
- %w(get_content head get post put delete options trace).each do |name|
+ %w(get_content head get post put delete options propfind trace).each do |name|
eval <<-EOD
def #{name}(*arg)
new.#{name}(*arg)
@@ -1756,6 +1756,8 @@ def #{name}(*arg)
class RetryableResponse < StandardError # :nodoc:
end
+ PROPFIND_DEFAULT_EXTHEADER = { 'Depth' => '0' }
+
# SYNOPSIS
# Client.new(proxy = nil, agent_name = nil, from = nil)
#
@@ -1982,6 +1984,14 @@ def options(uri, extheader = {}, &block)
request('OPTIONS', uri, nil, nil, extheader, &block)
end
+ def propfind(uri, query = nil, body = nil, extheader = PROPFIND_DEFAULT_EXTHEADER, &block)
+ request('PROPFIND', uri, query, body, extheader, &block)
+ end
+
+ def proppatch(path, body, extheader = {}, &block)
+ request('PROPPATCH', uri, query, body, extheader, &block)
+ end
+
def trace(uri, query = nil, body = nil, extheader = {}, &block)
request('TRACE', uri, query, body, extheader, &block)
end
@@ -2032,6 +2042,14 @@ def options_async(uri, extheader = {})
request_async('OPTIONS', uri, nil, nil, extheader)
end
+ def propfind_async(uri, query = nil, body = nil, extheader = PROPFIND_DEFAULT_EXTHEADER)
+ request_async('PROPFIND', uri, query, body, extheader)
+ end
+
+ def proppatch_async(path, body, extheader = {})
+ request_async('PROPPATCH', uri, query, body, extheader)
+ end
+
def trace_async(uri, query = nil, body = nil, extheader = {})
request_async('TRACE', uri, query, body, extheader)
end
View
2  test/runner.rb
@@ -0,0 +1,2 @@
+require 'test/unit'
+exit Test::Unit::AutoRunner.run(true, File.dirname($0))
Please sign in to comment.
Something went wrong with that request. Please try again.