lib/rack/insight/toolbar.rb in rack-insight-0.5.10 vs lib/rack/insight/toolbar.rb in rack-insight-0.5.11
- old
+ new
@@ -31,10 +31,14 @@
response.ok? && MIME_TYPES.include?(content_type) && !req.xhr?
end
def inject_toolbar(response)
full_body = response.body.join
- full_body.sub! /<\/body>/, render + "</body>"
+
+ toolbar = render
+ toolbar.force_encoding('UTF-8') if RUBY_VERSION > '1.9.0'
+
+ full_body.sub! /<\/body>/, toolbar + "</body>"
response["Content-Length"] = full_body.size.to_s
# Ensure that browser doesn't cache
response["Etag"] = ""