incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject svn commit: r1176662 - /incubator/deltacloud/trunk/server/server.rb
Date Tue, 27 Sep 2011 23:43:18 GMT
Author: lutter
Date: Tue Sep 27 23:43:18 2011
New Revision: 1176662

URL: http://svn.apache.org/viewvc?rev=1176662&view=rev
Log:
* server/server.rb: respond with status 400 when Host header is missing

Fixes DTACLOUD-18

Signed-off-by: Davanum Srinivas <dims@apache.org>

Modified:
    incubator/deltacloud/trunk/server/server.rb

Modified: incubator/deltacloud/trunk/server/server.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/server.rb?rev=1176662&r1=1176661&r2=1176662&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/server.rb (original)
+++ incubator/deltacloud/trunk/server/server.rb Tue Sep 27 23:43:18 2011
@@ -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
+
 after do
   headers 'Server' => 'Apache-Deltacloud/' + settings.version
 end



Mime
View raw message