lib/fakes3/server.rb in fakes3-1.0.0 vs lib/fakes3/server.rb in fakes3-1.1.0
- old
+ new
@@ -280,12 +280,17 @@
real_obj = @store.store_object(bucket_obj, key, s_req.webrick_request)
response['Etag'] = "\"#{real_obj.md5}\""
if success_action_redirect
- response.status = 307
+ object_params = [ [ :bucket, s_req.bucket ], [ :key, key ] ]
+ location_uri = URI.parse(success_action_redirect)
+ original_location_params = URI.decode_www_form(String(location_uri.query))
+ location_uri.query = URI.encode_www_form(original_location_params + object_params)
+
+ response.status = 303
response.body = ""
- response['Location'] = success_action_redirect
+ response['Location'] = location_uri.to_s
else
response.status = success_action_status || 204
if response.status == "201"
response.body = <<-eos.strip
<?xml version="1.0" encoding="UTF-8"?>