Class: Bcms::WebDavMiddleware
- Inherits:
-
Object
- Object
- Bcms::WebDavMiddleware
- Defined in:
- lib/bcms_webdav/web_dav_middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ WebDavMiddleware
constructor
A new instance of WebDavMiddleware.
Constructor Details
#initialize(app, options = {}) ⇒ WebDavMiddleware
Returns a new instance of WebDavMiddleware.
7 8 9 10 11 12 13 14 15 |
# File 'lib/bcms_webdav/web_dav_middleware.rb', line 7 def initialize(app, ={}) @app = app @dav4rack = DAV4Rack::Handler.new(:root => Rails.root.to_s, :root_uri_path => '/', :log_to => ["#{Rails.root}/log/webdav.log", Logger::DEBUG], :resource_class=>Bcms::WebDAV::Resource) @options = unless @options[:subdomain] @options[:subdomain] = 'webdav' end end |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/bcms_webdav/web_dav_middleware.rb', line 17 def call(env) request = Rack::Request.new(env) if is_webdav?(request) return @dav4rack.call(env) else @app.call(env) end end |