Skip to content

Commit

Permalink
Merge pull request #71 from Sija/develop
Browse files Browse the repository at this point in the history
v1.7.2
  • Loading branch information
Sija authored Jun 24, 2020
2 parents d200756 + c4b94a2 commit d37386c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: raven
version: 1.7.1
version: 1.7.2

authors:
- Sijawusz Pur Rahnama <sija@sija.pl>
Expand Down
2 changes: 1 addition & 1 deletion src/raven/breadcrumb_buffer.cr
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module Raven
end

def empty?
!members.any?
members.empty?
end

def to_hash
Expand Down
11 changes: 5 additions & 6 deletions src/raven/integrations/kemal/log_handler.cr
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module Raven
elapsed = Time.monotonic - time

Raven.breadcrumbs.record do |crumb|
unless (200...400).includes? context.response.status_code
unless context.response.status_code.in?(100...400)
crumb.level = :error
end
crumb.type = :http
Expand All @@ -54,16 +54,15 @@ module Raven
}
end
end
context
end
end

def write(message)
if log_messages?
Raven.breadcrumbs.record do |crumb|
crumb.category = "kemal"
crumb.message = message.strip
end
Raven.breadcrumbs.record(
category: "kemal",
message: message.strip
)
end
@wrapped.try &.write(message)
end
Expand Down
9 changes: 8 additions & 1 deletion src/raven/integrations/shared/user_feedback_handler.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ module Raven
rescue ex
raise ex unless Raven.configuration.capture_allowed?(ex)
context.response.tap do |response|
response.status_code = 500
if response.closed?
Log.warn {
"Couldn't render user feedback view because the response has already been closed"
}
next
end
response.status = :internal_server_error
response.print render_view(ex)
response.close
end
context
end
Expand Down
2 changes: 1 addition & 1 deletion src/raven/processors/http_headers.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Raven
property sanitize_http_headers : Array(String | Regex)

private def use_boundary?(field)
!(field.is_a?(Regex) || DEFAULT_FIELDS.includes?(field))
!(field.is_a?(Regex) || field.in?(DEFAULT_FIELDS))
end

private getter fields_pattern : Regex {
Expand Down
2 changes: 1 addition & 1 deletion src/raven/processors/sanitize_data.cr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Raven
property? sanitize_credit_cards : Bool

private def use_boundary?(field)
!(field.is_a?(Regex) || DEFAULT_FIELDS.includes?(field))
!(field.is_a?(Regex) || field.in?(DEFAULT_FIELDS))
end

private getter fields_pattern : Regex {
Expand Down

0 comments on commit d37386c

Please sign in to comment.