rollbar 1.2.2 → 1.2.3

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: 1a432f94f474059f9731e64f22f23963c4b3926e
4
- data.tar.gz: 0ccbc7ed06b952be8139592dcc7e40ca8ff396be
3
+ metadata.gz: 974df157ef4f414f7ced05c23d2d0be0f4d49a9f
4
+ data.tar.gz: 479ae3bd11bb3de2de5642f3b276f58a40640924
5
5
  SHA512:
6
- metadata.gz: 098d37ecd9ba8c011bc73fb23da48d90d19c70d123a455412ede696de8b22c369a76b3a80fb9d8874afc6c7ab3c2dadda2a205ad1b7e8430f3e68339d68b837d
7
- data.tar.gz: ba67c227bd1f08f21943cfcfa58a043c0be64845d5e98b227456fac58caecb2713110322c1c10482d14ef2e490a12fcfaf7c2eb5b80c37a198211fd7e3460c72
6
+ metadata.gz: f6cc68a7e71d5d3aa58665ad4413a2bf865346d4b187147206c1075d5dc06832bdd0a1d43231f275fd97b265dc813dcf3376932f1111fdbf235d9cc498887d24
7
+ data.tar.gz: 65e503c7599b35d659f2a2f45687a3e089ce034913279bd3ac1919ebc29c6dd31966f5dd881e17b01c137c943240319cd6592e507a5e968c7b1c468bd0d1fd0a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ **1.2.3**
4
+ - Fix issue where requiring 'rack' unnecessarily broke things in non-rack apps. See [#150](https://github.com/rollbar/rollbar-gem/pull/150)
5
+ - 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
+ - Fix bug with raw post extraction for application/json requests. See [#147](https://github.com/rollbar/rollbar-gem/pull/147)
7
+
3
8
  **1.2.2**
4
9
  - Fix issue with delayed_job and Rollbar.report_exception (bug introduced in 1.2.0). See [#145](https://github.com/rollbar/rollbar-gem/issues/145)
5
10
  - Explicitly require 'rack' in request_data_extractor. See [#144](https://github.com/rollbar/rollbar-gem/pull/144)
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Rollbar notifier for Ruby [![Build Status](https://secure.travis-ci.org/rollbar/rollbar-gem.png?branch=master)](https://travis-ci.org/rollbar/rollbar-gem)
1
+ # Rollbar notifier for Ruby [![Build Status](https://api.travis-ci.org/rollbar/rollbar-gem.svg?branch=v1.1.0)](https://travis-ci.org/rollbar/rollbar-gem/branches)
2
2
 
3
3
  <!-- RemoveNext -->
4
4
  Ruby gem for reporting exceptions, errors, and log messages to [Rollbar](https://rollbar.com).
@@ -9,7 +9,7 @@ Ruby gem for reporting exceptions, errors, and log messages to [Rollbar](https:/
9
9
 
10
10
  Add this line to your application's Gemfile:
11
11
 
12
- gem 'rollbar', '~> 1.2.1'
12
+ gem 'rollbar', '~> 1.1.0'
13
13
 
14
14
  And then execute:
15
15
 
data/lib/rollbar.rb CHANGED
@@ -279,10 +279,14 @@ module Rollbar
279
279
 
280
280
  Rollbar::Util.deep_merge(data, configuration.payload_options)
281
281
 
282
- {
282
+ payload = {
283
283
  'access_token' => configuration.access_token,
284
284
  'data' => data
285
285
  }
286
+
287
+ enforce_valid_utf8(payload)
288
+
289
+ payload
286
290
  end
287
291
 
288
292
  def build_payload_body(message, exception, extra)
@@ -103,10 +103,11 @@ module Rollbar
103
103
  def rollbar_raw_post_params(rack_req)
104
104
  return {} unless rack_req.env['CONTENT_TYPE'] =~ %r{application/json}i
105
105
 
106
- params = MultiJson.decode(rack_req.body.read)
106
+ MultiJson.decode(rack_req.body.read)
107
+ rescue
108
+ {}
109
+ ensure
107
110
  rack_req.body.rewind
108
-
109
- params
110
111
  end
111
112
 
112
113
  def rollbar_request_params(env)
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
@@ -40,7 +40,6 @@ describe Rollbar::Middleware::Rack::Builder do
40
40
  request.get('/will_crash', :params => params)
41
41
  end.to raise_error(exception)
42
42
 
43
-
44
43
  expect(Rollbar.last_report[:request][:params]).to be_eql(params)
45
44
  end
46
45
  end
@@ -52,10 +51,22 @@ describe Rollbar::Middleware::Rack::Builder do
52
51
 
53
52
  it 'sends them to Rollbar' do
54
53
  expect do
55
- request.post('/will_crash', :params => params, 'CONTENT_TYPE' => 'application/json')
54
+ request.post('/will_crash', :input => params.to_json, 'CONTENT_TYPE' => 'application/json')
56
55
  end.to raise_error(exception)
57
56
 
58
57
  expect(Rollbar.last_report[:request][:params]).to be_eql(params)
59
58
  end
59
+
60
+ context 'with crashing payload' do
61
+ let(:body) { 'this is not a valid json' }
62
+
63
+ it 'returns {} and doesnt raise' do
64
+ expect do
65
+ request.post('/dont_crash', :input => body, 'CONTENT_TYPE' => 'application/json')
66
+ end.to raise_error(exception)
67
+
68
+ expect(Rollbar.last_report[:request][:params]).to be_eql({})
69
+ end
70
+ end
60
71
  end
61
72
  end
data/spec/spec_helper.rb CHANGED
@@ -34,6 +34,7 @@ RSpec.configure do |config|
34
34
  config.after(:each) do
35
35
  DatabaseCleaner.clean
36
36
  end
37
+ config.backtrace_exclusion_patterns = [/gems\/rspec-.*/]
37
38
  end
38
39
 
39
40
  def reset_configuration
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.2
4
+ version: 1.2.3
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-20 00:00:00.000000000 Z
11
+ date: 2014-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json