lib/terminus/proxy/external.rb in terminus-0.3.0 vs lib/terminus/proxy/external.rb in terminus-0.4.0

- old
+ new

@@ -9,15 +9,24 @@ def rewrite_env(env) env = env.dup env['SERVER_NAME'] = @uri.host env['SERVER_PORT'] = @uri.port env['HTTP_HOST'] = "#{@uri.host}:#{@uri.port}" + env.delete('HTTP_ACCEPT_ENCODING') + + if scheme = @uri.scheme + env['rack.url_scheme'] = scheme + end + env end def call(env) + dock_host = env['SERVER_NAME'] response = super + response[1].delete('transfer-encoding') response[2].extend(Rewrite) + response[2].dock_host = dock_host response end end end