lib/octoparts/client.rb in octoparts-0.0.9 vs lib/octoparts/client.rb in octoparts-0.1.0
- old
+ new
@@ -56,10 +56,11 @@
end
private
def post_cache_api(path)
- escaped_path = URI.escape("#{CACHE_API_ENDPOINT_PATH}#{path}")
+ encoded_path_segments = path.split('/').map { |seg| URI.encode_www_form_component(seg) }.join('/')
+ escaped_path = "#{CACHE_API_ENDPOINT_PATH}#{encoded_path_segments}"
resp = post(escaped_path)
Response.new(
resp.body,
resp.headers,
resp.status