Permalink
Browse files

it is enough to test <html> without </html>

  • Loading branch information...
1 parent 6368686 commit aa778cec3c682a8283514082f449d19b55e7764a @flyerhzm committed Jun 6, 2012
Showing with 2 additions and 6 deletions.
  1. +1 −2 lib/bullet/action_controller2.rb
  2. +1 −4 lib/bullet/rack.rb
@@ -29,8 +29,7 @@ def process(request, response, method = :perform_action, *arguments)
response = origin_process(request, response, method = :perform_action, *arguments)
if Bullet.notification?
- if response.headers["type"] && response.headers["type"].include?('text/html') &&
- response.body.include?("<html>") && response.body.include?("</html>")
+ if response.headers["type"] && response.headers["type"].include?('text/html') && response.body.include?("<html>")
response.body <<= Bullet.gather_inline_notifications
response.headers["Content-Length"] = response.body.length.to_s
end
View
@@ -37,10 +37,7 @@ def file?(headers)
end
def html_request?(headers, response)
- headers['Content-Type'] &&
- headers['Content-Type'].include?('text/html') &&
- response.body.include?("<html>") &&
- response.body.include?("</html>")
+ headers['Content-Type'] && headers['Content-Type'].include?('text/html') && response.body.include?("<html>")
end
def no_browser_cache(headers)

0 comments on commit aa778ce

Please sign in to comment.