Check that the content-type header is there first

This commit is contained in:
Enric Lluelles 2012-01-23 20:51:59 +01:00
parent ab4e7256bb
commit 90b9a75b35
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ module Rack
status, headers, body = @app.call(env) status, headers, body = @app.call(env)
if !ignored?(env['PATH_INFO']) && !bad_browser?(env['HTTP_USER_AGENT']) if !ignored?(env['PATH_INFO']) && !bad_browser?(env['HTTP_USER_AGENT'])
if headers['Content-Type'][%r{text/html}] if headers['Content-Type'] && headers['Content-Type'][%r{text/html}]
content_length = 0 content_length = 0
body.each do |line| body.each do |line|