Skip to content

Commit d171251

Browse files
committedAug 27, 2024·
Fix issue with Appsignal middleware
1 parent b2e56be commit d171251

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎lib/rails_api_logger/inbound_requests_logger_middleware.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ def log?(env, request)
4242
def parsed_body(body)
4343
return unless body.present?
4444

45-
if body.respond_to?(:body)
45+
if body.respond_to?(:to_ary)
46+
JSON.parse(body.to_ary[0])
47+
elsif body.respond_to?(:body)
4648
JSON.parse(body.body)
47-
elsif body.respond_to?(:[])
48-
JSON.parse(body[0])
4949
else
5050
body
5151
end

‎rails_api_logger.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |spec|
22
spec.name = "rails_api_logger"
3-
spec.version = "0.8.1"
3+
spec.version = "0.8.2"
44
spec.authors = ["Alessandro Rodi"]
55
spec.email = ["alessandro.rodi@renuo.ch"]
66

0 commit comments

Comments
 (0)
Please sign in to comment.