From 34a7c0d0f8cf8550fbfd6481e5cd9c28dcc7db95 Mon Sep 17 00:00:00 2001 From: Wesley Beary Date: Thu, 24 Dec 2009 16:10:14 -0800 Subject: [PATCH] be less picky about keys for s3.objects.all(options), and CGI.escape the values passed to the call --- lib/fog/aws/models/s3/objects.rb | 2 +- lib/fog/aws/requests/s3/get_bucket.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fog/aws/models/s3/objects.rb b/lib/fog/aws/models/s3/objects.rb index ef9ddf6a1..8d43ff511 100644 --- a/lib/fog/aws/models/s3/objects.rb +++ b/lib/fog/aws/models/s3/objects.rb @@ -15,7 +15,7 @@ module Fog def all(options = {}) collection = bucket.collection.get( bucket.name, - options.reject {|key, value| !['delimiter', 'marker', 'max-keys', 'prefix'].include?(key)} + options ) collection && collection.objects end diff --git a/lib/fog/aws/requests/s3/get_bucket.rb b/lib/fog/aws/requests/s3/get_bucket.rb index 6a6c74f05..9c733ec54 100644 --- a/lib/fog/aws/requests/s3/get_bucket.rb +++ b/lib/fog/aws/requests/s3/get_bucket.rb @@ -39,7 +39,7 @@ unless Fog.mocking? end query = '' for key, value in options - query << "#{key}=#{value};" + query << "#{key}=#{CGI.escape(value).gsub(/\+/, '%20')};" end query.chop! request({