WebDAV: PROPFIND to "/" and "/dmsf" throws FATAL error #598

This commit is contained in:
Karel Picman 2016-11-28 15:17:26 +01:00
parent d7a0d8e2e3
commit e1209a6148
2 changed files with 8 additions and 3 deletions

View File

@ -112,12 +112,16 @@ RedmineApp::Application.routes.draw do
# #
# DAV4Rack implementation of Webdav # DAV4Rack implementation of Webdav
mount DAV4Rack::Handler.new( dav_engine = DAV4Rack::Handler.new(
:root_uri_path => "#{Redmine::Utils::relative_url_root}/dmsf/webdav", :root_uri_path => "#{Redmine::Utils::relative_url_root}/dmsf/webdav",
:resource_class => RedmineDmsf::Webdav::ResourceProxy, :resource_class => RedmineDmsf::Webdav::ResourceProxy,
:controller_class => RedmineDmsf::Webdav::Controller, :controller_class => RedmineDmsf::Webdav::Controller,
:log_to => Rails.logger :log_to => Rails.logger
), :at => '/dmsf/webdav' if defined?(RedmineDmsf) )
mount dav_engine, :at => '/dmsf/webdav'
mount dav_engine, :at => '/', :via => :options
mount dav_engine, :at => '/', :via => :propfind
mount dav_engine, :at => '/dmsf', :via => :propfind
# Approval workflow # Approval workflow
resources :dmsf_workflows do resources :dmsf_workflows do

View File

@ -71,7 +71,8 @@ module RedmineDmsf
# Return response to PROPFIND # Return response to PROPFIND
def propfind def propfind
unless(resource.exist?) return MethodNotAllowed if resource && !resource.public_path.start_with?('/dmsf/webdav')
unless resource.exist?
NotFound NotFound
else else
# Win7 hack start # Win7 hack start