Skip to content

Commit 8195c78

Browse files
committed
Fix :preserve_host spec
It previously did not test the :preserve_host option at all, but still passed due to an overly-loose assertion. I tightened it up.
1 parent fb29497 commit 8195c78

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spec/rack/reverse_proxy_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,14 @@ def app
5959
describe "with preserve host turned off" do
6060
def app
6161
Rack::ReverseProxy.new(dummy_app) do
62-
reverse_proxy '/test', 'http://example.com/'
62+
reverse_proxy '/test', 'http://example.com/', {:preserve_host => false}
6363
end
6464
end
6565

6666
it "should not set the Host header" do
6767
stub_request(:any, 'example.com/test/stuff')
6868
get '/test/stuff'
69+
a_request(:get, 'http://example.com/test/stuff').with(:headers => {"Host" => "example.com"}).should_not have_been_made
6970
a_request(:get, 'http://example.com/test/stuff').should have_been_made
7071
end
7172
end

0 commit comments

Comments
 (0)