OPTION and PROPFIND request on the parent path

This commit is contained in:
Karel Pičman 2020-02-04 14:53:11 +01:00
parent 7d006044f3
commit 42fdf27303
3 changed files with 8 additions and 5 deletions

View File

@ -165,5 +165,8 @@ if Redmine::Plugin.installed? :redmine_dmsf
end
end
# WebDAV
match '/', to: lambda { |env| [405, {}, [env.to_s]] }, via: [:propfind, :options]
match '/dmsf', to: lambda { |env| [405, {}, [env.to_s]] }, via: [:propfind, :options]
end
end

View File

@ -57,7 +57,7 @@ module RedmineDmsf
# If the URL map generated by Rack::Builder did not find a matching path,
# it will return a 404 along with the X-Cascade header set to 'pass'.
if (status == 404) && (headers['X-Cascade'] == 'pass')
@rails_app.call env # Let Rails handle the request
@rails_app.call env # let Rails handle the request
else
[status, headers, body]
end

View File

@ -34,22 +34,22 @@ class DmsfWebdavCustomMiddlewareTest < RedmineDmsf::Test::IntegrationTest
def test_options_for_root_path
process :options, '/'
assert_response :not_found
assert_response :method_not_allowed
end
def test_options_for_dmsf_root_path
process :options, '/dmsf'
assert_response :not_found
assert_response :method_not_allowed
end
def test_propfind_for_root_path
process :propfind, '/'
assert_response :not_found
assert_response :method_not_allowed
end
def test_propfind_for_dmsf_root_path
process :propfind, '/dmsf'
assert_response :not_found
assert_response :method_not_allowed
end
def test_webdav_not_enabled