You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ma...@redhat.com on 2011/07/15 11:03:49 UTC

Fix response codes for get/set blob metadata (200==>204)

Get and set blob metadata do not return a message body. Rather they return the blob metadata (either existing or updated) in the X-Deltacloud-Blobmeta headers. Thus I think the response code should be 204 No Content rather than 200 OK.

marios

Re: [PATCH] Fix response codes for get/set blob metadata. Both these calls do not return a message body, so status should be 204 No Content.

Posted by David Lutterkort <lu...@redhat.com>.
On Fri, 2011-07-15 at 12:03 +0300, marios@redhat.com wrote:
> From: marios <ma...@redhat.com>

ACK



[PATCH] Fix response codes for get/set blob metadata. Both these calls do not return a message body, so status should be 204 No Content.

Posted by ma...@redhat.com.
From: marios <ma...@redhat.com>


Signed-off-by: marios <ma...@redhat.com>
---
 server/server.rb |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/server/server.rb b/server/server.rb
index 294cf05..5183542 100644
--- a/server/server.rb
+++ b/server/server.rb
@@ -795,6 +795,10 @@ head "#{Sinatra::UrlForHelper::DEFAULT_URI_PREFIX}/buckets/:bucket/:blob" do
       @blob_metadata.each do |k,v|
         headers["X-Deltacloud-Blobmeta-#{k}"] = v
       end
+      respond_to do |format|
+        format.xml {  204 }
+        format.json {  204 }
+      end
    else
     report_error(404)
   end
@@ -808,6 +812,10 @@ post "#{Sinatra::UrlForHelper::DEFAULT_URI_PREFIX}/buckets/:bucket/:blob" do
     meta_hash.each do |k,v|
       headers["X-Deltacloud-Blobmeta-#{k}"] = v
     end
+    respond_to do |format|
+      format.xml {  204 }
+      format.json {  204 }
+    end
   else
     report_error(404) #FIXME is this the right error code?
   end
-- 
1.7.3.4