Skip to content

Commit

Permalink
Fix issue with Appsignal middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
coorasse committed Aug 27, 2024
1 parent b2e56be commit d171251
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/rails_api_logger/inbound_requests_logger_middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ def log?(env, request)
def parsed_body(body)
return unless body.present?

if body.respond_to?(:body)
if body.respond_to?(:to_ary)
JSON.parse(body.to_ary[0])
elsif body.respond_to?(:body)
JSON.parse(body.body)
elsif body.respond_to?(:[])
JSON.parse(body[0])
else
body
end
Expand Down
2 changes: 1 addition & 1 deletion rails_api_logger.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |spec|
spec.name = "rails_api_logger"
spec.version = "0.8.1"
spec.version = "0.8.2"
spec.authors = ["Alessandro Rodi"]
spec.email = ["[email protected]"]

Expand Down

0 comments on commit d171251

Please sign in to comment.