deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 3/8] CIMI: Replaced return by 'halt' in force_auth
Date Fri, 03 Aug 2012 13:15:26 GMT
From: Michal Fojtik <mfojtik@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 <mfojtik@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


Mime
View raw message