raygun4ruby 2.4.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30c96f5c697418070d9887e7bd698f3d560c50ea
4
- data.tar.gz: 3320b9b575ddbc04a06e61b26bb848b30d4e4c7e
3
+ metadata.gz: 8406d25f885f4bff7478ef400ec6b6533beabeb1
4
+ data.tar.gz: 0cff5631608f72c7fe29e42b043f0e45a05c0f33
5
5
  SHA512:
6
- metadata.gz: ef94e8d1e90c14929c84b5d13bfa3ecd868379c422113f94b0116f109273a5c2c97182001e2eb52bc9f4898233df4420d4ab28fa14cf77acfed34273fa5f01d6
7
- data.tar.gz: ebf0bd808d57af7b29fac0326f8b79b380461bede714f9db014845b8dbf78933f354559a31d8158e6a18c831667689a0960180b3776e8232425ab7abedea071e
6
+ metadata.gz: 81aaeb31a3c51c0aab19614aedc0be72ff9bc3b047e54534f665ef296449617e536dcf0f9eae3776609790bed94b776bd3820a28bd7e773a844fce7204b44816
7
+ data.tar.gz: 33b0cbebc15be4473bbec8db356ccc09138b6fa8d33538bf1394518d96c527e902c442a5fa332678631d66e4d0ef995713b3f091e92431360764b446a9dfe907
data/CHANGELOG.md CHANGED
@@ -1,7 +1,13 @@
1
+ ## 2.4.1 (29/08/2017)
2
+
3
+ Bugfixes
4
+ - Fix crash in `Client#raw_data` method when `rack.input` buffer is missing `pos` method
5
+
1
6
  ## 2.4.0 (31/07/2017)
2
7
 
3
8
  Features
4
9
  - Add functionality to track affected user in Sidekiq jobs, refer to the README for more information, under the "Affected User Tracking in Sidekiq" heading ([#121](https://github.com/MindscapeHQ/raygun4ruby/pull/121))
10
+
5
11
  ## 2.3.0 (09/05/2017)"
6
12
 
7
13
  Bugfixes
data/lib/raygun/client.rb CHANGED
@@ -140,7 +140,7 @@ module Raygun
140
140
 
141
141
  # If size is 0 the buffer is at best empty and at worst
142
142
  # something like the Puma::NullIO buffer which is missing methods
143
- if input && input.size && !request.form_data?
143
+ if input && input.size && input.respond_to?(:pos) && !request.form_data?
144
144
  current_position = input.pos
145
145
  input.rewind
146
146
 
@@ -1,3 +1,3 @@
1
1
  module Raygun
2
- VERSION = "2.4.0"
2
+ VERSION = "2.4.1"
3
3
  end
@@ -656,6 +656,35 @@ class ClientTest < Raygun::UnitTest
656
656
  assert breadcrumbs[0].is_a? Hash
657
657
  end
658
658
 
659
+ def test_raw_data_rewinds_and_restores_correctly
660
+ buffer = StringIO.new('123456789')
661
+ rack_env = {
662
+ REQUEST_METHOD: 'POST',
663
+ 'rack.input' => buffer
664
+ }
665
+
666
+ buffer.seek(2)
667
+
668
+ raw_data = @client.send(:raw_data, rack_env)
669
+
670
+ assert_equal '123456789', raw_data
671
+ assert_equal buffer.pos, 2
672
+ end
673
+
674
+ def test_raw_data_does_not_crash_on_buffer_without_pos
675
+ buffer = StringIO.new('123456789')
676
+ rack_env = {
677
+ REQUEST_METHOD: 'POST',
678
+ 'rack.input' => buffer
679
+ }
680
+
681
+ buffer.instance_eval('undef :pos')
682
+
683
+ raw_data = @client.send(:raw_data, rack_env)
684
+
685
+ assert_equal({}, raw_data)
686
+ end
687
+
659
688
  private
660
689
 
661
690
  def test_exception
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raygun4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mindscape
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-07-30 00:00:00.000000000 Z
12
+ date: 2017-08-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty