23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/capcode/render/webdav.rb', line 23
def render_webdav( f, opts )
options = {
:resource_class => RackDAV::FileResource,
:root => f
}.merge(opts)
request = Rack::Request.new(env)
response = Rack::Response.new
begin
controller = RackDAV::Controller.new(request, response, options.dup)
controller.send(request.request_method.downcase)
rescue RackDAV::HTTPStatus::Status => status
response.status = status.code
end
response.body = [response.body] if not response.body.respond_to? :each
response.status = response.status ? response.status.to_i : 200
response.finish
[response.status, response., response.body]
end
|