You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2011/09/28 01:43:18 UTC
svn commit: r1176662 - /incubator/deltacloud/trunk/server/server.rb
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 <di...@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