Skip to content

Commit

Permalink
Fallback to detect controller and action from action_dispatch.request…
Browse files Browse the repository at this point in the history
….parameters as symbols
  • Loading branch information
dlanderson committed May 3, 2024
1 parent 66c1f39 commit 7e0b274
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/prometheus_exporter/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def default_labels(env, result)
params = env["action_dispatch.request.parameters"]
action = controller = nil
if params
action = params["action"]
controller = params["controller"]
action = params["action"] || params[:action]
controller = params["controller"] || params[:controller]
elsif (cors = env["rack.cors"]) && cors.respond_to?(:preflight?) && cors.preflight?
# if the Rack CORS Middleware identifies the request as a preflight request,
# the stack doesn't get to the point where controllers/actions are defined
Expand Down

0 comments on commit 7e0b274

Please sign in to comment.