From: Michal Fojtik <[email protected]>

* 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 <[email protected]>
---
 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

Reply via email to