Permalink
Browse files

cache name and key name now encoded

  • Loading branch information...
1 parent ac2f195 commit fb2292342b3648dc084a08124898624ac786e7f4 @thousandsofthem thousandsofthem committed May 10, 2012
Showing with 6 additions and 2 deletions.
  1. +3 −1 lib/iron_cache/caches.rb
  2. +3 −1 lib/iron_cache/items.rb
View
@@ -1,3 +1,5 @@
+require 'uri'
+
module IronCache
class Caches
@@ -25,7 +27,7 @@ def list(options={})
# options:
# :name => can specify an alternative queue name
def get(options={})
- res, status = @client.get("#{path(options)}/#{options[:name]}")
+ res, status = @client.get("#{path(options)}/#{URI.escape options[:name]}")
return Cache.new(self, res)
end
View
@@ -1,3 +1,5 @@
+require 'uri'
+
module IronCache
class Items
@@ -8,7 +10,7 @@ def initialize(client)
end
def path(key, options={})
- path = "projects/#{@client.project_id}/caches/#{options[:cache_name] || @client.cache_name}/items/#{key}"
+ path = "projects/#{@client.project_id}/caches/#{URI.escape(options[:cache_name] || @client.cache_name)}/items/#{URI.escape key}"
end
# options:

0 comments on commit fb22923

Please sign in to comment.