On 07/02/11 17:45, Michal Fojtik wrote:
On 02/02/11 22:05 +0200, [email protected] wrote:

ACK. Code looks good, just small inline comment about returning some
content / status code from HEAD and POST blocks.

+#get blob metadata
+head '/api/buckets/:bucket/:blob' do
+ @blob_id = params[:blob]
+ @blob_metadata = driver.blob_metadata(credentials, {:id =>
params[:blob], 'bucket' => params[:bucket]})
+ if @blob_metadata
+ @blob_metadata.each do |k,v|
+ headers["X-Deltacloud-Blobmeta-#{k}"] = v
+ end
+ else
+ report_error(404, 'not_found')
+ end

Please return something here, otherwise the 'each' return value will be
sent ;-) I'm used to return '[200, '']' on HEAD calls.


I am returning something - I'm setting the response headers to include HTTP-X-Deltacloud-Blobmeta-KEY:Value for all blob metadata pairs.

<Copy_Paste>:

curl -I --user 'username:password' http://localhost:3001/api/buckets/mariosshinymsftbucket/anamazingimportantfile?format=xml
HTTP/1.1 200 OK
X-Runtime: 2.722210
X-Deltacloud-Blobmeta-mynewkey: MYNEWVALUE
Content-Type: text/html
Connection: close
Server: thin 1.2.7 codename No Hup

</Copy_Paste>



marios

Reply via email to