Merge pull request #1176 from ahorek/uriescape

remove deprecated URI.escape/unescape
This commit is contained in:
Karel Picman 2020-09-19 06:45:25 +02:00 committed by GitHub
commit 538a9baa91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -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),
'',
'',

View File

@ -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