Skip to content

Commit

Permalink
Fixing issues with rack-proxy and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Ehlert committed Nov 16, 2012
1 parent c6bbe0b commit 6500d8f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 21 deletions.
4 changes: 3 additions & 1 deletion Gemfile
@@ -1,3 +1,5 @@
source "http://rubygems.org"
source "https://rubygems.org"

gemspec

gem "rack-proxy", :git => 'git@github.com:tstmedia/rack-proxy.git'
15 changes: 10 additions & 5 deletions Gemfile.lock
@@ -1,18 +1,22 @@
GIT
remote: git@github.com:tstmedia/rack-proxy.git
revision: 2fc15874a150a847c5213104b3d7185f8a0492f0
specs:
rack-proxy (0.3.7)
rack

PATH
remote: .
specs:
rack-reverse-proxy (0.5.0)
rack (>= 1.0.0)
rack-proxy

GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
addressable (2.2.6)
crack (0.1.8)
rack (1.3.2)
rack-proxy (0.3.7)
rack
rack (1.4.1)
rack-test (0.5.7)
rack (>= 1.0)
rake (0.8.7)
Expand All @@ -25,6 +29,7 @@ PLATFORMS
ruby

DEPENDENCIES
rack-proxy!
rack-reverse-proxy!
rack-test (~> 0.5.7)
rake (~> 0.8.7)
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/reverse_proxy.rb
@@ -1,7 +1,7 @@
require 'net/http'
require 'net/https'
require "net_http_hacked"
require "rack/http_streaming_response"
require "rack-proxy"
require "rack/reverse_proxy_matcher"
require "rack/exception"

Expand Down
1 change: 0 additions & 1 deletion rack-reverse-proxy.gemspec
Expand Up @@ -37,6 +37,5 @@ Gem::Specification.new do |s|
s.add_development_dependency "rack-test", "~> 0.5.7"
s.add_development_dependency "webmock", "~> 1.5.0"
s.add_dependency "rack", ">= 1.0.0"
s.add_dependency "rack-proxy"
end

14 changes: 1 addition & 13 deletions spec/rack/reverse_proxy_spec.rb
Expand Up @@ -38,18 +38,6 @@ def app
last_response.body.should == "Proxied App2"
end

it "the response header should never contain Status" do
stub_request(:any, 'example.com/test/stuff').to_return(:headers => {'Status' => '200 OK'})
get '/test/stuff'
last_response.headers['Status'].should == nil
end

it "the response header should never transfer-encoding" do
stub_request(:any, 'example.com/test/stuff').to_return(:headers => {'transfer-encoding' => 'Chunked'})
get '/test/stuff'
last_response.headers['transfer-encoding'].should == nil
end

it "should set the Host header" do
stub_request(:any, 'example.com/test/stuff')
get '/test/stuff'
Expand Down Expand Up @@ -145,7 +133,7 @@ def app
end

it "should support subcaptures" do
stub_request(:get, 'http://example.com/path').to_return({:body => "Proxied App"})
stub_request(:get, 'http://example.com/test/path').to_return({:body => "Proxied App"})
get '/test/path'
last_response.body.should == "Proxied App"
end
Expand Down

0 comments on commit 6500d8f

Please sign in to comment.