From 90b9a75b35bea38967734b7ac56b21b5b5caf746 Mon Sep 17 00:00:00 2001 From: Enric Lluelles Date: Mon, 23 Jan 2012 20:51:59 +0100 Subject: [PATCH] Check that the content-type header is there first --- lib/rack/livereload.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rack/livereload.rb b/lib/rack/livereload.rb index bfba052..3de003d 100644 --- a/lib/rack/livereload.rb +++ b/lib/rack/livereload.rb @@ -50,7 +50,7 @@ module Rack status, headers, body = @app.call(env) 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 body.each do |line|