From 385bcb95b3fe5dfc704934bdaf10cd79ddc32b47 Mon Sep 17 00:00:00 2001 From: pavel Date: Fri, 18 Sep 2020 19:37:16 +0200 Subject: [PATCH] remove deprecated URI.escape/unescape --- lib/redmine_dmsf/webdav/base_resource.rb | 5 +++-- test/integration/webdav/dmsf_webdav_get_test.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/redmine_dmsf/webdav/base_resource.rb b/lib/redmine_dmsf/webdav/base_resource.rb index d21f2bbe..126e515b 100644 --- a/lib/redmine_dmsf/webdav/base_resource.rb +++ b/lib/redmine_dmsf/webdav/base_resource.rb @@ -21,6 +21,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. require 'dav4rack' +require 'addressable/uri' module RedmineDmsf module Webdav @@ -88,7 +89,7 @@ module RedmineDmsf Confict unless collection? entities = children.map{ |child| DIR_FILE % [ - "#{@options[:root_uri_path]}#{URI.encode(child.path)}", + "#{@options[:root_uri_path]}#{Addressable::URI.encode(child.path)}", child.long_name || child.name, child.collection? ? '' : number_to_human_size(child.content_length), child.special_type || child.content_type, @@ -96,7 +97,7 @@ module RedmineDmsf ] } * "\n" entities = DIR_FILE % [ - URI.encode(parent.public_path), + Addressable::URI.encode(parent.public_path), l(:parent_directory), '', '', diff --git a/test/integration/webdav/dmsf_webdav_get_test.rb b/test/integration/webdav/dmsf_webdav_get_test.rb index 81c8eece..5e0905a9 100644 --- a/test/integration/webdav/dmsf_webdav_get_test.rb +++ b/test/integration/webdav/dmsf_webdav_get_test.rb @@ -47,7 +47,7 @@ class DmsfWebdavGetTest < RedmineDmsf::Test::IntegrationTest assert !response.body.match(@project1.identifier).nil?, "Expected to find project #{@project1.identifier} in return data" Setting.plugin_redmine_dmsf['dmsf_webdav_use_project_names'] = true - project1_uri = URI.encode(RedmineDmsf::Webdav::ProjectResource.create_project_name(@project1)) + project1_uri = Addressable::URI.encode(RedmineDmsf::Webdav::ProjectResource.create_project_name(@project1)) get '/dmsf/webdav', params: nil, headers: @admin assert_response :success assert_no_match @project1.identifier, response.body