#716 dav4rack -> planio/dav4rack

This commit is contained in:
Karel Picman 2018-01-30 16:01:56 +01:00
parent bc73fb456b
commit cabcf78800
2 changed files with 0 additions and 29 deletions

View File

@ -60,9 +60,6 @@ module RedmineDmsf
# Does the object exist?
# If it is either a folder or a file, then it exists
def exist?
# # Allow anonymous HEAD requests from MsOffice
# return true if @request.request_method.downcase == 'head' && !@request.user_agent.nil? &&
# request.user_agent.downcase.include?('microsoft office')
self.project && self.project.module_enabled?('dmsf') && (self.folder || self.file) &&
(User.current.admin? || User.current.allowed_to?(:view_dmsf_folders, self.project))
end

View File

@ -86,20 +86,6 @@ class DmsfWebdavHeadTest < RedmineDmsf::Test::IntegrationTest
end
end
# def test_head_responds_to_file_anonymous_msoffice_user_agent
# head "/dmsf/webdav/#{@project1.identifier}/test.txt", nil, {:HTTP_USER_AGENT => 'Microsoft Office Word 2014'}
# assert_response :success
# check_headers_exist # Note it'll allow 1 out of the 3 expected to fail
#
# Setting.plugin_redmine_dmsf['dmsf_webdav_use_project_names'] = true
# if Setting.plugin_redmine_dmsf['dmsf_webdav_use_project_names'] == true
# head "/dmsf/webdav/#{@project1.identifier}/test.txt", nil,{:HTTP_USER_AGENT => 'Microsoft Office Word 2014'}
# assert_response 404
# head "/dmsf/webdav/#{@project1_uri}/test.txt", nil, {:HTTP_USER_AGENT => 'Microsoft Office Word 2014'}
# assert_response :success
# end
# end
def test_head_responds_to_file_anonymous_other_user_agent
head "/dmsf/webdav/#{@project1.identifier}/test.txt", nil, {:HTTP_USER_AGENT => 'Other'}
assert_response 401
@ -112,12 +98,6 @@ class DmsfWebdavHeadTest < RedmineDmsf::Test::IntegrationTest
check_headers_dont_exist
end
# def test_head_fails_when_file_not_found_anonymous_msoffice_user_agent
# head "/dmsf/webdav/#{@project1.identifier}/not_here.txt", nil, {:HTTP_USER_AGENT => 'Microsoft Office Word 2014'}
# assert_response :missing
# check_headers_dont_exist
# end
def test_head_fails_when_file_not_found_anonymous_other_user_agent
head "/dmsf/webdav/#{@project1.identifier}/not_here.txt", nil, {:HTTP_USER_AGENT => 'Other'}
assert_response 401
@ -130,12 +110,6 @@ class DmsfWebdavHeadTest < RedmineDmsf::Test::IntegrationTest
check_headers_dont_exist
end
# def test_head_fails_when_folder_not_found_anonymous_msoffice_user_agent
# head '/dmsf/webdav/folder_not_here', nil, {:HTTP_USER_AGENT => 'Microsoft Office Word 2014'}
# assert_response :missing
# check_headers_dont_exist
# end
def test_head_fails_when_folder_not_found_anonymous_other_user_agent
head '/dmsf/webdav/folder_not_here', nil, {:HTTP_USER_AGENT => 'Other'}
assert_response 401