From 95adfff6ab5005fc49a25925c2fcddd201454e21 Mon Sep 17 00:00:00 2001 From: Garret Alfert Date: Mon, 22 Oct 2012 12:59:07 +0200 Subject: [PATCH] Just respond with an empty body on PUT requests --- lib/remote_storage/riak.rb | 2 ++ spec/riak_spec.rb | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/remote_storage/riak.rb b/lib/remote_storage/riak.rb index a316b73..4593184 100644 --- a/lib/remote_storage/riak.rb +++ b/lib/remote_storage/riak.rb @@ -78,6 +78,8 @@ module RemoteStorage object.reload timestamp = object.last_modified.to_i update_all_directory_objects(user, directory, timestamp) + + halt 200 rescue ::Riak::HTTPFailedRequest halt 422 end diff --git a/spec/riak_spec.rb b/spec/riak_spec.rb index 0962337..7088b00 100644 --- a/spec/riak_spec.rb +++ b/spec/riak_spec.rb @@ -84,6 +84,7 @@ describe "App with Riak backend" do it "saves the value" do last_response.status.must_equal 200 + last_response.body.must_equal "" data_bucket.get("jimmy:documents:bar").data.must_equal "another text" end