lib/bullet/rack.rb in bullet-6.0.2 vs lib/bullet/rack.rb in bullet-6.1.0
- old
+ new
@@ -13,12 +13,13 @@
Bullet.start_request
status, headers, response = @app.call(env)
response_body = nil
+
if Bullet.notification?
- if !file?(headers) && !sse?(headers) && !empty?(response) && status == 200
+ if !Bullet.skip_html_injection? && !file?(headers) && !sse?(headers) && !empty?(response) && status == 200
if html_request?(headers, response)
response_body = response_body(response)
response_body = append_to_html_body(response_body, footer_note) if Bullet.add_footer
response_body = append_to_html_body(response_body, Bullet.gather_inline_notifications)
response_body = append_to_html_body(response_body, xhr_script)
@@ -59,11 +60,11 @@
def set_header(headers, header_name, header_array)
# Many proxy applications such as Nginx and AWS ELB limit
# the size a header to 8KB, so truncate the list of reports to
# be under that limit
- header_array.pop while header_array.to_json.length > 8 * 1024
+ header_array.pop while header_array.to_json.length > 8 * 1_024
headers[header_name] = header_array.to_json
end
def file?(headers)
headers['Content-Transfer-Encoding'] == 'binary' || headers['Content-Disposition']
@@ -96,10 +97,11 @@
color: rgb(119, 119, 119); font-size: 16px; font-family: 'Arial', sans-serif; z-index:9999;"
EOF
end
def footer_header
- cancel_button = "<span onclick='this.parentNode.remove()' style='position:absolute; right: 10px; top: 0px; font-weight: bold; color: #333;'>×</span>"
+ cancel_button =
+ "<span onclick='this.parentNode.remove()' style='position:absolute; right: 10px; top: 0px; font-weight: bold; color: #333;'>×</span>"
if Bullet.console_enabled?
"<span>See 'Uniform Notifier' in JS Console for Stacktrace</span>#{cancel_button}"
else
cancel_button
end