Permalink
Browse files

Emit debug messages after header manipulation

  • Loading branch information...
1 parent d1b574b commit bbe7855695d3b0128d3e1123ef9c5b6dbef5086d @blakewatters blakewatters committed Apr 12, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/rack/reverse_proxy.rb
@@ -25,8 +25,7 @@ def call(env)
end
}
headers['HOST'] = uri.host if all_opts[:preserve_host]
- headers['X-Forwarded-Host'] = rackreq.host if all_opts[:x_forwarded_host]
- puts "Proxying #{rackreq.url} => #{uri} (Headers: #{headers.inspect})" if all_opts[:debug]
+ headers['X-Forwarded-Host'] = rackreq.host if all_opts[:x_forwarded_host]
if headers_opt = all_opts[:headers]
if headers_opt.is_a?(Proc)
@@ -38,6 +37,7 @@ def call(env)
end
end
+ puts "Proxying #{rackreq.url} => #{uri} (Headers: #{headers.inspect})" if all_opts[:debug]
session = Net::HTTP.new(uri.host, uri.port)
session.read_timeout=all_opts[:timeout] if all_opts[:timeout]

0 comments on commit bbe7855

Please sign in to comment.