rollbar 1.2.6 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +3 -3
- data/THANKS.md +1 -0
- data/lib/rollbar.rb +5 -0
- data/lib/rollbar/request_data_extractor.rb +2 -1
- data/lib/rollbar/version.rb +1 -1
- data/spec/rollbar/middleware/rack/builder_spec.rb +41 -0
- data/spec/rollbar_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07ce16a5ab6884c863b075b5577833c618d95331
|
4
|
+
data.tar.gz: 4179b7db73210d42a749530727e16a99851bc932
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c660d4e522c250e09638d12a67c25e13e44bfa8bb3ca6175333ae0be0429432bf8bc3f7a4f5e3a0f502f5be44fde5ff7fe14c1b259bd09ea7b9ca11646f9c3b
|
7
|
+
data.tar.gz: 5709042d36222c875d3de163d53f073f1367db082c931829f75115624dfa5d4aa77b6a5ba7120277afa416494048be2bd568a70527fdc4b86430287249a936e7
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
**1.2.7**
|
4
|
+
- Restore `exception_level_filters` feature, which was inadvertently removed in 1.2.0. See [#160](https://github.com/rollbar/rollbar-gem/pull/160)
|
5
|
+
- Fix bug where rollbar_url incorrectly handled comma-separated X-Forwarded-Proto header values. See [#112](https://github.com/rollbar/rollbar-gem/issues/112)
|
6
|
+
|
3
7
|
**1.2.6**
|
4
8
|
- Fix bug in non-Rails environments. See [#155](https://github.com/rollbar/rollbar-gem/pull/155)
|
5
9
|
- Fix intermittent test failures
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Rollbar notifier for Ruby [](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.
|
12
|
+
gem 'rollbar', '~> 1.2.7'
|
13
13
|
|
14
14
|
And then execute:
|
15
15
|
|
@@ -57,7 +57,7 @@ Be sure to initialize Rollbar with your access token somewhere during startup:
|
|
57
57
|
|
58
58
|
```ruby
|
59
59
|
Rollbar.configure do |config|
|
60
|
-
config.access_token = POST_SERVER_ITEM_ACCESS_TOKEN
|
60
|
+
config.access_token = 'POST_SERVER_ITEM_ACCESS_TOKEN'
|
61
61
|
# other configuration settings
|
62
62
|
# ...
|
63
63
|
end
|
data/THANKS.md
CHANGED
@@ -4,6 +4,7 @@ Huge thanks to the following contributors (by github username). For the most up-
|
|
4
4
|
|
5
5
|
- [alexdunae](https://github.com/alexdunae)
|
6
6
|
- [allspiritseve](https://github.com/allspiritseve)
|
7
|
+
- [antico5](https://github.com/antico5)
|
7
8
|
- [arr-ee](https://github.com/arr-ee)
|
8
9
|
- [awmichel](https://github.com/awmichel)
|
9
10
|
- [bradx3](https://github.com/bradx3)
|
data/lib/rollbar.rb
CHANGED
@@ -128,6 +128,9 @@ module Rollbar
|
|
128
128
|
|
129
129
|
return 'ignored' if ignored?(exception)
|
130
130
|
|
131
|
+
exception_level = filtered_level(exception)
|
132
|
+
level = exception_level if exception_level
|
133
|
+
|
131
134
|
begin
|
132
135
|
report(level, message, exception, extra)
|
133
136
|
rescue Exception => e
|
@@ -191,6 +194,8 @@ module Rollbar
|
|
191
194
|
end
|
192
195
|
|
193
196
|
def filtered_level(exception)
|
197
|
+
return unless exception
|
198
|
+
|
194
199
|
filter = configuration.exception_level_filters[exception.class.name]
|
195
200
|
if filter.respond_to?(:call)
|
196
201
|
filter.call(exception)
|
@@ -78,7 +78,8 @@ module Rollbar
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def rollbar_url(env)
|
81
|
-
|
81
|
+
forwarded_proto = env['HTTP_X_FORWARDED_PROTO'] || env['rack.url_scheme'] || ''
|
82
|
+
scheme = forwarded_proto.split(',').first
|
82
83
|
|
83
84
|
host = env['HTTP_X_FORWARDED_HOST'] || env['HTTP_HOST'] || env['SERVER_NAME']
|
84
85
|
path = env['ORIGINAL_FULLPATH'] || env['REQUEST_URI']
|
data/lib/rollbar/version.rb
CHANGED
@@ -85,4 +85,45 @@ describe Rollbar::Middleware::Rack::Builder, :reconfigure_notifier => true do
|
|
85
85
|
expect(reported_params['body.value']).to be_eql(1000)
|
86
86
|
end
|
87
87
|
end
|
88
|
+
|
89
|
+
context 'with multiple HTTP_X_FORWARDED_PROTO values' do
|
90
|
+
let(:headers) do
|
91
|
+
{ 'HTTP_X_FORWARDED_PROTO' => 'https,http' }
|
92
|
+
end
|
93
|
+
|
94
|
+
it 'uses the first scheme to generate the url' do
|
95
|
+
expect do
|
96
|
+
request.post('/will_crash', headers)
|
97
|
+
end.to raise_error(exception)
|
98
|
+
|
99
|
+
last_report = Rollbar.last_report
|
100
|
+
expect(last_report[:request][:url]).to match(/https:/)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
context 'without HTTP_X_FORWARDED_PROTO' do
|
105
|
+
it 'uses the the url_scheme set by Rack' do
|
106
|
+
expect do
|
107
|
+
request.post('/will_crash')
|
108
|
+
end.to raise_error(exception)
|
109
|
+
|
110
|
+
last_report = Rollbar.last_report
|
111
|
+
expect(last_report[:request][:url]).to match(/http:/)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
context 'with single HTTP_X_FORWARDED_PROTO value' do
|
116
|
+
let(:headers) do
|
117
|
+
{ 'HTTP_X_FORWARDED_PROTO' => 'https' }
|
118
|
+
end
|
119
|
+
|
120
|
+
it 'uses the scheme received in X-Forwarded-Proto header' do
|
121
|
+
expect do
|
122
|
+
request.post('/will_crash', headers)
|
123
|
+
end.to raise_error(exception)
|
124
|
+
|
125
|
+
last_report = Rollbar.last_report
|
126
|
+
expect(last_report[:request][:url]).to match(/https:/)
|
127
|
+
end
|
128
|
+
end
|
88
129
|
end
|
data/spec/rollbar_spec.rb
CHANGED
@@ -725,6 +725,15 @@ describe Rollbar do
|
|
725
725
|
Rollbar.error(exception)
|
726
726
|
end
|
727
727
|
|
728
|
+
it 'sends the correct filtered level' do
|
729
|
+
Rollbar.configure do |config|
|
730
|
+
config.exception_level_filters = { 'NameError' => 'warning' }
|
731
|
+
end
|
732
|
+
|
733
|
+
Rollbar.error(exception)
|
734
|
+
expect(Rollbar.last_report[:level]).to be_eql('warning')
|
735
|
+
end
|
736
|
+
|
728
737
|
it "should work with an IO object as rack.errors" do
|
729
738
|
logger_mock.should_receive(:info).with('[Rollbar] Success')
|
730
739
|
|
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.
|
4
|
+
version: 1.2.7
|
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-
|
11
|
+
date: 2014-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|