Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip params when unavailable #39

Merged
merged 2 commits into from
Oct 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/honeycomb/integrations/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ def add_package_information(env)
yield "meta.package_version", ::Rails::VERSION::STRING

::ActionDispatch::Request.new(env).tap do |request|
yield "request.controller", request.params[:controller]
yield "request.action", request.params[:action]
# calling request.params will blow up if raw_post is nil
# the only known cause of this is when using the
# [twirp](https://github.com/twitchtv/twirp-ruby) rack app mounted in
# the rails app
if request.raw_post
yield "request.controller", request.params[:controller]
yield "request.action", request.params[:action]
end

break unless request.respond_to? :routes
break unless request.routes.respond_to? :router
Expand Down