diff --git a/lib/remote_storage/swift.rb b/lib/remote_storage/swift.rb index aa6c3a3..f1fad41 100644 --- a/lib/remote_storage/swift.rb +++ b/lib/remote_storage/swift.rb @@ -133,7 +133,7 @@ module RemoteStorage def put_data(user, directory, key, data, content_type) server.halt 400 if server.env["HTTP_CONTENT_RANGE"] - server.halt 409 if has_name_collision?(user, directory, key) + server.halt 409, "Conflict" if has_name_collision?(user, directory, key) existing_metadata = redis.hgetall redis_metadata_object_key(user, directory, key) url = url_for_key(user, directory, key) diff --git a/spec/swift/app_spec.rb b/spec/swift/app_spec.rb index fd70aa4..0206d43 100644 --- a/spec/swift/app_spec.rb +++ b/spec/swift/app_spec.rb @@ -134,6 +134,7 @@ describe "App" do end last_response.status.must_equal 409 + last_response.body.must_equal "Conflict" metadata = redis.hgetall "rs:m:phil:food" metadata.must_be_empty