You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by Davanum Srinivas <di...@apache.org> on 2011/09/26 15:38:08 UTC
[PATCH] [PATCH] Fix for DTACLOUD-18 : Missing Host header not handled
---
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
Re: [PATCH] [PATCH] Fix for DTACLOUD-18 : Missing Host header not
handled
Posted by David Lutterkort <lu...@redhat.com>.
ACK. Committed. Since I committed your other patch first, had to do this
by hand, too. Sorry about the confusion.
David
On Mon, 2011-09-26 at 09:38 -0400, Davanum Srinivas wrote:
> ---
> 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
>