You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2012/07/31 14:33:27 UTC

[PATCH core 3/5] CIMI: Replaced return by 'halt' in force_auth

From: Michal Fojtik <mf...@redhat.com>

* Use the Sinatra 'halt' helper instead of return
  to make sure the correct HTTP status code is being
  delivered to the client.

Signed-off-by: Michal fojtik <mf...@redhat.com>
---
 server/lib/cimi/collections/cloud_entry_point.rb |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/lib/cimi/collections/cloud_entry_point.rb b/server/lib/cimi/collections/cloud_entry_point.rb
index 5aa2630..6371a06 100644
--- a/server/lib/cimi/collections/cloud_entry_point.rb
+++ b/server/lib/cimi/collections/cloud_entry_point.rb
@@ -22,7 +22,7 @@ module CIMI::Collections
         description "list all resources of the cloud"
         control do
           if params[:force_auth]
-            return [401, 'Authentication failed'] unless driver.valid_credentials?(credentials)
+            halt 401 unless driver.valid_credentials?(credentials)
           end
           entry_point = CIMI::Model::CloudEntryPoint.create(self)
           respond_to do |format|
-- 
1.7.10.2