honeybadger 2.3.1 → 2.3.2.beta.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: b8fd7ece78bb49eb737c7e1b63fcade6ec62681e
4
- data.tar.gz: d7403db13cc08a42b163935683efc7b2142c05c2
3
+ metadata.gz: 38da9f662383d281ad7a322daa0487915c2510aa
4
+ data.tar.gz: 11addbaca8a3be842d3d87a0525ef858a9676684
5
5
  SHA512:
6
- metadata.gz: 1b983bdca80d05e73242350255360c01cc67c69d4237e78707b920234bfa4e37d778b4c8de9e7610e85f9bef0c05179681182f65b8d0725aff9ba1374ee1c6f0
7
- data.tar.gz: 31b7be6e92207d526d78c6e4d72afb7b3c128eb1827adf33e0d75b8518763bac3ffc729017f08897aa8b67726a34b6837f5dcb950d501d403d49b066697eb836
6
+ metadata.gz: 54e65efde630cf3282af4218edde463f3b92059874551a0c852e48120657ae86bf9e4e9abc35f39387709c7d32e11766313c6f224d674967fda5beb59c5c30e4
7
+ data.tar.gz: 4993751cfb80e7c42a402275e8f233b05f72dbb5850c69b675dd10e0824ab2b42f0d5075ab00fbd743ad668a5d376e72246f618217cace90a4cce10cb6917238
data/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ## [Unreleased][unreleased]
7
7
 
8
+ ## [2.3.2.beta.1] - 2015-12-07
9
+ ## Fixed
10
+ - Be stricter when sanitizing recursive objects (allow only `Hash`, `Array`,
11
+ `Set`). This fixes a bug where some gems (such as the dropbox gem)
12
+ monkeypatch `#to_hash` on `Array`.
13
+
8
14
  ## [2.3.1] - 2015-11-20
9
15
  ## Fixed
10
16
  - Handle invalid utf8 in ActiveRecord SQL queries.
data/README.md CHANGED
@@ -39,7 +39,7 @@ Integrating with other libraries/frameworks is simple! [See the documentation](h
39
39
  | Resque | any | yes |
40
40
  | Delayed Job | any | yes |
41
41
 
42
- You can integrate honeybadger into any Ruby script by using manual exception notification, which is detailed below.
42
+ You can integrate honeybadger into any Ruby script via the `Honeybadger.notify` method.
43
43
 
44
44
  ## Getting Started
45
45
 
@@ -329,7 +329,7 @@ end
329
329
 
330
330
  ### `Honeybadger.exception_filter()`: Programmatically ignore exceptions
331
331
 
332
- This method lets you add a callback that will be run every time an exception is about to be reported to Honeybadger. If your callback returns a falsey value, the exception won't be reported. [View full method documentation](http://www.rubydoc.info/gems/honeybadger/Honeybadger%3Aexception_filter)
332
+ This method lets you add a callback that will be run every time an exception is about to be reported to Honeybadger. If your callback returns a truthy value, the exception won't be reported. [View full method documentation](http://www.rubydoc.info/gems/honeybadger/Honeybadger%3Aexception_filter)
333
333
 
334
334
  #### Use this method if:
335
335
 
@@ -174,7 +174,7 @@ module Honeybadger
174
174
  token: id,
175
175
  class: s(error_class),
176
176
  message: s(error_message),
177
- backtrace: s(backtrace),
177
+ backtrace: s(backtrace.to_a),
178
178
  source: s(source),
179
179
  fingerprint: s(fingerprint),
180
180
  tags: s(tags),
@@ -447,7 +447,7 @@ module Honeybadger
447
447
  c << {
448
448
  class: e.class.name,
449
449
  message: e.message,
450
- backtrace: parse_backtrace(e.backtrace || caller)
450
+ backtrace: parse_backtrace(e.backtrace || caller).to_a
451
451
  }
452
452
  i += 1
453
453
  end
@@ -3,8 +3,6 @@ require 'set'
3
3
  module Honeybadger
4
4
  module Util
5
5
  class Sanitizer
6
- OBJECT_WHITELIST = [Hash, Array, String, Integer, Float, TrueClass, FalseClass, NilClass]
7
-
8
6
  FILTERED_REPLACEMENT = '[FILTERED]'.freeze
9
7
 
10
8
  TRUNCATION_REPLACEMENT = '[TRUNCATED]'.freeze
@@ -26,15 +24,14 @@ module Honeybadger
26
24
  end
27
25
 
28
26
  def sanitize(data, depth = 0, stack = nil)
29
- if recursive?(data)
27
+ if data.kind_of?(Hash) || data.kind_of?(Array) || data.kind_of?(Set)
30
28
  return '[possible infinite recursion halted]' if stack && stack.include?(data.object_id)
31
29
  stack = stack ? stack.dup : Set.new
32
30
  stack << data.object_id
33
31
  end
34
32
 
35
- if data.kind_of?(String)
36
- self.class.sanitize_string(data)
37
- elsif data.respond_to?(:to_hash)
33
+ case data
34
+ when Hash
38
35
  return '[max depth reached]' if depth >= max_depth
39
36
  hash = data.to_hash
40
37
  new_hash = {}
@@ -47,14 +44,16 @@ module Honeybadger
47
44
  end
48
45
  end
49
46
  new_hash
50
- elsif data.respond_to?(:to_ary)
47
+ when Array, Set
51
48
  return '[max depth reached]' if depth >= max_depth
52
- data.to_ary.map do |value|
49
+ data.to_a.map do |value|
53
50
  sanitize(value, depth+1, stack)
54
51
  end.compact
55
- elsif OBJECT_WHITELIST.any? {|c| data.kind_of?(c) }
52
+ when Numeric, TrueClass, FalseClass, NilClass
56
53
  data
57
- else
54
+ when String
55
+ self.class.sanitize_string(data.to_s)
56
+ else # all other objects:
58
57
  self.class.sanitize_string(data.to_s)
59
58
  end
60
59
  end
@@ -119,10 +118,6 @@ module Honeybadger
119
118
 
120
119
  attr_reader :max_depth, :filters
121
120
 
122
- def recursive?(data)
123
- data.respond_to?(:to_hash) || data.respond_to?(:to_ary)
124
- end
125
-
126
121
  def filter_key?(key)
127
122
  return false unless filters
128
123
 
@@ -1,4 +1,4 @@
1
1
  module Honeybadger
2
2
  # Public: The current String Honeybadger version.
3
- VERSION = '2.3.1'.freeze
3
+ VERSION = '2.3.2.beta.1'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybadger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Honeybadger Industries LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-20 00:00:00.000000000 Z
11
+ date: 2015-12-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Make managing application errors a more pleasant experience.
14
14
  email:
@@ -134,9 +134,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
134
134
  version: 1.9.3
135
135
  required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - ">="
137
+ - - ">"
138
138
  - !ruby/object:Gem::Version
139
- version: '0'
139
+ version: 1.3.1
140
140
  requirements: []
141
141
  rubyforge_project:
142
142
  rubygems_version: 2.4.5