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

Missing ActionContoller event fields due to #process_action monkey patch #175

Open
avlazarov opened this issue Dec 30, 2021 · 2 comments
Open

Comments

@avlazarov
Copy link

Hey!

I'm trying to get information about the request's headers after ActiveSupport::Notifications.subscribe 'process_action.action_controller', but the :headers key is missing from the event's payload. As far as I can see, this gem monkey patches ActionController::Instrumentation#process_action hence a few Rails generated fields will be missing: headers and request.

Could these extra fields be still visible for subscribers of the ActionController?

@shadabahmed
Copy link
Owner

@avlazarov good point - would you be able to create a PR ?

cc @petergoldstein

@avlazarov
Copy link
Author

@shadabahmed Sure, but before that I have a few questions about the current guards, namely:


path: begin
request.fullpath
rescue StandardError
'unknown'
end

I've gone through all versions that this gem supports (Rails 5.2+) and none seem to be defensive about format and path:

Am I missing something or can I just use the instrumentation logic from Rails 7.0, without any guards?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants