File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,16 @@ def app
92
92
) . to have_been_made
93
93
end
94
94
95
+ it "sets the X-Forwarded-Port header to the proxying port by default" do
96
+ stub_request ( :any , "example.com/test/stuff" )
97
+ get "/test/stuff"
98
+ expect (
99
+ a_request ( :get , "http://example.com/test/stuff" ) . with (
100
+ :headers => { "X-Forwarded-Port" => "80" }
101
+ )
102
+ ) . to have_been_made
103
+ end
104
+
95
105
it "does not produce headers with a Status key" do
96
106
stub_request ( :get , "http://example.com/2test" ) . to_return (
97
107
:status => 301 , :headers => { :status => "301 Moved Permanently" }
@@ -194,6 +204,17 @@ def app
194
204
) . not_to have_been_made
195
205
expect ( a_request ( :get , "http://example.com/test/stuff" ) ) . to have_been_made
196
206
end
207
+
208
+ it "does not set the X-Forwarded-Port header to the proxying port" do
209
+ stub_request ( :any , "example.com/test/stuff" )
210
+ get "/test/stuff"
211
+ expect (
212
+ a_request ( :get , "http://example.com/test/stuff" ) . with (
213
+ :headers => { "X-Forwarded-Port" => "80" }
214
+ )
215
+ ) . not_to have_been_made
216
+ expect ( a_request ( :get , "http://example.com/test/stuff" ) ) . to have_been_made
217
+ end
197
218
end
198
219
199
220
describe "with timeout configuration" do
You can’t perform that action at this time.
0 commit comments