While we're at not messing with stuff, don't mess with inlined content
This commit is contained in:
parent
75c50f7e92
commit
6b93954231
|
@ -59,7 +59,9 @@ module Rack
|
|||
else
|
||||
status, headers, body = result = @app.call(env)
|
||||
|
||||
if (headers['Content-Type'] and headers['Content-Type']['text/event-stream']) or headers['Transfer-Encoding'] == 'chunked'
|
||||
if (headers['Content-Type'] and headers['Content-Type']['text/event-stream']) or
|
||||
headers['Transfer-Encoding'] == 'chunked' or
|
||||
headers['Content-Disposition'] =~ %r{^inline}
|
||||
return result
|
||||
end
|
||||
|
||||
|
|
|
@ -94,6 +94,21 @@ describe Rack::LiveReload do
|
|||
end
|
||||
end
|
||||
|
||||
context 'inline disposition' do
|
||||
let(:body) { [ '<head></head>' ] }
|
||||
let(:ret) { [ 200, { 'Content-Disposition' => 'inline; filename=my_inlined_file' }, body ] }
|
||||
|
||||
before do
|
||||
app.stubs(:call).with(env).returns(ret)
|
||||
body.expects(:close).never
|
||||
body.stubs(:respond_to?).with(:close).returns(true)
|
||||
end
|
||||
|
||||
it 'should pass through' do
|
||||
middleware.call(env).should == ret
|
||||
end
|
||||
end
|
||||
|
||||
context 'unknown Content-Type' do
|
||||
let(:ret) { [ 200, {}, [ 'hey ho' ] ] }
|
||||
|
||||
|
|
Loading…
Reference in New Issue