Skip to content

Commit 6843c27

Browse files
committed
Added specs for HTTPS
1 parent 93cfef1 commit 6843c27

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

spec/rack/reverse_proxy_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def dummy_app
1212
lambda { [200, {}, ['Dummy App']] }
1313
end
1414

15+
1516
describe "as middleware" do
1617
def app
1718
Rack::ReverseProxy.new(dummy_app) do
@@ -58,6 +59,20 @@ def app
5859
end
5960
end
6061

62+
describe "with a https route" do
63+
def app
64+
Rack::ReverseProxy.new(dummy_app) do
65+
reverse_proxy '/test', 'https://example.com'
66+
end
67+
end
68+
69+
it "should rewrite HOST" do
70+
stub_request(:get, 'https://example.com/test/stuff').with(:headers => {"Host" => "example.com"}).to_return({:body => "Proxied App"})
71+
get '/test/stuff'
72+
last_response.body.should == "Proxied App"
73+
end
74+
end
75+
6176
describe "with a route as a string" do
6277
def app
6378
Rack::ReverseProxy.new(dummy_app) do

0 commit comments

Comments
 (0)