Skip to content

Commit 0562207

Browse files
committed
Merge pull request jaswope#14 from waterlink/fix-content-length
Add test for content-length
2 parents df0e18c + 69fde96 commit 0562207

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spec/rack/reverse_proxy_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@ 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(
125+
:body => body, :headers => { "Content-Length" => "10" }
126+
)
127+
get "/test/stuff"
128+
expect(last_response.headers["Content-Length"]).to eq(body.length.to_s)
129+
end
130+
122131
describe "with non-default port" do
123132
def app
124133
Rack::ReverseProxy.new(dummy_app) do

0 commit comments

Comments
 (0)