summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-07-18 15:16:50 +0100
committerThom May <thom@chef.io>2016-07-18 15:16:50 +0100
commit2d7b0404e9011ed1b9f6b8c54a323af8a1138563 (patch)
tree8cb6a92a19053c4f50f1ad9bac2956342ff80ebe
parent8643590c12b730fb6102f80ce6586447b212a27a (diff)
downloadchef-tm/escape_zero_uris.tar.gz
Escape cookbook file URIs.tm/escape_zero_uris
Signed-off-by: Thom May <thom@may.lt>
-rw-r--r--lib/chef/cookbook/synchronizer.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/cookbook/synchronizer.rb b/lib/chef/cookbook/synchronizer.rb
index 1ee30bacc7..d83283480c 100644
--- a/lib/chef/cookbook/synchronizer.rb
+++ b/lib/chef/cookbook/synchronizer.rb
@@ -2,6 +2,7 @@ require "chef/client"
require "chef/util/threaded_job_queue"
require "chef/server_api"
require "singleton"
+require "uri"
class Chef
@@ -279,7 +280,7 @@ class Chef
# downloaded to the path +destination+ which is relative to the Chef file
# cache root.
def download_file(url, destination)
- raw_file = server_api.streaming_request(url)
+ raw_file = server_api.streaming_request(URI.escape(url))
Chef::Log.info("Storing updated #{destination} in the cache.")
cache.move_to(raw_file.path, destination)