Skip to content

Commit

Permalink
Add handling for possible nil value of env['SCRIPT_NAME']
Browse files Browse the repository at this point in the history
  • Loading branch information
y9v committed Sep 17, 2024
1 parent c62c24d commit b72916c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/datadog/tracing/contrib/rack/middlewares.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def set_request_tags!(trace, request_span, env, status, headers, response, origi
#
# To account for the unaccounted nested rack requests of /rack/hello/world,
# we use 'PATH_INFO knowing that rack cannot have named parameters
if last_script_name == '' && env['SCRIPT_NAME'] != ''
if last_script_name == '' && env['SCRIPT_NAME'] && env['SCRIPT_NAME'] != ''
last_script_name = last_route
last_route = env['PATH_INFO']
end
Expand Down

0 comments on commit b72916c

Please sign in to comment.