deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davanum Srinivas <d...@apache.org>
Subject [PATCH] [PATCH] Fix for DTACLOUD-18 : Missing Host header not handled
Date Mon, 26 Sep 2011 13:38:08 GMT
---
 server/server.rb |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/server/server.rb b/server/server.rb
index 072e888..9d9035c 100644
--- a/server/server.rb
+++ b/server/server.rb
@@ -77,6 +77,11 @@ error do
   report_error
 end
 
+before do
+  # Respond with 400, If we don't get a http Host header,
+  halt 400, "Unable to find HTTP Host header" if @env['HTTP_HOST'] == nil
+end
+
 # Redirect to /api
 get '/' do redirect root_url, 301; end
 
-- 
1.7.1


Mime
View raw message