class Tilia::Dav::Browser::MapGetToPropFind

This is a simple plugin that will map any GET request for non-files to PROPFIND allprops-requests.

This should allow easy debugging of PROPFIND

Public Instance Methods

http_get(request, response) click to toggle source

This method intercepts GET requests to non-files, and changes it into an HTTP PROPFIND request

@param RequestInterface request @param ResponseInterface response @return bool

# File lib/tilia/dav/browser/map_get_to_prop_find.rb, line 28
def http_get(request, response)
  node = @server.tree.node_for_path(request.path)
  return nil if node.is_a?(IFile)

  sub_request = request.clone
  sub_request.method = 'PROPFIND'

  @server.invoke_method(sub_request, response)
  false
end
setup(server) click to toggle source

Initializes the plugin and subscribes to events

@param DAVServer server @return void

# File lib/tilia/dav/browser/map_get_to_prop_find.rb, line 18
def setup(server)
  @server = server
  @server.on('method:GET', method(:http_get), 90)
end