diff options
author | Thom May <thom@may.lt> | 2016-07-19 18:38:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-19 18:38:12 +0100 |
commit | 903dd0fbbed02098c8c424df3393b10f873a5da5 (patch) | |
tree | 3b69e2184dda8360fda60b2666b5cac9af705f16 /lib | |
parent | 4c8bf05a397a2954db2ec519299097e6dbd73d3e (diff) | |
parent | 5628767a865ac9bf882c2fa5f4441ba66579a747 (diff) | |
download | chef-zero-903dd0fbbed02098c8c424df3393b10f873a5da5.tar.gz |
Merge pull request #204 from byplayer/feature/uri_escape
support URI specific character in file name
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef_zero/rest_base.rb | 3 |
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) |