lib/raygun/client.rb in raygun4ruby-2.1.0 vs lib/raygun/client.rb in raygun4ruby-2.2.0

- old
+ new

@@ -134,11 +134,14 @@ def raw_data(rack_env) return unless Raygun.configuration.record_raw_data request = Rack::Request.new(rack_env) input = rack_env['rack.input'] + return if request.get? - if input && !request.form_data? + # If size is 0 the buffer is at best empty and at worst + # something like the Puma::NullIO buffer which is missing methods + if input && input.size && !request.form_data? current_position = input.pos input.rewind body = (input.read || '').slice(0, 4096) input.seek(current_position)