incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davanum Srinivas <d...@apache.org>
Subject [PATCH] Fix for DTACLOUD-38: Bad URI's are reported when server started with -r 0.0.0.0
Date Wed, 28 Sep 2011 19:31:13 GMT
---
 server/lib/sinatra/url_for.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/server/lib/sinatra/url_for.rb b/server/lib/sinatra/url_for.rb
index 19a4fc7..707c64a 100644
--- a/server/lib/sinatra/url_for.rb
+++ b/server/lib/sinatra/url_for.rb
@@ -67,7 +67,7 @@ module Sinatra
         else
           port = ":#{port}"
         end
-        request_host = HOSTNAME ? HOSTNAME : request.host
+        request_host = (HOSTNAME && HOSTNAME!="0.0.0.0") ? HOSTNAME : request.host
         base = "#{scheme}://#{request_host}#{port}#{request.script_name}"
       else
         raise TypeError, "Unknown url_for mode #{mode}"
-- 
1.7.1


Mime
View raw message