lib/darkext/sinatra.rb in darkhelmet-darkext-0.11.2 vs lib/darkext/sinatra.rb in darkhelmet-darkext-0.12.0
- old
+ new
@@ -32,12 +32,10 @@
session[:flash] = {} if session[:flash] && session[:flash].class != Hash
session[:flash] ||= {}
end
def host
- port = request.env['SERVER_PORT'].to_i
- port = port == 80 ? "" : ":#{port}"
- "#{protocol}://#{server_name}#{port}"
+ "#{protocol}://#{request.env['HTTP_HOST']}"
end
def protocol
request.env['rack.url_scheme']
end