summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbyplayer <byplayer100@gmail.com>2016-03-10 15:19:20 +0800
committerbyplayer <byplayer100@gmail.com>2016-03-10 15:19:20 +0800
commit5628767a865ac9bf882c2fa5f4441ba66579a747 (patch)
tree89a978d7fb944d08538d35254cb3610374eaa417
parent601cfb2079ec394aa25cd9f75073dbadc1b67259 (diff)
downloadchef-zero-5628767a865ac9bf882c2fa5f4441ba66579a747.tar.gz
support URI specific character in file name
-rw-r--r--lib/chef_zero/rest_base.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef_zero/rest_base.rb b/lib/chef_zero/rest_base.rb
index 71f6f15..f86ece6 100644
--- a/lib/chef_zero/rest_base.rb
+++ b/lib/chef_zero/rest_base.rb
@@ -80,6 +80,7 @@ module ChefZero
def get_data(request, rest_path=nil, *options)
rest_path ||= request.rest_path
+ rest_path = rest_path.map { |v| URI.decode(v) }
begin
data_store.get(rest_path, request)
rescue DataStore::DataNotFoundError
@@ -276,7 +277,7 @@ module ChefZero
end
def self.build_uri(base_uri, rest_path)
- "#{base_uri}/#{rest_path.join('/')}"
+ "#{base_uri}/#{rest_path.map { |v| URI.escape(v) }.join('/')}"
end
def populate_defaults(request, response)