summaryrefslogtreecommitdiff
path: root/test/spec_content_length.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2011-05-19 21:46:15 -0500
committerJoshua Peek <josh@joshpeek.com>2011-05-19 21:46:15 -0500
commitbc30108180e2472423497657b55f7ccb8749a7a0 (patch)
treea6819a8246e4c21987e96ea844c2542a82d68c27 /test/spec_content_length.rb
parent1e99b9bcc7e9519d32e028fb1f24d6ef3b34b597 (diff)
downloadrack-bc30108180e2472423497657b55f7ccb8749a7a0.tar.gz
Revert "Improve Rack::ContentLength middleware."
This reverts commit 2b3abc73f3e3a23110f2c8f43458416674130511.
Diffstat (limited to 'test/spec_content_length.rb')
-rw-r--r--test/spec_content_length.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/test/spec_content_length.rb b/test/spec_content_length.rb
index e28b4f72..68d9270a 100644
--- a/test/spec_content_length.rb
+++ b/test/spec_content_length.rb
@@ -7,13 +7,13 @@ describe Rack::ContentLength do
response[1]['Content-Length'].should.equal '13'
end
- should "set Content-Length even on variable length bodies" do
+ should "not set Content-Length on variable length bodies" do
body = lambda { "Hello World!" }
def body.each ; yield call ; end
app = lambda { |env| [200, {'Content-Type' => 'text/plain'}, body] }
response = Rack::ContentLength.new(app).call({})
- response[1]['Content-Length'].should.equal '12'
+ response[1]['Content-Length'].should.be.nil
end
should "not change Content-Length if it is already set" do
@@ -28,12 +28,6 @@ describe Rack::ContentLength do
response[1]['Content-Length'].should.equal nil
end
- should "not set Content-Length on sendfile responses" do
- app = lambda { |env| [200, {'Content-Type' => 'text/plain', 'X-Sendfile' => 'foo'}, %w(Hello World)] }
- response = Rack::ContentLength.new(app, "X-Sendfile").call({})
- response[1]['Content-Length'].should.equal nil
- end
-
should "not set Content-Length when Transfer-Encoding is chunked" do
app = lambda { |env| [200, {'Transfer-Encoding' => 'chunked'}, []] }
response = Rack::ContentLength.new(app).call({})