lib/honeybadger/rack/user_feedback.rb in honeybadger-2.1.0 vs lib/honeybadger/rack/user_feedback.rb in honeybadger-2.1.1
- old
+ new
@@ -24,23 +24,19 @@
@config = config
end
def call(env)
status, headers, body = @app.call(env)
- if enabled? && env['honeybadger.error_id'] && form = render_form(env['honeybadger.error_id'])
+ if env['honeybadger.error_id'] && form = render_form(env['honeybadger.error_id'])
new_body = []
body.each do |chunk|
new_body << chunk.gsub("<!-- HONEYBADGER FEEDBACK -->", form)
end
body.close if body.respond_to?(:close)
headers['Content-Length'] = new_body.reduce(0) { |a,e| a += e.bytesize }.to_s
body = new_body
end
[status, headers, body]
- end
-
- def enabled?
- config[:'feedback.enabled']
end
def action
URI.parse("#{config.connection_protocol}://#{config[:'connection.host']}:#{config.connection_port}/v1/feedback/").to_s
rescue URI::InvalidURIError