rollbar 1.2.3 → 1.2.4

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: 974df157ef4f414f7ced05c23d2d0be0f4d49a9f
4
- data.tar.gz: 479ae3bd11bb3de2de5642f3b276f58a40640924
3
+ metadata.gz: 848cb96180e379178a47ca132eb966b8564907f6
4
+ data.tar.gz: 59a914a93b7358d55000ab5ed4c56ec66bff6661
5
5
  SHA512:
6
- metadata.gz: f6cc68a7e71d5d3aa58665ad4413a2bf865346d4b187147206c1075d5dc06832bdd0a1d43231f275fd97b265dc813dcf3376932f1111fdbf235d9cc498887d24
7
- data.tar.gz: 65e503c7599b35d659f2a2f45687a3e089ce034913279bd3ac1919ebc29c6dd31966f5dd881e17b01c137c943240319cd6592e507a5e968c7b1c468bd0d1fd0a
6
+ metadata.gz: 6548900e375f976d9a07bd1a9c3c466315ce71eebd076c67f008926fc697a3dbdceacca958ff3cae0dd7d6c435af43fd3be89bf29ac53ef139d134458488a2ff
7
+ data.tar.gz: f4cae49db511b1ee6ec231eabde6090e5a37344b4f25d23bc5adee7815d3bb8db77fcd2db3d810ecc521f36ed89bd94b5b20e2402127029327784c1a0031b39b
data/CHANGELOG.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # Change Log
2
2
 
3
- **1.2.3**
3
+ **1.2.4**
4
4
  - Fix issue where requiring 'rack' unnecessarily broke things in non-rack apps. See [#150](https://github.com/rollbar/rollbar-gem/pull/150)
5
+
6
+ **1.2.3**
5
7
  - Bring back `enforce_valid_utf8`, which got lost in the 1.2.0 upgrade. See [#148](https://github.com/rollbar/rollbar-gem/pull/148)
6
8
  - Fix bug with raw post extraction for application/json requests. See [#147](https://github.com/rollbar/rollbar-gem/pull/147)
7
9
 
data/lib/rollbar.rb CHANGED
@@ -12,7 +12,6 @@ end
12
12
  require 'rollbar/version'
13
13
  require 'rollbar/configuration'
14
14
  require 'rollbar/logger_proxy'
15
- require 'rollbar/request_data_extractor'
16
15
  require 'rollbar/exception_reporter'
17
16
  require 'rollbar/active_record_extension' if defined?(ActiveRecord)
18
17
  require 'rollbar/util'
@@ -1,12 +1,10 @@
1
1
  module Rollbar
2
2
  module ExceptionReporter
3
- include RequestDataExtractor
4
-
5
3
  def report_exception_to_rollbar(env, exception)
6
4
  Rollbar.log_debug "[Rollbar] Reporting exception: #{exception.try(:message)}"
7
-
5
+
8
6
  exception_data = Rollbar.log(Rollbar.configuration.uncaught_exception_level, exception)
9
-
7
+
10
8
  if exception_data.is_a?(Hash)
11
9
  env['rollbar.exception_uuid'] = exception_data[:uuid]
12
10
  Rollbar.log_debug "[Rollbar] Exception uuid saved in env: #{exception_data[:uuid]}"
@@ -1,3 +1,6 @@
1
+ require 'rollbar/request_data_extractor'
2
+ require 'rollbar/exception_reporter'
3
+
1
4
  module Rollbar
2
5
  module Middleware
3
6
  module Rails
@@ -1,3 +1,5 @@
1
+ require 'rollbar/request_data_extractor'
2
+
1
3
  module Rollbar
2
4
  module Rails
3
5
  module ControllerMethods
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = "1.2.3"
2
+ VERSION = "1.2.4"
3
3
  end
data/spec/rollbar_spec.rb CHANGED
@@ -606,44 +606,6 @@ describe Rollbar do
606
606
  end
607
607
  end
608
608
 
609
- context 'enforce_valid_utf8' do
610
- it 'should replace invalid utf8 values' do
611
- payload = {
612
- :bad_value => "bad value 1\255",
613
- :bad_value_2 => "bad\255 value 2",
614
- "bad\255 key" => "good value",
615
- :hash => {
616
- :inner_bad_value => "\255\255bad value 3",
617
- "inner \255bad key" => 'inner good value',
618
- "bad array key\255" => [
619
- 'good array value 1',
620
- "bad\255 array value 1\255",
621
- {
622
- :inner_inner_bad => "bad inner \255inner value"
623
- }
624
- ]
625
- }
626
- }
627
-
628
- payload_copy = payload.clone
629
- notifier.send(:enforce_valid_utf8, payload_copy)
630
-
631
- payload_copy[:bad_value].should == "bad value 1"
632
- payload_copy[:bad_value_2].should == "bad value 2"
633
- payload_copy["bad key"].should == "good value"
634
- payload_copy.keys.should_not include("bad\456 key")
635
- payload_copy[:hash][:inner_bad_value].should == "bad value 3"
636
- payload_copy[:hash]["inner bad key"].should == 'inner good value'
637
- payload_copy[:hash]["bad array key"].should == [
638
- 'good array value 1',
639
- 'bad array value 1',
640
- {
641
- :inner_inner_bad => 'bad inner inner value'
642
- }
643
- ]
644
- end
645
- end
646
-
647
609
  context 'truncate_payload' do
648
610
  it 'should truncate all nested strings in the payload' do
649
611
  payload = {
@@ -908,6 +870,19 @@ describe Rollbar do
908
870
 
909
871
  payload['data'][:level].should == 'debug'
910
872
  end
873
+
874
+ context 'with invalid utf8 encoding' do
875
+ let(:extra) do
876
+ { :extra => "bad value 1\255" }
877
+ end
878
+
879
+ it 'removes te invalid characteres' do
880
+ Rollbar.info('removing invalid chars', extra)
881
+
882
+ extra_value = Rollbar.last_report[:body][:message][:extra][:extra]
883
+ expect(extra_value).to be_eql('bad value 1')
884
+ end
885
+ end
911
886
  end
912
887
 
913
888
  # Backwards
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rollbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rollbar, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-22 00:00:00.000000000 Z
11
+ date: 2014-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json