@@ -38,23 +38,23 @@ def app
38
38
last_response . body . should == "Proxied App2"
39
39
end
40
40
41
- it "the response header should never contain Status" do
42
- stub_request ( :any , 'example.com/test/stuff' ) . to_return ( :headers => { 'Status' => '200 OK' } )
43
- get '/test/stuff'
44
- last_response . headers [ 'Status' ] . should == nil
45
- end
46
-
47
- it "the response header should never transfer-encoding" do
48
- stub_request ( :any , 'example.com/test/stuff' ) . to_return ( :headers => { 'transfer-encoding' => 'Chunked' } )
49
- get '/test/stuff'
50
- last_response . headers [ 'transfer-encoding' ] . should == nil
51
- end
52
-
53
- it "should set the Host header" do
54
- stub_request ( :any , 'example.com/test/stuff' )
55
- get '/test/stuff'
56
- a_request ( :get , 'http://example.com/test/stuff' ) . with ( :headers => { "Host" => "example.com" } ) . should have_been_made
57
- end
41
+ it "the response header should never contain Status" do
42
+ stub_request ( :any , 'example.com/test/stuff' ) . to_return ( :headers => { 'Status' => '200 OK' } )
43
+ get '/test/stuff'
44
+ last_response . headers [ 'Status' ] . should == nil
45
+ end
46
+
47
+ it "the response header should never transfer-encoding" do
48
+ stub_request ( :any , 'example.com/test/stuff' ) . to_return ( :headers => { 'transfer-encoding' => 'Chunked' } )
49
+ get '/test/stuff'
50
+ last_response . headers [ 'transfer-encoding' ] . should == nil
51
+ end
52
+
53
+ it "should set the Host header" do
54
+ stub_request ( :any , 'example.com/test/stuff' )
55
+ get '/test/stuff'
56
+ a_request ( :get , 'http://example.com/test/stuff' ) . with ( :headers => { "Host" => "example.com" } ) . should have_been_made
57
+ end
58
58
59
59
describe "with preserve host turned off" do
60
60
def app
@@ -108,9 +108,9 @@ def app
108
108
end
109
109
110
110
it "should throw an exception" do
111
- stub_request ( :get , 'http://example1.com/test' ) . to_return ( { :body => "Proxied App" } )
112
- get '/test'
113
- last_response . body . should == "Proxied App"
111
+ stub_request ( :get , 'http://example1.com/test' ) . to_return ( { :body => "Proxied App" } )
112
+ get '/test'
113
+ last_response . body . should == "Proxied App"
114
114
end
115
115
end
116
116
@@ -128,20 +128,20 @@ def app
128
128
end
129
129
end
130
130
131
- describe "with a https route" do
131
+ describe "with a https route" do
132
132
def app
133
133
Rack ::ReverseProxy . new ( dummy_app ) do
134
134
reverse_proxy '/test' , 'https://example.com'
135
135
end
136
136
end
137
137
138
- it "should make a secure request" do
138
+ it "should make a secure request" do
139
139
stub_request ( :get , 'https://example.com/test/stuff' ) . to_return ( { :body => "Proxied Secure App" } )
140
140
get '/test/stuff'
141
141
last_response . body . should == "Proxied Secure App"
142
- end
142
+ end
143
143
144
- end
144
+ end
145
145
146
146
describe "with a route as a string" do
147
147
def app
0 commit comments