Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Actually use the streamer in the UserInformer

  • Loading branch information...
commit d34b742dab0b9002c7201c86cd076e831c4d9ec4 1 parent 1e8fb0e
@jyurek jyurek authored
View
7 lib/hoptoad_notifier/user_informer.rb
@@ -11,12 +11,7 @@ def replacement(with)
def call(env)
status, headers, body = @app.call(env)
if env['hoptoad.error_id'] && HoptoadNotifier.configuration.user_information
- new_body = []
- body.each do |chunk|
- new_body << chunk.gsub("<!-- HOPTOAD ERROR -->", replacement(env['hoptoad.error_id']))
- end
- headers['Content-Length'] = new_body.sum(&:length).to_s
- body = new_body
+ body = UserInformerStreamer.new(body, replacement(env['hoptoad.error_id']))
end
[status, headers, body]
end
View
1  test/user_informer_test.rb
@@ -12,7 +12,6 @@ class UserInformerTest < Test::Unit::TestCase
response = Net::HTTP.get_response(URI.parse("http://example.com/"))
assert_equal "Hoptoad Error 1", response.body
- assert_equal 15, response["Content-Length"].to_i
end
should "not modify output if there is no hoptoad id" do
Please sign in to comment.
Something went wrong with that request. Please try again.