diff --git a/lib/redmine_dmsf/webdav/dmsf_resource.rb b/lib/redmine_dmsf/webdav/dmsf_resource.rb index 64696e06..c945bc3f 100644 --- a/lib/redmine_dmsf/webdav/dmsf_resource.rb +++ b/lib/redmine_dmsf/webdav/dmsf_resource.rb @@ -525,7 +525,14 @@ module RedmineDmsf # Token based unlock (authenticated) will ensure that a correct token is sent, further ensuring # ownership of token before permitting unlock def unlock(token) - return NotFound unless exist? + unless exist? + puts ">>> exists? => false" + puts ">>> #{subproject&.name}" + puts ">>> #{folder&.title}" + puts ">>> #{file&.name}" + puts ">>> #{project&.name}" + return NotFound + end if token.nil? || token.empty? || (token == '<(null)>') || User.current.anonymous? BadRequest else diff --git a/test/integration/webdav/dmsf_webdav_unlock_test.rb b/test/integration/webdav/dmsf_webdav_unlock_test.rb index be72733c..5ac65a7a 100644 --- a/test/integration/webdav/dmsf_webdav_unlock_test.rb +++ b/test/integration/webdav/dmsf_webdav_unlock_test.rb @@ -123,6 +123,7 @@ class DmsfWebdavUnlockTest < RedmineDmsf::Test::IntegrationTest def test_unlock_folder log_user 'jsmith', 'jsmith' l = @folder2.locks.first + puts ">>> process unlock" process :unlock, "/dmsf/webdav/#{@folder2.project.identifier}/#{@folder2.dmsf_folder.title}/#{@folder2.title}", params: nil, headers: @jsmith.merge!({ HTTP_DEPTH: 'infinity', HTTP_TIMEOUT: 'Infinite', HTTP_LOCK_TOKEN: l.uuid })