Skip to content

Commit 9731969

Browse files
committed
Add test for content-length
1 parent df0e18c commit 9731969

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spec/rack/reverse_proxy_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ def app
119119
expect(headers["x-additional-info"]).to be_nil
120120
end
121121

122+
it "the response header includes content-length" do
123+
body = 'this is the test body'
124+
stub_request(:any, 'example.com/test/stuff').to_return(:body => body, :headers => {'Content-Length' => '10'})
125+
get '/test/stuff'
126+
expect(last_response.headers['Content-Length']).to eq(body.length.to_s)
127+
end
128+
122129
describe "with non-default port" do
123130
def app
124131
Rack::ReverseProxy.new(dummy_app) do

0 commit comments

Comments
 (0)