Skip to content

Commit

Permalink
Added specs for HTTPS
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhoerberg committed Nov 7, 2010
1 parent 93cfef1 commit 6843c27
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/rack/reverse_proxy_spec.rb
Expand Up @@ -12,6 +12,7 @@ def dummy_app
lambda { [200, {}, ['Dummy App']] }
end


describe "as middleware" do
def app
Rack::ReverseProxy.new(dummy_app) do
Expand Down Expand Up @@ -58,6 +59,20 @@ def app
end
end

describe "with a https route" do
def app
Rack::ReverseProxy.new(dummy_app) do
reverse_proxy '/test', 'https://example.com'
end
end

it "should rewrite HOST" do
stub_request(:get, 'https://example.com/test/stuff').with(:headers => {"Host" => "example.com"}).to_return({:body => "Proxied App"})
get '/test/stuff'
last_response.body.should == "Proxied App"
end
end

describe "with a route as a string" do
def app
Rack::ReverseProxy.new(dummy_app) do
Expand Down

0 comments on commit 6843c27

Please sign in to comment.